Commit 7edb4b79 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

Check for firewall state better one

parent ebd0b1e0
---
# ignore erros will be even here or later
- name: check firewalld state
command: systemctl is-active firewalld
systemd:
name: firewalld
check_mode: yes
register: firewalld_state
changed_when: false
ignore_errors: yes
tags:
- config
- firewall
......@@ -16,7 +15,7 @@
state: enabled
immediate: true
with_items: "{{ groups['all'] }}"
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
tags:
- config
- firewall
......@@ -27,7 +26,7 @@
permanent: true
state: enabled
immediate: true
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
tags:
- config
- firewall
......
---
# ignore erros will be even here or later
- name: check firewalld state
command: systemctl is-active firewalld
systemd:
name: firewalld
check_mode: yes
register: firewalld_state
changed_when: false
ignore_errors: yes
tags:
- config
- firewall
......@@ -16,7 +15,7 @@
state: enabled
immediate: true
with_items: "{{ groups['all'] }}"
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
tags:
- config
- firewall
......@@ -27,7 +26,7 @@
permanent: true
state: enabled
immediate: true
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
tags:
- config
- firewall
\ No newline at end of file
......@@ -25,9 +25,10 @@
- reload systemd
- restart consul
# ignore erros will be even here or later
- name: check firewalld state
command: systemctl is-active firewalld
systemd:
name: firewalld
check_mode: yes
register: firewalld_state
changed_when: false
ignore_errors: yes
......@@ -41,7 +42,7 @@
permanent: true
state: enabled
immediate: true
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
with_items:
- 8300/tcp
- 8301/tcp
......
......@@ -25,12 +25,11 @@
- reload systemd
- restart consul
# ignore erros will be even here or later
- name: check firewalld state
command: systemctl is-active firewalld
systemd:
name: firewalld
check_mode: yes
register: firewalld_state
changed_when: false
ignore_errors: yes
tags:
- config
- firewall
......@@ -41,7 +40,7 @@
permanent: true
state: enabled
immediate: true
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
with_items:
- 8300/tcp
- 8301/tcp
......
---
# ignore erros will be even here or later
- name: check firewalld state
command: systemctl is-active firewalld
systemd:
name: firewalld
check_mode: yes
register: firewalld_state
changed_when: false
ignore_errors: yes
tags:
- config
- firewall
......@@ -15,7 +14,7 @@
permanent: true
state: enabled
immediate: true
when: "firewalld_state.stdout == 'active'"
when: "firewalld_state.status.ActiveState == 'active'"
tags:
- config
- firewall
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment