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!

Mildew
  • 111
  • 1
  • 3

2 Answers2

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?

shearn89
  • 3,143
  • 2
  • 14
  • 39
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.

DukeLion
  • 3,239
  • 1
  • 17
  • 19