Merge lp:~cjohnston/charm-helpers/1324055 into lp:charm-helpers

Proposed by Chris Johnston
Status: Merged
Approved by: Michael Nelson
Approved revision: 154
Merged at revision: 159
Proposed branch: lp:~cjohnston/charm-helpers/1324055
Merge into: lp:charm-helpers
Diff against target: 28 lines (+4/-4)
1 file modified
charmhelpers/contrib/ansible/__init__.py (+4/-4)
To merge this branch: bzr merge lp:~cjohnston/charm-helpers/1324055
Reviewer Review Type Date Requested Status
Michael Nelson Approve
Review via email: mp+221217@code.launchpad.net

Commit message

Add the ability for a user to provide a custom location for installing ansible.

Description of the change

Some teams would like to be able to use a PPA that they control for installing ansible.

To post a comment you must log in.
lp:~cjohnston/charm-helpers/1324055 updated
154. By Chris Johnston

Add support for providing a custom ansible install location

Revision history for this message
Michael Nelson (michael.nelson) wrote :

12:53 <cjohnston> could you look at https://code.launchpad.net/~cjohnston/charm-helpers/1324055/+merge/221217 please :-)
12:54 <noodles> Sure, if you can answer a few questions about it :-)
12:54 <cjohnston> ok
12:54 <noodles> So, the main question I've got, why would you want to deploy using a PPA at all?
12:55 <noodles> (sorry, that's not meant to sound tardy, let me rephrase)
12:55 <cjohnston> because we deploy to HP
12:55 <cjohnston> which doesn't have access to -cat
12:55 <noodles> Ah. k.
12:56 <cjohnston> anything else
12:56 <cjohnston> ?
12:57 <noodles> Not really. You know that if you deploy to trusty you won't need a ppa at all right? (as 1.5.4 is in trusty universe)
12:57 * noodles adds +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/ansible/__init__.py'
2--- charmhelpers/contrib/ansible/__init__.py 2013-11-20 14:19:58 +0000
3+++ charmhelpers/contrib/ansible/__init__.py 2014-05-28 12:48:47 +0000
4@@ -75,20 +75,20 @@
5 ansible_vars_path = '/etc/ansible/host_vars/localhost'
6
7
8-def install_ansible_support(from_ppa=True):
9+def install_ansible_support(from_ppa=True, ppa_location='ppa:rquillo/ansible'):
10 """Installs the ansible package.
11
12 By default it is installed from the PPA [1] linked from
13- the ansible website [2].
14+ the ansible website [2] or from a ppa specified by a charm config.
15
16 [1] https://launchpad.net/~rquillo/+archive/ansible
17 [2] http://www.ansibleworks.com/docs/gettingstarted.html#ubuntu-and-debian
18
19- If from_ppa is false, you must ensure that the package is available
20+ If from_ppa is empty, you must ensure that the package is available
21 from a configured repository.
22 """
23 if from_ppa:
24- charmhelpers.fetch.add_source('ppa:rquillo/ansible')
25+ charmhelpers.fetch.add_source(ppa_location)
26 charmhelpers.fetch.apt_update(fatal=True)
27 charmhelpers.fetch.apt_install('ansible')
28 with open(ansible_hosts_path, 'w+') as hosts_file:

Subscribers

People subscribed via source and target branches