Hi All,
I need help to add roles and collections to the default path.
I added in the ansible.cfg, but i am unable use or see the roles and collections added. When I checked the default path are vailable.
How will I add the path so that I can see it where I want it to be.
Regards,
Rab
Hi,
It depend on your ansible version.
my lab ansible core version is 2.14.8 and ansible-navigator version is 3.3.1
If you use like as that version you can try to create new config file as shown below
If you dont have any ansible-navigator.yml you can try;
$ ansible-navigator settings --sample > /tmp/ansible-navigator.yml
$ mv -iv > /tmp/ansible-navigator.yml .
$ ansible-navigator config
then type:
:f role
:1 <-- Default roles path
Example default config:
$ cat .ansible-navigator.yml
---
ansible-navigator:
ansible:
config:
path: .ansible.cfg
execution-environment:
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
pull:
policy: missing
$ cat .ansible.cfg
[defaults]
collections_path = /home/remzi/.ansible/collections:./collections:/usr/share/ansible/collections
#collections_path={{ ANSIBLE_HOME ~ "/collections:/usr/share/ansible/collections" }}
# (boolean) A boolean to enable or disable scanning the sys.path for installed collections
collections_scan_sys_path=True
roles_path=/home/remzi/ansible/custom-roles:/usr/share/ansible/roles:/etc/ansible/roles
callbacks_enabled=ansible.posix.timer,ansible.posix.profile_tasks
ANSIBLE_JINJA2_NATIVE=true
[galaxy]
server_list = automation_hub,community
[galaxy_server.community]
url=https://galaxy.ansible.com
[galaxy_server.automation_hub]
url=https://console.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=MY_RHEL_TOKEN
I hope these words help to you.
Good luck.
Hi,
It depend on your ansible version.
my lab ansible core version is 2.14.8 and ansible-navigator version is 3.3.1
If you use like as that version you can try to create new config file as shown below
If you dont have any ansible-navigator.yml you can try;
$ ansible-navigator settings --sample > /tmp/ansible-navigator.yml
$ mv -iv > /tmp/ansible-navigator.yml .
$ ansible-navigator config
then type:
:f role
:1 <-- Default roles path
Example default config:
$ cat .ansible-navigator.yml
---
ansible-navigator:
ansible:
config:
path: .ansible.cfg
execution-environment:
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
pull:
policy: missing
$ cat .ansible.cfg
[defaults]
collections_path = /home/remzi/.ansible/collections:./collections:/usr/share/ansible/collections
#collections_path={{ ANSIBLE_HOME ~ "/collections:/usr/share/ansible/collections" }}
# (boolean) A boolean to enable or disable scanning the sys.path for installed collections
collections_scan_sys_path=True
roles_path=/home/remzi/ansible/custom-roles:/usr/share/ansible/roles:/etc/ansible/roles
callbacks_enabled=ansible.posix.timer,ansible.posix.profile_tasks
ANSIBLE_JINJA2_NATIVE=true
[galaxy]
server_list = automation_hub,community
[galaxy_server.community]
url=https://galaxy.ansible.com
[galaxy_server.automation_hub]
url=https://console.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=MY_RHEL_TOKEN
I hope these words help to you.
Good luck.
Thank you very much. I am using ansible version 2.13
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.