Hello,
I hope, I am posting my question on the right group, if not, please tell me
I need to use a dedicated become method and want to know, if it is possible, or, if only the “official” ones are authorized.
If it is possible, is there specific guidelines to follow to develop my own become plugin
Thanks and regards
R
Here are the official docs…but, I am unable to find anything specific to “become” plugin development.
https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#writing-plugins-in-python
We unfortunately don’t have docs specific to developing become plugins. They are pretty straightforward compared to other plugin types, though. I would recommend looking at the existing become plugins to get an idea of how to write you own. You can ask development questions here or on Freennode IRC in ansible-devel.
Excellent. Thank you.
I did copy and then edit the sudo one to meet my needs I believe, unfortunately my unfamiliarity with ansible has me at a loss for how to correctly make it accessible to the playbook.
I placed it here “/usr/share/ansible/plugins/”
And added this to my ansible config: ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY:/usr/share/ansible/plugins
-bash-4.2$ ls -l /usr/share/ansible/plugins/suexec.py
-rw-r–r–. 1 root root 3526 Feb 12 14:40 /usr/share/ansible/plugins/suexec.py
This is what the ansible developer docs suggested or at least was one of the suggestions. I clearly missed something though.
TASK [Gathering Facts] ************************************************************************************************************************
fatal: [desktop]: FAILED! => {“msg”: “Privilege escalation method not found: suexec”}
Any guidance is greatly appreciated. Thank you.
It needs a specific subdir for each plugin type, otherwise there would
be name conflicts across plugins.
See https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html#local-plugins
Hi,
Could you please confirm if it is working for you. Please share the code if it is working along with instructions. Thank you.