rpm.yml 679 B

12345678910111213141516171819202122232425262728293031
  1. ---
  2. - name: RPM | Determine if firewalld installed
  3. command: "rpm -q firewalld"
  4. register: s
  5. changed_when: false
  6. failed_when: false
  7. check_mode: no
  8. - name: RPM | Determine if firewalld enabled
  9. command: "systemctl status firewalld.service"
  10. register: ss
  11. changed_when: false
  12. failed_when: false
  13. check_mode: no
  14. - name: Set the has_firewalld fact
  15. set_fact:
  16. has_firewalld: true
  17. when: s.rc == 0 and ss.rc == 0
  18. - name: Determine if iptables-services installed
  19. command: "rpm -q iptables-services"
  20. register: s
  21. changed_when: false
  22. failed_when: false
  23. check_mode: no
  24. - name: Set the has_iptables fact
  25. set_fact:
  26. has_iptables: true
  27. when: s.rc == 0