Skip to content

Commit

Permalink
tasks: Workaround first_found regression with absolute path
Browse files Browse the repository at this point in the history
Recent update to ansible v2.16.3 broke[1] the promised action of
first_found plugin to find files with relative paths when tasks are
included from a different subdirectory other than where its main.yml
is located. Thus we temporarily switch to use absolute paths wherever
required until fix is available with an updated package.

[1] ansible/ansible#82695

Signed-off-by: Anoop C S <[email protected]>
  • Loading branch information
anoopcs9 committed Feb 16, 2024
1 parent ddeabc4 commit e375047
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion playbooks/ansible/roles/ctdb.setup/tasks/glusterfs/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/glusterfs/"
with_first_found:
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
- files: "{{ [prefix] | product(config.os[config.nodes[inventory_hostname].os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file

Expand Down
4 changes: 3 additions & 1 deletion playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
block:
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/cephfs/"
with_first_found:
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
- files: "{{ [prefix] | product(config.os[config.nodes[inventory_hostname].os].includes) | map('join') | list }}"

Check warning on line 10 in playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:121 [line-length] line too long (121 > 120 characters)
loop_control:
loop_var: include_file

Expand Down
4 changes: 3 additions & 1 deletion playbooks/ansible/roles/samba.setup/tasks/glusterfs/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/glusterfs/"
with_first_found:
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
- files: "{{ [prefix] | product(config.os[config.nodes[inventory_hostname].os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file

Expand Down
4 changes: 3 additions & 1 deletion playbooks/ansible/roles/sit.cephfs/tasks/server/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/server/"
with_first_found:
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
- files: "{{ [prefix] | product(config.os[config.nodes[inventory_hostname].os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file

Expand Down
4 changes: 3 additions & 1 deletion playbooks/roles/sit.cephfs/tasks/setup/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/setup/"
with_first_found:
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
- files: "{{ [prefix] | product(config.os[config.nodes[inventory_hostname].os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file
4 changes: 3 additions & 1 deletion playbooks/roles/sit.glusterfs/tasks/setup/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/setup/"
with_first_found:
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
- files: "{{ [prefix] | product(config.os[config.nodes[inventory_hostname].os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file

0 comments on commit e375047

Please sign in to comment.