-
Notifications
You must be signed in to change notification settings - Fork 0
[#42] Removing purge_networks as it no longer works with Ansible 11+ #67
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
base: main
Are you sure you want to change the base?
Conversation
SilviaAmAm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation on porting to the new version says:
docker_container - the purge_networks option has been removed. Use networks: strict in comparisons instead and make sure that networks is specified (https://github.com/ansible-collections/community.docker/pull/971).
So I think that we should also add:
comparisons:
networks: strict
In https://github.com/maykinmedia/ansible-collection/blob/main/roles/django_app_docker/templates/django-container.yml.j2 (at the end of the file)
Done, I wasn't 100% sure what this does |
|
Discussed: lets try to make this conditional so that it still works for Ansible 10 https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#ansible-version Assumption is that purge_networks shouldn't be used with ansible-core 2.18 or newer, and that networks: strict already exists for older ansibles (but this it to be verified!) ansible==10.7.0 |
|
@SilviaAmAm purge_networks is now conditional depending on the ansible version, I've tried it on ansible 10 and it seems to work but please doublecheck |
| network_mode: "{{ django_app_docker_name_prefix }}" | ||
| purge_networks: true | ||
| networks_cli_compatible: true | ||
| {% if ansible_version.major == 2 and ansible_version.minor <= 10 %}purge_networks: true{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hesitate 🤔 I had locally 2.17.14 for the ansible-core version in commonground-deployment, so then I would be missing this.
Since we don't specify in all repo specific ansible version requirements, maybe we should make all the upgrades for newer ansible versions in one go and then update all the repositories 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this the idea, that you would only have purge_networks for older ansible-core versions?
ansible-core 2.10 is more or less ancient ( https://endoflife.date/ansible-core ) however I noticed that the Sjoerd-repo's still explicitly state installing ansible==10.x
Fixes #42