-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker rules are flushed on each run #82
Comments
This role has an option "firewall_flush_rules_and_chains:" Therefore, I made a correction, and added options To use Docker you need to add you can use this role with my fixes https://github.com/alexeychusta/ansible-firewall |
Hello. Thanks, i'll try it asap. |
I will likely be revamping this role a little bit to allow something similar, as this has bitten me in the past as well with Docker and this role side-by-side. |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. |
This issue is no longer marked for closure. |
1 similar comment
This issue is no longer marked for closure. |
Hey @geerlingguy since mikegleasonjr/ansible-role-firewall is no longer maintained I will use your role and my first thing I was looking for was the same behaviour with docker since mikegleasonjr/ansible-role-firewall was also flushing existing rules. So what's the current state? Is there something we can do to make this feature available asap? |
Btw. maybe it helps someone: - hosts: all
become: yes
become_user: root
pre_tasks:
- include: tasks/pre/load_vars.yml
roles:
- role: community/firewall
tasks:
- name: Populate service facts
ansible.builtin.service_facts:
- name: Restart docker to revert iptables chains
ansible.builtin.service:
name: docker
state: restarted
when: ansible_facts.services["docker.service"] is defined
- name: Restart fail2ban to revert iptables chains
ansible.builtin.service:
name: fail2ban
state: restarted
when: ansible_facts.services["fail2ban.service"] is defined |
PR (for compatibility with docker): #106 |
thanks @renepardon for the hint. I did the following to restart docker and fail2ban when firewall is restarted:
I want to avoid making change to the handler, but don't know a better way |
Hello, forgive me for my bad english.
First, special thanks for your ansible roles. I use them everyday in my pipelines for all servers (dev, prod, etc.).
I'm trying this role to manage iptables rules over a ci/cd pipeline. On each run, all rules are removed on all servers and new rules are applied.
My servers have docker installed and all iptables rules added by docker are flushed and docker needs to be restarted.
Is there a way to apply new rules dynamically ?
Thanks.
The text was updated successfully, but these errors were encountered: