Skip to content

Commit

Permalink
Organize two related tasks into a block
Browse files Browse the repository at this point in the history
  • Loading branch information
jsf9k committed Nov 26, 2024
1 parent 601ed6f commit 4067d90
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions tasks/setup_Fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4067d90

Please sign in to comment.