Merge lp://qastaging/~michael.nelson/charm-helpers/ansible-support into lp://qastaging/charm-helpers

Proposed by Michael Nelson
Status: Merged
Merged at revision: 65
Proposed branch: lp://qastaging/~michael.nelson/charm-helpers/ansible-support
Merge into: lp://qastaging/charm-helpers
Prerequisite: lp://qastaging/~michael.nelson/charm-helpers/namespace-relation-data
Diff against target: 545 lines (+346/-62)
7 files modified
charmhelpers/contrib/ansible/__init__.py (+101/-0)
charmhelpers/contrib/saltstack/__init__.py (+17/-14)
charmhelpers/fetch/__init__.py (+1/-1)
setup.py (+1/-0)
tests/contrib/ansible/test_ansible.py (+136/-0)
tests/contrib/saltstack/test_saltstates.py (+87/-46)
tests/fetch/test_fetch.py (+3/-1)
To merge this branch: bzr merge lp://qastaging/~michael.nelson/charm-helpers/ansible-support
Reviewer Review Type Date Requested Status
Matthew Wedgwood (community) Approve
Review via email: mp+176973@code.qastaging.launchpad.net

Commit message

Add support for using ansible within charms.

Description of the change

Adds ansible support to charm-helpers.

I've converted a (private - sorry) charm to test out this support [1] - all works fine.

The juju config data, as well as any relation data is available to the ansible playbooks and templates using standard jinja2 syntax: {{ instance_type }}, where relation data is namespaced by the relation type, using django-like syntax: {{ solr__hostname }}.

One question I have is whether there's a better place for the juju_state_to_yaml() helper - it's now being used by both the saltstack and ansible support modules, and I assume it would be useful outside of those contexts also (to cache the juju config+relation data etc).

[1] https://code.launchpad.net/~michael.nelson/canonical-marshal/click-package-index-ansible/+merge/176972

To post a comment you must log in.
Revision history for this message
Matthew Wedgwood (mew) wrote :

Hey, Michael,

This looks awesome, thanks! I can't wait to try it out.

Regarding juju_state_to_yaml(), I'd say it belongs in core.hookenv. Bonus points for including a larger chunk of execution_environment().

-Matthew

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches