I am an ansible newbie. My first non-trivial ansible project is to update / optimize the configuration of Juniper switches. The ansible modules are not run on the Juniper switch but locally on the ansible controller. The default modules do not seem to match our requirements, thus a (python) user module is needed. In a role ( ~/roles/x/vars/main.yaml ) a multi-level dict (in python-parlance) is defined, which includes a few lists. Is this information accessible from within a python script running on the ansible controller, and if so, how?
Hi,
Have a look here: https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html
You’ll need to build your own module that you can invoke from your task list or role.
kind regards
Pshem
I’ve read it, as well as other documents w.r.t. development of user modules. However, it does not answer my original question, nor does it supply a pointer to an answer.
In the mean time an related question has come up. On remote machines one can save some ‘facts’ in /etc/ansible/facts.d/*fact. Is a similar functionality also available on the ansible controller?