Skip to content

Commit

Permalink
Fix including a var file in set_vars.yml.
Browse files Browse the repository at this point in the history
['{{ role_path }}/vars/main.yml'] in the original code fails with
"Could not find or access '{{ role_path }}/vars/main.yml'". The
path in the name string was fixed, as well.
  • Loading branch information
nhosoi committed Jun 12, 2022
1 parent 5f02ccd commit 7cda45d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions roles/rsyslog/tasks/set_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
{{ ansible_facts['distribution_version'] }}.yml"
when: item is file

- name: "Include {{ role_path }}/roles/rsyslog/vars/main.yml"
- name: "Include {{ role_path }}/vars/main.yml"
include_vars: "{{ item }}"
loop: "{{ ['{{ role_path }}/vars/main.yml'] +
lookup('lines',
'/bin/ls -1 {{ role_path }}/vars/*/*/main.yml').split(',') }}"
loop: "{{ lookup('lines',
'/bin/ls -1 {{ role_path }}/vars/main.yml
{{ role_path }}/vars/*/*/main.yml').split(',') }}"
when: __snapshot_gather_vars is defined and
__snapshot_gather_vars | bool

0 comments on commit 7cda45d

Please sign in to comment.