Merge lp://qastaging/~wesmason/charm-helpers/ansible-map-extra-vars into lp://qastaging/charm-helpers

Proposed by Wes Mason
Status: Approved
Approved by: Simon Davy
Approved revision: 363
Proposed branch: lp://qastaging/~wesmason/charm-helpers/ansible-map-extra-vars
Merge into: lp://qastaging/charm-helpers
Diff against target: 104 lines (+48/-5)
2 files modified
charmhelpers/contrib/ansible/__init__.py (+18/-5)
tests/contrib/ansible/test_ansible.py (+30/-0)
To merge this branch: bzr merge lp://qastaging/~wesmason/charm-helpers/ansible-map-extra-vars
Reviewer Review Type Date Requested Status
Simon Davy Approve
charmers Pending
Review via email: mp+256799@code.qastaging.launchpad.net

Commit message

Add the ability to pass config values as extra-vars to Ansible.

Description of the change

This adds an extra param to AnsibleHooks to allow mapping config values onto `--extra-vars` arguments passed to ansible, to ensure the variable is also available in a "local" context, such as the one lookup plugins (e.g. `{{ lookup('template', 'templates/my-config.yaml') }}`) are executed in and inventory variables aren't available.

To post a comment you must log in.
Revision history for this message
Simon Davy (bloodearnest) :
review: Approve

Unmerged revisions

363. By Wes Mason

Add tests for map_extra_vars

362. By Wes Mason

Add map_extra_vars param to ansible helper to map config to extra-vars keys

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