I am trying to create a playbook to check if the firewall is running, if so 
add the rsyslog port. If the firewall is not running, id like to skip the 
port adding step. Please share some docs. I can't seem to find any. So 
far I've came up with this...


#  - name: ensure that firewalld is running
#    service:
#     name: “syslog”
#     state: started
#     enabled: yes
#    register: firewalld_status

#  - debug: msg="firewalld is running"
#    when: firewalld_status.stdout.find("running") != -1
#
#  - debug: msg="firewalld is not running"
#    when: firewalld_status.stdout.find("running") == -1
- name: Try to restart 1514 if not started
#    service:
#      name: rsyslog
#      state: started
#      enabled: yes
#    when: port_check.failed == true
 # - name: Check if firewall running
 #   service:
 #     name: rsyslog
 #     state: started
     # register: firewall_running
     # check_mode: true

#  - name: Add syslog port to firewall
#    when: not firewall_running is changed


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b7a39f32-1b4e-440a-91a2-a27cfa6168f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to