--- - name: Check tomcat_instance_name debug: msg: "{{ tomcat_instance_name }}" - name: Check use of gid command: id -ng "{{ tomcat_instance_port }}" register: check_port_gid changed_when: False failed_when: - check_port_gid | success - check_port_gid.stdout != "{{ tomcat_instance_name }}" - name: Check use of uid command: id -nu "{{ tomcat_instance_port }}" register: check_port_uid changed_when: False failed_when: - check_port_uid | success - check_port_uid.stdout != "{{ tomcat_instance_name }}" #- name: Check use of http port # command: grep '