Unable to load ansible variables

Probably I did not understand something, but I am not able to load any variables from roles I imported to foreman.

I copied one of my roles to /etc/ansible/roles.
My role usually looks like this:
add_system_2_backup.yml - main playbook that uses a role - I guess it should be created as Job template in Foreman
bacula dir - which contains

# ls -l
razem 0
drwxr-xr-x. 2 root root 22 06-19 10:45 handlers
drwxr-xr-x. 2 root root 23 06-25 13:16 tasks
drwxr-xr-x. 2 root root 61 06-28 10:15 templates
drwxrwxr-x. 2 root root 22 06-19 11:11 vars

I am able to import this bacula dir as a role, but import variables doesn’t import anything. Is my dir structure correct ? should my vars be configured in any special way ? How does it detect these variables?

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Foreman imports everything from defaults folder as variables. I think the main reason is that they have low priority and are easy to override while role vars have higher priority than play vars.

But I am curious, is there a special reason why you use vars in your role?

1 Like

Thank you for this explanation.
To be honest, there is no special reason. I just used vars probably, because I did not read ansible documentation very deeply.

FYI, I was able to import variables from defaults dir, but I have another question related to this. I see these vars, but I do not see their vaules. Should’t it import values too ?

It definitely should import values as well. I also found where the problem is - there is older version of smart_proxy_ansible in our 1.22 repos, update is being worked on, but did not make it into our packaging yet.

1 Like