From b0092204629916785851fcbd825039a94b256d11 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Thu, 31 Oct 2024 10:16:45 +0000 Subject: [PATCH] Prepare PRCI for fedora 41 Signed-off-by: Florence Blanc-Renaud --- ansible/create_template_box.yml | 13 ++++++++++--- ansible/roles/box/prepare/templates/Vagrantfile.j2 | 2 +- ansible/roles/machine/setup/tasks/configuration.yml | 6 +++--- .../roles/machine/setup/tasks/install_packages.yml | 2 +- ansible/vars/fedora/41.yml | 3 +++ ansible/vars/fedora/rawhide.yml | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 ansible/vars/fedora/41.yml diff --git a/ansible/create_template_box.yml b/ansible/create_template_box.yml index 0e774992..4954f201 100644 --- a/ansible/create_template_box.yml +++ b/ansible/create_template_box.yml @@ -39,14 +39,21 @@ - vars/ipa_branches/{{ git_branch }}.yml pre_tasks: - name: Install cloud-utils-growpart for f40 - when: fedora_version == '40' + when: fedora_version >= '40' command: dnf install -y cloud-utils-growpart - name: grow partition size /dev/vda4 for f40 - when: fedora_version == '40' + when: fedora_version >= '40' command: growpart /dev/vda 4 - name: resize the / filesystem for f40 - when: fedora_version == '40' + when: fedora_version >= '40' command: btrfs filesystem resize max / + - name: Stat /usr/bin/dnf5 + ansible.builtin.stat: + path: /usr/bin/dnf5 + register: dnf5 + - name: Install dnf5 support libs + ansible.builtin.command: dnf5 install -y python3-libdnf5 dnf5-plugins + when: dnf5.stat.exists # GPG keys might be outdated for packages in Rawhide - name: Update fedora-repos package when: nightly_compose is defined and nightly_compose diff --git a/ansible/roles/box/prepare/templates/Vagrantfile.j2 b/ansible/roles/box/prepare/templates/Vagrantfile.j2 index 47a37ed0..3d92b54a 100644 --- a/ansible/roles/box/prepare/templates/Vagrantfile.j2 +++ b/ansible/roles/box/prepare/templates/Vagrantfile.j2 @@ -17,7 +17,7 @@ Vagrant.configure(2) do |config| template.vm.provider "libvirt" do |domain,override| domain.memory = 2048 override.vm.network "private_network", type: "dhcp" -{% if fedora_version == '40' %} +{% if fedora_version >= '40' %} domain.machine_virtual_size = 20 {% endif %} end diff --git a/ansible/roles/machine/setup/tasks/configuration.yml b/ansible/roles/machine/setup/tasks/configuration.yml index 11dac37f..5711fbf2 100644 --- a/ansible/roles/machine/setup/tasks/configuration.yml +++ b/ansible/roles/machine/setup/tasks/configuration.yml @@ -10,7 +10,7 @@ policy: targeted - name: disable distro repositories - shell: "dnf config-manager --set-disabled {{ item }}" + shell: "dnf config-manager setopt {{ item }}.enabled=0" with_items: - fedora - updates @@ -18,14 +18,14 @@ - fedora-cisco-openh264 - name: enable selected repositories - shell: "dnf config-manager --set-enabled {{ item.key }}" + shell: "dnf config-manager setopt {{ item.key }}.enabled=1" with_dict: fedora: "{{ repo_fedora_enabled }}" updates: "{{ repo_updates_enabled }}" when: fedora_version != 'rawhide' and item.value - name: configure rawhide repository - shell: "dnf config-manager --set-{{ 'enabled' if repo_rawhide_enabled else 'disabled' }} rawhide" + shell: "dnf config-manager setopt rawhide.enabled={{ '1' if repo_rawhide_enabled else '0' }}" when: fedora_version == 'rawhide' - name: configure FreeIPA COPR repo diff --git a/ansible/roles/machine/setup/tasks/install_packages.yml b/ansible/roles/machine/setup/tasks/install_packages.yml index 32abe600..c7d19714 100644 --- a/ansible/roles/machine/setup/tasks/install_packages.yml +++ b/ansible/roles/machine/setup/tasks/install_packages.yml @@ -151,4 +151,4 @@ url: "{{ download_metadata.json | to_json | from_json | json_query(query) }}" dest: /opt/selenium.jar vars: - query: "assets[?content_type == 'application/java-archive'] | [?starts_with(name, 'selenium-server')].browser_download_url | [0]" + query: "assets[?content_type == 'raw'] | [?ends_with(name, 'jar')] | [?starts_with(name, 'selenium-server')].browser_download_url | [0]" diff --git a/ansible/vars/fedora/41.yml b/ansible/vars/fedora/41.yml new file mode 100644 index 00000000..a8d1a040 --- /dev/null +++ b/ansible/vars/fedora/41.yml @@ -0,0 +1,3 @@ +--- +fedora_releasever: 41 +base_box_url: https://dl.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-libvirt-41-1.4.x86_64.vagrant.libvirt.box diff --git a/ansible/vars/fedora/rawhide.yml b/ansible/vars/fedora/rawhide.yml index 7dc4fd48..efb4d56e 100644 --- a/ansible/vars/fedora/rawhide.yml +++ b/ansible/vars/fedora/rawhide.yml @@ -1,5 +1,5 @@ --- -fedora_releasever: 41 # bump when fedora gets branched +fedora_releasever: 42 # bump when fedora gets branched nightly_compose: true