rundeck-plugins/ansible-plugin

Nodes not importing

sgreen-hobsons opened this issue · 8 comments

I'm running ansible & Rundeck in a test environment with a simple /etc/ansible/hosts with two hosts listed. For some reason, the plugin is not pulling in the Nodes. All of my permissions are configured correctly. Any thoughts?

Did you check the requirements from the README? Especially the command: su rundeck -s /bin/bash -c "ansible all -m ping"

I actually have rundeck setup to run as root instead of the rundeck user (don't ask why, just go with it...). My hosts file is very simple:

[sjc1]
localhost ansible_connection=local
10.24.128.31 ansible_ssh_user=ansi

I can successfully run any modules or playbooks from the command line as root or ansi user. Also, currently using 1.2.0 of the plugin & had the same issue with 1.0.1.

Hm, what OS is this and what Rundeck and Ansible versions are you using? How did you install Rundeck and Ansible (.deb, pip, ...)? Anything else special except for the root user? Maybe I can reproduce this in a VM.

CentOS 6.7 & all packages installed from epel repo or rundeck's repo:

ansible1.9-1.9.4-2.el6.noarch
rundeck-repo-4-0.noarch
rundeck-config-2.6.4-1.15.GA.noarch
rundeck-2.6.4-1.15.GA.noarch

Nothing else special about it, really. After installation, the only change I made was to /etc/init.d/rundeckd.

nohup runuser -s /bin/bash -l root -c "$rundeckd" >>$servicelog 2>&1 &

I didn't change ownership of /var/lib/rundeck at all, if that matters. I figured running as root there wouldn't be any kind permissions issue. It's definitely baffling me....

Okay, after some fighting with CentOS (never used it or any other of this family) and manually testing the playbook, the solution seems to be:
yum install libselinux-python

Ansible complained with this:

failed: [localhost -> 127.0.0.1] => {"failed": true}
msg: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!

If you can confirm this, I'll add it to the README. Maybe also another test command for the playbook...

That did it, man! Another option would be to set SELINUX=disabled in /etc/sysconfig/selinux & reboot.

Thanks for the assist.

Cool! I added a note to the README.

@sgreen-hobsons if it is SElinux, don't disable it. Instead, run:

sealert -a /var/log/audit/audit.log

And it will tell you the issue as well as the fix.