Library of generic / reusable roles for Ansible ..
- junos-rpm - Configure RPM
- junos-jti - Configure Junos Telemetry Interface
- junos-junos-analyticsd - Configure Analyticsd
- junos-syslog - Configure Remote Syslog
- build-config - Aggregate configuration snippets into a simple file.
More information on each role is available on the README.md file in each role directory
There are 2 main options to use a role that is not located in your main project
- 1/ Add the path to your role library to your Ansible configuration
- 2/ Copy the role you are planning to use into your current project under the directory
roles
Both solutions have pros & cons; 1/ will avoid role duplication and will keep everything centralized but any change you are doing on the main role will affect all your projects.
The choice will also depend on how well the role is written
There are multiple ways to change your Ansible configuration, either globally or by project, the ansible website is listing primarily these:
- ANSIBLE_CONFIG (an environment variable)
- ansible.cfg (in the current directory)
- .ansible.cfg (in the home directory)
- /etc/ansible/ansible.cfg
To add a new roles library you need to change the parameters roles_path under defaults
[defaults]
roles_path = /etc/ansible/roles:../ansible-lib-roles
/etc/ansible/roles is the default directory, it needs to be preserved otherwise module like Juniper.junos will not be available anymore.