Merge lp:~michael.nelson/charms/trusty/conn-check/optional-ppa into lp:~ubuntuone-hackers/charms/trusty/conn-check/trunk

Proposed by Michael Nelson
Status: Merged
Approved by: Michael Nelson
Approved revision: 38
Merged at revision: 37
Proposed branch: lp:~michael.nelson/charms/trusty/conn-check/optional-ppa
Merge into: lp:~ubuntuone-hackers/charms/trusty/conn-check/trunk
Diff against target: 38 lines (+12/-1)
2 files modified
config.yaml (+7/-0)
hooks/hooks.py (+5/-1)
To merge this branch: bzr merge lp:~michael.nelson/charms/trusty/conn-check/optional-ppa
Reviewer Review Type Date Requested Status
Kelvin Li (community) Approve
Review via email: mp+259871@code.launchpad.net

Commit message

Add install_ansible_from_ppa config option, defaulting to true for current behaviour, but allowing users to opt out of adding a PPA to their units.

Description of the change

Tested on an internal deployment.

To post a comment you must log in.
Revision history for this message
Kelvin Li (kelvin.li) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-11-14 10:30:58 +0000
3+++ config.yaml 2015-05-22 03:24:07 +0000
4@@ -7,3 +7,10 @@
5 type: string
6 default: ""
7 description: "Extra command line arguments to pass to conn-check."
8+ install_ansible_from_ppa:
9+ type: boolean
10+ default: true
11+ description: |
12+ Indicates whether ansible should be installed via the ppa. If this
13+ is set to false you must ensure a compatable version of ansible
14+ is installable via the configured apt repositories.
15
16=== modified file 'hooks/hooks.py'
17--- hooks/hooks.py 2015-03-06 17:01:23 +0000
18+++ hooks/hooks.py 2015-05-22 03:24:07 +0000
19@@ -2,6 +2,8 @@
20 import sys
21 import charmhelpers.contrib.ansible
22 import charmhelpers.payload.execd
23+import charmhelpers.core.hookenv
24+
25
26 hooks = charmhelpers.contrib.ansible.AnsibleHooks(
27 playbook_path='playbook.yaml',
28@@ -22,7 +24,9 @@
29 executed.
30 """
31 charmhelpers.payload.execd.execd_preinstall()
32- charmhelpers.contrib.ansible.install_ansible_support(from_ppa=True)
33+ config = charmhelpers.core.hookenv.config()
34+ charmhelpers.contrib.ansible.install_ansible_support(
35+ from_ppa=config['install_ansible_from_ppa'])
36
37
38 @hooks.action()

Subscribers

People subscribed via source and target branches