11

I am working on implementing Cobbler and Ansible to do our server deploys and am having one final issue. My Ansible playbook works great, my Cobbler install works great, but the issue is in tying them together.

I wrote a post-install trigger for Cobbler that would kick off my Ansible playbooks based on the Cobbler profile used, the script works great when ran on its own. The issue is that for this to work the server needs to first be rebooted but Cobbler does post-install triggers before the first reboot. There is a "firstboot" trigger in Cobbler but I can not get this to work at all. It just simply never triggers even after the first boot.

If I try to run Ansible before the reboot the server just times out.

This is for CentOS 6.5, Ansible 1.6 and Cobbler 2.4

TLDR: How to get Cobbler "firstboot" trigger to work or how to successfully run Ansible Playbook after an install but before first reboot.

Any ideas?

Thanks!

1

Could you have a wrapper script in /etc/rc.local (or similar) that runs the Ansible playbook the first time the system boots, and then removes itself? Either with a rm $0 at the end of the script or by editing /etc/rc.local once complete?

| improve this answer | |
1

I would suggest to use cobbler to run the very basic ansible playbook, that doesn't need to reboot server and configures Ansible pull mode

After reboot ansible should pull another playbook from its server and finishes server configuration.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.