Refactor Docker installation playbook: remove unnecessary register, add flush_handlers task, and correct comment capitalization
This commit is contained in:
@@ -27,7 +27,6 @@
|
|||||||
url: https://download.docker.com/linux/ubuntu/gpg
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
dest: "{{ docker_keyring_path }}"
|
dest: "{{ docker_keyring_path }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
register: docker_key_download
|
|
||||||
|
|
||||||
- name: Add Docker repository to Apt sources
|
- name: Add Docker repository to Apt sources
|
||||||
copy:
|
copy:
|
||||||
@@ -36,6 +35,9 @@
|
|||||||
deb [arch={{ ansible_architecture }} signed-by={{ docker_keyring_path }}] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable
|
deb [arch={{ ansible_architecture }} signed-by={{ docker_keyring_path }}] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable
|
||||||
notify: Update apt cache
|
notify: Update apt cache
|
||||||
|
|
||||||
|
- name: Flush handlers to update apt cache before installing Docker
|
||||||
|
meta: flush_handlers
|
||||||
|
|
||||||
- name: Install Docker packages
|
- name: Install Docker packages
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
@@ -45,7 +47,7 @@
|
|||||||
- docker-buildx-plugin
|
- docker-buildx-plugin
|
||||||
- docker-compose-plugin
|
- docker-compose-plugin
|
||||||
state: present
|
state: present
|
||||||
update_cache: no # already handled by handler
|
update_cache: no # Already handled
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: Update apt cache
|
- name: Update apt cache
|
||||||
|
|||||||
Reference in New Issue
Block a user