Skip to content

Commit ec9a34e

Browse files
committed
devconfig: Replace import_tasks with include_tasks
On a fresh Fedora 40 system, under buildbot, the devconfig role fails: statically imported: /var/lib/buildbot/worker/renoir1/nfsd-fixes-nfsd-pynfs/build/playbooks/roles/devconfig/tasks/install-deps/main.yml statically imported: /var/lib/buildbot/worker/renoir1/nfsd-fixes-nfsd-pynfs/build/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml statically imported: /var/lib/buildbot/worker/renoir1/nfsd-fixes-nfsd-pynfs/build/playbooks/roles/devconfig/tasks/install-deps/suse/main.yml redirecting (type: modules) ansible.builtin.zypper to community.general.zypper ERROR! couldn't resolve module/action 'zypper'. This often indicates a misspelling, missing collection, or incorrect module path. It shouldn't care about zypper, that's a Suse thing. Somewhere the os_family sensing logic has gone hay-wire. Handle this by using dynamic include_task instead of static import_task, and restructure the os_family checking task in install-deps/main.yml. Reviewed-by: Luis Chamberlain <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 94ae426 commit ec9a34e

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

playbooks/roles/devconfig/tasks/install-deps/main.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,23 @@
2424
skip: true
2525
tags: vars
2626

27-
# tasks to setup up repos, register system if needed and install
28-
# preferred devtools packages.
29-
- name: Distribution specific setup
30-
tags: vars_simple
31-
import_tasks: debian/main.yml
27+
- name: Debian-specific setup
28+
ansible.builtin.include_tasks: debian/main.yml
3229
when:
33-
- ansible_facts['os_family']|lower == 'debian'
30+
- ansible_os_family == "Debian"
3431
- devconfig_try_refresh_repos|bool or devconfig_try_install_kdevtools|bool or kdevops_cli_install|bool
35-
- import_tasks: suse/main.yml
3632
tags: vars_simple
33+
34+
- name: SuSE-specific setup
35+
ansible.builtin.include_tasks: suse/main.yml
3736
when:
38-
- ansible_facts['os_family']|lower == 'suse'
37+
- ansible_os_family == "Suse"
3938
- devconfig_try_refresh_repos|bool or devconfig_try_install_kdevtools|bool or kdevops_cli_install|bool
40-
- import_tasks: redhat/main.yml
4139
tags: vars_simple
40+
41+
- name: Red Hat-specific setup
42+
ansible.builtin.include_tasks: redhat/main.yml
4243
when:
43-
- ansible_facts['os_family']|lower == 'redhat'
44+
- ansible_os_family == "RedHat"
4445
- devconfig_try_refresh_repos|bool or devconfig_try_install_kdevtools|bool or kdevops_cli_install|bool
46+
tags: vars_simple

playbooks/roles/devconfig/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131

3232
# Distro specific
3333
- name: Install dependencies
34-
import_tasks: install-deps/main.yml
34+
ansible.builtin.include_tasks: install-deps/main.yml
3535

3636
- name: Configure custom repositories and install packages
37-
import_tasks: config-custom-repos-and-packages/main.yml
37+
ansible.builtin.include_tasks: config-custom-repos-and-packages/main.yml
3838
when:
3939
- ansible_facts['os_family']|lower == 'redhat'
4040

@@ -447,7 +447,7 @@
447447
tags: [ 'console' ]
448448

449449
- name: Update your boot GRUB file if necessary
450-
import_tasks: update-grub/main.yml
450+
ansible.builtin.include_tasks: update-grub/main.yml
451451
when:
452452
- grub2_config_file.stat.exists
453453
- devconfig_enable_console|bool
@@ -637,7 +637,7 @@
637637
tags: [ 'sysctl' ]
638638

639639
- name: Rev the kernel to the latest distribution kotd
640-
import_tasks: kotd-rev-kernel/main.yml
640+
ansible.builtin.include_tasks: kotd-rev-kernel/main.yml
641641
when:
642642
- devconfig_enable_kotd|bool
643643
tags: [ 'kotd' ]

0 commit comments

Comments
 (0)