diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index e0a07958..0dfe0816 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -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 }}"