Skip to content

Commit 723afed

Browse files
author
Jon Wolski
committed
Resolve file path with {{ role_path }}
I was getting errors with this playbook when executing "include OS family/distribution specific variables." Even though my `ansible_os_family` is `RedHat`, `with_first_found` was finding no results. (I am running Centos 7, but I confirmed the `RedHat` value in the ansible facts with `ansible all -m setup`.) When I prepended the `defaults/...` relative path with `{{ role_path }}`, this playbook ran successfully.
1 parent 15d2da0 commit 723afed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
- name: include OS family/distribution specific variables
1313
include_vars: "{{ item }}"
1414
with_first_found:
15-
- "defaults/{{ ansible_os_family | lower }}-{{ ansible_distribution | lower }}.yml"
16-
- "defaults/{{ ansible_os_family | lower }}.yml"
15+
- "{{ role_path }}/defaults/{{ ansible_os_family | lower }}-{{ ansible_distribution | lower }}.yml"
16+
- "{{ role_path }}/defaults/{{ ansible_os_family | lower }}.yml"
1717
tags: installation
1818

1919
- include: debug.yml

0 commit comments

Comments
 (0)