I am using Ansible to deploy sudoers
file in all the server the sudoers
rights are stored in a central repository and dynamically generated via Python libraries installed locally on the Control Node.
I've tried to create a Python script on the libraries folder on the Control Node, but do not now know how to push the file generated in the variable a
of the code below to the Remote Hosts into /etc/sudoers
.
I thought creating a module or a plugin would do the trick but really do not know how to integrate my code below with an Ansible module or plugin.
from sudo_manager.objects import Host
import sudo_manager
h = Host.get_host('hostname')
a = sudo_manager.render_sudoers(h, 'sudoers.j2')
Any help will be appreciated.