From 4067d9045f232ac4a6a2bcd0b03d76b6a71c2562 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 26 Nov 2024 09:36:36 -0500 Subject: [PATCH] Organize two related tasks into a block --- tasks/setup_Fedora.yml | 54 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/tasks/setup_Fedora.yml b/tasks/setup_Fedora.yml index b2bef43..c3c0a35 100644 --- a/tasks/setup_Fedora.yml +++ b/tasks/setup_Fedora.yml @@ -27,33 +27,35 @@ name: - dnf-plugins-core -- name: Add the official Docker repo (Fedora, dnf) - # If an ansible.builtin.dnf_repository Ansible module is ever created - # then that should be used instead; unfortunately, no such module - # yet exists. - ansible.builtin.command: - argv: - - dnf - - config-manager - - --add-repo - - https://download.docker.com/linux/fedora/docker-ce.repo - creates: /etc/yum.repos.d/docker-ce.repo - when: - - ansible_pkg_mgr == "dnf" +- name: Add the official Docker repo (Fedora) + block: + - name: Add the official Docker repo (Fedora, dnf) + # If an ansible.builtin.dnf_repository Ansible module is ever + # created then that should be used instead; unfortunately, no + # such module yet exists. + ansible.builtin.command: + argv: + - dnf + - config-manager + - --add-repo + - https://download.docker.com/linux/fedora/docker-ce.repo + creates: /etc/yum.repos.d/docker-ce.repo + when: + - ansible_pkg_mgr == "dnf" -- name: Add the official Docker repo (Fedora, dnf5) - # If an ansible.builtin.dnf5_repository Ansible module is ever created - # then that should be used instead; unfortunately, no such module - # yet exists. - ansible.builtin.command: - argv: - - dnf5 - - config-manager - - addrepo - - --from-repofile=https://download.docker.com/linux/fedora/docker-ce.repo - creates: /etc/yum.repos.d/docker-ce.repo - when: - - ansible_pkg_mgr == "dnf5" + - name: Add the official Docker repo (Fedora, dnf5) + # If an ansible.builtin.dnf5_repository Ansible module is ever + # created then that should be used instead; unfortunately, no + # such module yet exists. + ansible.builtin.command: + argv: + - dnf5 + - config-manager + - addrepo + - --from-repofile=https://download.docker.com/linux/fedora/docker-ce.repo + creates: /etc/yum.repos.d/docker-ce.repo + when: + - ansible_pkg_mgr == "dnf5" - name: Update the cache with the Docker goodness (Fedora) ansible.builtin.package: