Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Fix Ansible 12 compatibility by updating conditionals to use proper boolean evaluation

## v2.5.1

*Released: June 18th 2025*
Expand Down
20 changes: 10 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
ansible.builtin.file:
dest: "/etc/apt/preferences.d/docker.pref"
state: "absent"
when: not docker__version | d()
when: not ((docker__version | d("")) is truthy)

- name: Disable pinned Docker Compose v2 version
ansible.builtin.file:
dest: "/etc/apt/preferences.d/docker-compose-plugin.pref"
state: "absent"
when: not docker__compose_v2_version | d()
when: not ((docker__compose_v2_version | d("")) is truthy)

- name: Enable pinned Docker version
ansible.builtin.template:
Expand All @@ -18,7 +18,7 @@
owner: "root"
group: "root"
mode: "0644"
when: docker__version | d()
when: (docker__version | d("")) is truthy

- name: Enable pinned Docker Compose v2 version
ansible.builtin.template:
Expand All @@ -27,7 +27,7 @@
owner: "root"
group: "root"
mode: "0644"
when: docker__compose_v2_version | d()
when: (docker__compose_v2_version | d("")) is truthy

- name: Install Docker's dependencies
retries: 20
Expand Down Expand Up @@ -96,7 +96,7 @@
virtualenv_python: "python3"
state: "{{ item.state | d('present') }}"
loop: "{{ docker__default_pip_packages + docker__pip_packages }}"
when: item.name | d()
when: (item.name | d("")) is truthy

- name: Create python3-docker proxy script to access Virtualenv's interpreter
ansible.builtin.template:
Expand All @@ -115,7 +115,7 @@
loop: "{{ docker__default_pip_packages + docker__pip_packages }}"
when:
- item.state | d("present") != "absent"
- item.path | d() and item.src | d()
- ((item.path | d("")) is truthy) and ((item.src | d("")) is truthy)

- name: Add user(s) to "docker" group
ansible.builtin.user:
Expand Down Expand Up @@ -168,7 +168,7 @@
loop: "{{ docker__registries }}"
loop_control:
label: '{{ {"registry_url": item.registry_url | d("https://index.docker.io/v1/"), "username": item.username, "state": item.state | d("present")} }}' # yamllint disable-line rule:line-length
when: item.username | d() and item.password | d()
when: ((item.username | d("")) is truthy) and ((item.password | d("")) is truthy)
become: true
become_user: "{{ docker__login_become_user | d('root') }}"
vars:
Expand All @@ -181,7 +181,7 @@
loop: "{{ docker__cron_jobs }}"
when:
- item.state | d("present") == "absent"
- item.cron_file | d()
- (item.cron_file | d("")) is truthy

- name: Create Docker related cron jobs
ansible.builtin.cron:
Expand All @@ -197,5 +197,5 @@
loop: "{{ docker__cron_jobs }}"
when:
- item.state | d("present") != "absent"
- item.name | d() and item.job | d()
- item.schedule | d() and item.cron_file | d()
- ((item.name | d("")) is truthy) and ((item.job | d("")) is truthy)
- ((item.schedule | d("")) is truthy) and ((item.cron_file | d("")) is truthy)