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
|
||||
dest: "{{ docker_keyring_path }}"
|
||||
mode: "0644"
|
||||
register: docker_key_download
|
||||
|
||||
- name: Add Docker repository to Apt sources
|
||||
copy:
|
||||
@@ -36,6 +35,9 @@
|
||||
deb [arch={{ ansible_architecture }} signed-by={{ docker_keyring_path }}] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable
|
||||
notify: Update apt cache
|
||||
|
||||
- name: Flush handlers to update apt cache before installing Docker
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Install Docker packages
|
||||
apt:
|
||||
name:
|
||||
@@ -45,7 +47,7 @@
|
||||
- docker-buildx-plugin
|
||||
- docker-compose-plugin
|
||||
state: present
|
||||
update_cache: no # already handled by handler
|
||||
update_cache: no # Already handled
|
||||
|
||||
handlers:
|
||||
- name: Update apt cache
|
||||
|
||||
Reference in New Issue
Block a user