Skip to content

Commit

Permalink
Support for DNF 5 in Fedora 41 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
wzzrd authored and haxorof committed Dec 8, 2024
1 parent f6b71d5 commit b2536be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/setup-repository-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

- name: Disable Docker CE repository channels
become: true
ansible.builtin.shell: "{{ docker_cmd_enable_disable_repo[_docker_os_dist_file_varity] }}"
ansible.builtin.shell: "{{ docker_cmd_enable_disable_repo[_docker_os_dist] }}"
loop: "{{ _docker_disable_channels }}"
changed_when: false
vars:
Expand All @@ -76,7 +76,7 @@

- name: Enable Docker CE repository channels
become: true
ansible.builtin.shell: "{{ docker_cmd_enable_disable_repo[_docker_os_dist_file_varity] }}"
ansible.builtin.shell: "{{ docker_cmd_enable_disable_repo[_docker_os_dist] }}"
loop: "{{ _docker_enable_channels }}"
changed_when: false
vars:
Expand Down
12 changes: 12 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,21 @@ docker_channels:
- test

docker_cmd_enable_disable_repo:
AlmaLinux: >
type dnf && dnf config-manager --set-{{ (_item_enabled == true) | ternary('enabled', 'disabled') }} docker-ce-{{ item }}
|| yum-config-manager --{{ (_item_enabled == true) | ternary('enable', 'disable') }} docker-ce-{{ item }}
CentOS: >
type dnf && dnf config-manager --set-{{ (_item_enabled == true) | ternary('enabled', 'disabled') }} docker-ce-{{ item }}
|| yum-config-manager --{{ (_item_enabled == true) | ternary('enable', 'disable') }} docker-ce-{{ item }}
Fedora: >
dnf config-manager --set-{{ (_item_enabled == true) | ternary('enabled', 'disabled') }} docker-ce-{{ item }}
|| dnf config-manager setopt docker-ce-{{item}}.enabled={{ (_item_enabled == true) | ternary('1', '0') }}
RedHat: >
type dnf && dnf config-manager --set-{{ (_item_enabled == true) | ternary('enabled', 'disabled') }} docker-ce-{{ item }}
|| yum-config-manager --{{ (_item_enabled == true) | ternary('enable', 'disable') }} docker-ce-{{ item }}
Rocky: >
type dnf && dnf config-manager --set-{{ (_item_enabled == true) | ternary('enabled', 'disabled') }} docker-ce-{{ item }}
|| yum-config-manager --{{ (_item_enabled == true) | ternary('enable', 'disable') }} docker-ce-{{ item }}
docker_cmd_update_repo_cache:
RedHat: type dnf && dnf makecache || yum makecache
Expand Down

0 comments on commit b2536be

Please sign in to comment.