ansible-roles/tomcat-instance/tasks/check.yml

40 lines
1.1 KiB
YAML
Raw Normal View History

2017-01-03 12:41:19 +01:00
---
- name: Check tomcat_instance_name
debug:
msg: "{{ tomcat_instance_name }}"
- name: Check use of gid
shell: id -ng "{{ tomcat_instance_port }}"
register: check_port_gid
changed_when: false
2017-03-24 14:15:09 +01:00
2017-01-03 12:41:19 +01:00
failed_when:
2017-02-06 13:28:04 +01:00
- check_port_gid|success
2017-01-03 12:41:19 +01:00
- check_port_gid.stdout != "{{ tomcat_instance_name }}"
- name: Check use of uid
shell: id -nu "{{ tomcat_instance_port }}"
register: check_port_uid
2017-03-24 14:15:09 +01:00
2017-01-03 12:41:19 +01:00
changed_when: false
failed_when:
2017-02-06 13:28:04 +01:00
- check_port_uid|success
2017-01-03 12:41:19 +01:00
- check_port_uid.stdout != "{{ tomcat_instance_name }}"
#- name: Check use of http port
# shell: grep '<Connector port="{{ tomcat_instance_port }}" protocol="HTTP/1.1"' $(ls {{ tomcat_instance_root }}/*/conf/server.xml|grep -v {{ tomcat_instance_name }})
- name: Set shutdown port (default=http port + 1)
set_fact:
tomcat_instance_shutdown: "{{ tomcat_instance_port | int + 1 }}"
when: tomcat_instance_shutdown is undefined
- name: Set tomcat mps (default=ram/2)
set_fact:
tomcat_instance_mps: "{{ tomcat_instance_ram | int / 2 }}"
when: tomcat_instance_mps is undefined
- name: Fix mps type
set_fact:
tomcat_instance_mps: "{{ tomcat_instance_mps | int }}"