Hacker News new | past | comments | ask | show | jobs | submit login

Hi, and thank you. It works well. Example play books already contain the basics I'd need for my playbooks.

Could you perhaps elaborate how the kernel directs Ansible?

Also, is there any difference between local and remote Ansible runs?




Ansible Kernel calls ansible-playbook on a specially constructed playbook. Ansible Kernel constructs a playbook with a two tasks in it: 1. wait for the kernel and 2. include tasks from a file that does not exist yet. When you enter a #task cell we write that included file and then tell the wait task to proceed. The included file contains the #task cell contents, a wait task, and another include task. This continues until you stop the kernel, the playbook dies on an error, or you enter a #play cell. On a #play cell ansible kernel throws away the old playbook and make a new one with the new arguments. The exported playbook just contains the content on the page (without the wait/include tasks) and should work with ansible-playbook normally.


This does sound like Ansible does not make it easy to control it from pure Python. It looks an ingenious way to get around it.

I came across this Python wrapper around Ansible yesterday: http://suitable.readthedocs.io/en/latest/ Official docs declare themselves deprecated...

Anyway, I'll have to start testing this soon. Thank you so much for making it!


You're welcome. I hope that you find it useful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: