diff --git a/filter_plugins/__pycache__/ipaddr.cpython-39.pyc b/filter_plugins/__pycache__/ipaddr.cpython-39.pyc index da8c8f4..0c1484f 100644 Binary files a/filter_plugins/__pycache__/ipaddr.cpython-39.pyc and b/filter_plugins/__pycache__/ipaddr.cpython-39.pyc differ diff --git a/playbooks/mrwho/vm03-firewall.yml b/playbooks/mrwho/vm03-firewall.yml index 817aa9b..b6623a3 100644 --- a/playbooks/mrwho/vm03-firewall.yml +++ b/playbooks/mrwho/vm03-firewall.yml @@ -96,11 +96,26 @@ # zone: external # state: enabled # permanent: true - - policy: lan-to-wan - state: enabled - permanent: true - masquerade: true - ingress_zones: - - internal - egress_zones: - - public +# - policy: lan-to-wan +# state: enabled +# permanent: true +# masquerade: true +# ingress_zones: +# - internal +# egress_zones: +# - public + + post-tasks: + - name: Создаем политику firewalld + ansible.builtin.command: > + firewall-cmd --permanent --new-policy lan-to-wan + failed_when: false # Игнорируем ошибку, если политика уже создана + + - name: Настраиваем зоны и правила для политики + ansible.builtin.command: "{{ item }}" + loop: + - "firewall-cmd --permanent --policy lan-to-wan --add-ingress-zone internal" + - "firewall-cmd --permanent --policy lan-to-wan --add-egress-zone public" + - "firewall-cmd --permanent --policy lan-to-wan --set-target ACCEPT" + - "firewall-cmd --permanent --policy lan-to-wan --masquerade" + notify: Reload firewalld \ No newline at end of file