Skip to content

Commit

Permalink
Adds yum-version lock to prevent docker from upgrading if a version i…
Browse files Browse the repository at this point in the history
…s specified (#132)

Prevents automated yum updates from upgrading docker if pinned to a
specific version
  • Loading branch information
tomdoel authored Aug 22, 2024
1 parent 6799e8a commit f224cb6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
- docker-buildx-plugin
- docker-compose-plugin

- name: Ensure yum-plugin-versionlock is installed
ansible.builtin.yum:
name: yum-plugin-versionlock
state: installed

- name: Prevent docker from being updated
community.general.yum_versionlock:
state: "{{ 'absent' if docker_version == 'latest' else 'present' }}"
name:
- docker-ce
- docker-ce-cli

- name: Ensure docker service directory exists
ansible.builtin.file:
path: "{{ docker_service_directory }}"
Expand Down

0 comments on commit f224cb6

Please sign in to comment.