The role lookup goes to your /etc/ansible/ansible.cfg file and read roles_path config there. If that fails for any reason, we search this default directories for roles:
/etc/ansible/roles
/usr/share/ansible/roles
If that’s what you expect, could you please confirm, that Foreman is able to import your roles correctly and the issue is just with variables?
In /etc/ansible/ansible.cfg, roles_path does contain /etc/ansible/roles.
/etc/ansible/roles is where I have installed the roles with the following command:
ansible-galaxy role install -r requirements.yml -p /etc/ansible/roles/ -f
I can confirm that foreman is able to import the roles. Well, at least I think foreman is doing so.
Configure -> (Ansible) Roles
Import from <foreman_proxy_hostname>
A new page appears with a list of roles to import
I check the checkbox for the roles and click update
I’m redirected to the Ansible Roles page and the roles I imported are in the list
When I do the same type of steps with Ansible Variables, I am presented with "No changes in variables detected on <foreman_proxy_hostname>. There are no variables in the list. Some of our roles do not have any variables defined in defaults, most of them do.
Isn’t it possible the variables are already imported? I went through the code and I struggle to see the difference that could cause roles vs variables. Only difference is, that variables are presented only if there are any changes detected.
There is one caveat to keep in mind, the change of value is not currently considered a chage of the variable. This will be changed in upcoming version, but curretly only if you add new variable or drop old one is considered a change.