Bootstrap your ansible-powered juju charm
After working with InformatiQ to setup a new charm using the ansible support (and ironing out a few issues), it made sense to capture the process…
The README at charm-bootstrap-ansible has the details, but the branch will pull in the required charm-helpers library and run the tests, leaving you ready to deploy and explore.
Hopefully I can get this into the charm-create tool eventually.
one thought i got
for an upgradeable charm (upgraded service that is) the ansible script might be called all of it on upgrade
so basically all tasks are tagged with charm-upgrade apart form what their tag is
ansible is idempotent so rerunning the tasks will ensure it adapts to all changes in the upgraded ansible playbook and so on
Ramez Hanna
November 21, 2013 at 11:52 pm
Interesting – the upgrade-charm hook would call “ansible-playbook -i local playbooks/site.yaml” without any tags? That could work and would be neat, but I think it would be a bit too much magic.
I mean, you may have tasks tagged with ‘stop’ which are to be executed only when the charm is stopped. It could still work with that knowledeg – you just need to be careful with the ordering of tasks, but it might be easier and more explicit to just add the hook:
Or do you think it’d be better for that to happen automatically for upgrade-charm?
Michael
November 22, 2013 at 11:04 am
no your approach is better in that sense, i had not thought about the case of a start hook
need more practice…
Ramez Hanna
November 22, 2013 at 11:29 am
[…] wsgi applications… some Django apps, others with other frameworks. I’ve been using the ansible support for writing charms which makes charm authoring simpler, but even then, essentially each wsgi service charm needs to do […]
Reusable ansible roles for Juju charms | Something-driven development
June 10, 2014 at 6:22 pm