diff mbox series

[06/12] ansible: Use full paths when importing tasks

Message ID 20241218-jag-bringup_fixes-v1-6-0bf2e07c640c@kernel.org (mailing list archive)
State New
Headers show
Series kdevops: Various fixes | expand

Commit Message

Joel Granados Dec. 18, 2024, 10:30 a.m. UTC
This allows importing libvirt_user tasks without the hassle of
changing relative paths.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
 playbooks/roles/libvirt_user/tasks/enable-user/main.yml  | 8 ++++----
 playbooks/roles/libvirt_user/tasks/install-deps/main.yml | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/playbooks/roles/libvirt_user/tasks/enable-user/main.yml b/playbooks/roles/libvirt_user/tasks/enable-user/main.yml
index 364d625..2c632f2 100644
--- a/playbooks/roles/libvirt_user/tasks/enable-user/main.yml
+++ b/playbooks/roles/libvirt_user/tasks/enable-user/main.yml
@@ -1,23 +1,23 @@ 
 ---
 - name: Debian-specific set up
-  ansible.builtin.include_tasks: install-deps/debian/main.yml
+  ansible.builtin.include_tasks: "{{ role_path }}/tasks/enable-user/debian/main.yml"
   when: ansible_os_family == 'Debian'
   tags: [ 'build-deps' ]
 
 - name: SuSE-specific set up
-  ansible.builtin.include_tasks: install-deps/suse/main.yml
+  ansible.builtin.include_tasks: "{{ role_path }}/tasks/enable-user/suse/main.yml"
   when: ansible_os_family == 'Suse'
   tags: [ 'build-deps' ]
 
 - name: Red Hat-specific set up
-  ansible.builtin.include_tasks: install-deps/redhat/main.yml
+  ansible.builtin.include_tasks: "{{ role_path }}/tasks/enable-user/redhat/main.yml"
   when:
     - ansible_os_family == 'RedHat'
     - ansible_facts['distribution'] != "Fedora"
   tags: [ 'build-deps' ]
 
 - name: Fedora-specific set up
-  ansible.builtin.include_tasks: install-deps/fedora/main.yml
+  ansible.builtin.include_tasks: "{{ role_path }}/tasks/enable-user/fedora/main.yml"
   when:
     - ansible_os_family == 'RedHat'
     - ansible_facts['distribution'] == "Fedora"
diff --git a/playbooks/roles/libvirt_user/tasks/install-deps/main.yml b/playbooks/roles/libvirt_user/tasks/install-deps/main.yml
index c2f58c8..cd12e05 100644
--- a/playbooks/roles/libvirt_user/tasks/install-deps/main.yml
+++ b/playbooks/roles/libvirt_user/tasks/install-deps/main.yml
@@ -9,20 +9,20 @@ 
   tags: vars
 
 - name: Distribution specific setup
-  import_tasks: debian/main.yml
+  import_tasks: "{{ role_path }}/tasks/install-deps/debian/main.yml"
   when: ansible_facts['os_family']|lower == 'debian'
   tags: [ 'build-deps' ]
 
-- import_tasks: suse/main.yml
+- import_tasks: "{{ role_path }}/tasks/install-deps/suse/main.yml"
   when: ansible_facts['os_family']|lower == 'suse'
   tags: [ 'build-deps' ]
 
-- import_tasks: redhat/main.yml
+- import_tasks: "{{ role_path }}/tasks/install-deps/redhat/main.yml"
   when:
     - ansible_facts['os_family']|lower == 'redhat'
     - ansible_facts['distribution']|lower != "fedora"
   tags: [ 'build-deps' ]
 
-- import_tasks: fedora/main.yml
+- import_tasks: "{{ role_path }}/tasks/install-deps/fedora/main.yml"
   when: ansible_facts['distribution']|lower == "fedora"
   tags: [ 'build-deps' ]