Skip to content

Commit

Permalink
provision: Fix dnf5 incompatibilities
Browse files Browse the repository at this point in the history
Dnf5 has some incompatibilities like missing sub-commands and aliases.
It also seems to have some regression between ansible dnf5 that
breaks * wildcard.
  • Loading branch information
jakub-vavra-cz committed Jun 5, 2024
1 parent 1dcf5c1 commit 26eb065
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
40 changes: 31 additions & 9 deletions src/ansible/roles/packages/tasks/Fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@

- name: Install extended set of packages
block:
- name: Install additional repositories
shell: |
dnf config-manager --add-repo {{ item }}
with_items:
- https://cli.github.com/packages/rpm/gh-cli.repo
- name: Add gh-cli.repo repo
ansible.builtin.get_url:
url: https://cli.github.com/packages/rpm/gh-cli.repo
dest: /etc/yum.repos.d/gh-cli.repo
mode: '0644'

- name: Install additional packages
dnf:
state: present
Expand Down Expand Up @@ -118,16 +119,37 @@
name: '{{ ipa.client }}'

- name: Install SSSD and its dependencies
dnf:
package:
state: present
name:
- nfs-utils
- realmd
- oddjob
- oddjob-mkhomedir
- adcli
- sssd
- sssd-*
- 'sssd-*'
register: pkg_install

- name: Install SSSD and its dependencies
ansible.builtin.package_facts:

# ansible dnf5 seems to have a regression with wildcard *
# https://github.com/ansible/ansible/issues/83373
- name: Install sssd subpackages
command: yum install -y 'sssd-*'
register: sssd_install
when: "'sssd-ad' not in ansible_facts.packages"

- name: Show installed sssd packages
ansible.builtin.debug:
var: pkg_install

- name: Install debug information for selected packages
command: dnf debuginfo-install -y {{ item }}
dnf:
enablerepo: '*-debug*'
name: '{{ item }}-debuginfo'
state: present
with_items:
- dbus
- glibc
Expand Down Expand Up @@ -260,7 +282,7 @@
- name: Install additional packages for client development image
block:
- name: Install SSSD build dependencies
command: dnf build-dep -y sssd
command: dnf builddep -y sssd

- name: Install packages required for integration tests
dnf:
Expand Down
4 changes: 2 additions & 2 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function base_install_python {
fi
fi

# Remove dnf-5 to workaround many issues that yet needs to be fixed
# Add python3-dnf5 to enable ansible to use it
if base_exec '[ -f /usr/bin/dnf5 ]'; then
base_exec 'dnf install -y python3-dnf && dnf remove -y dnf5 && ln -s /usr/bin/dnf-3 /usr/bin/dnf && ln -s /usr/bin/dnf-3 /usr/bin/yum && dnf clean all'
base_exec 'dnf install -y python3-libdnf5 dnf5-plugins'
fi
}

Expand Down

0 comments on commit 26eb065

Please sign in to comment.