Open tanji opened 7 years ago
OK, it seems this issue is due to privilege escalation turned on, because Ansible will effectively run as root and the files won't be readable. So maybe that should be fixed by some workaround or be documented otherwise (if not the case)>
This is pretty well documented within Rundeck core- processes should not be run in sudo.
That has nothing to do with Rundeck, but with Ansible. If Ansible is run as root (e.g. privilege escalation turned on in /etc/ansible.conf
) it will cause those files to be written as root.
@tanji @frozenice would disabling privilege escalation in the process arguments be worthwhile?
hi,
I'm new to Rundeck and Ansible and tested it on Friday with the same issues. Ansible is only allowed to work via Sudo. Su - and root login isn't an option because of CDE env / PCI DSS. A workaround or solution idea would be nice :-)
@linuxmail make sure you have the following setup in ansible.cfg:
[privilege_escalation]
become=False
become_method=sudo
become_user=root
become_ask_pass=False
hi @tanji
than it works for getting the nodes inventory, but fails with getting root. We need "sudo su -" before executing anything:
...
"module_stdout": "sudo: a password is required\r\n",
"msg": "MODULE FAILURE"
...
My working ansible.cfg has a configuration like this:
[privilege_escalation]
become = True
become_exe = "sudo su -"
become_method = su
but then it fails with filling the nodes inventory.
cu denny
It will not work with such a configuration, because su always prompts for a password. Please look at "ansible-become-password-option" in rundeck ansible plugin
Hi @tanji
nope, it works because of "become_exe". It executes "sudo su -" what is allowed in sudo with nopasswd.
cu denny
@DerekTBrown @frozenice @tanji Perhaps modifying the gather-facts.yml playbook to run the second step with become: false
would resolve the issue? Thoughts?
It might. I don't know if anything depends on being root when gathering the facts, but I guess it should work.
Any update on dis? Because neither @tanji 's nor @linuxmail 's solution din not work.
After upgrade, rundeck cannot collect new nodes from the ansible inventory. There are issues with the temporary directory that is created during facts collection, which for some reason has ownership root and results in the following errors:
Examination of the temp dir reveals the following: