Merge lp:~mikemc/charms/trusty/glance-simplestreams-sync/add-source-config into lp:charms/trusty/glance-simplestreams-sync

Proposed by Mike McCracken
Status: Merged
Merged at revision: 61
Proposed branch: lp:~mikemc/charms/trusty/glance-simplestreams-sync/add-source-config
Merge into: lp:charms/trusty/glance-simplestreams-sync
Prerequisite: lp:~freyes/charms/trusty/glance-simplestreams-sync/lp1522929
Diff against target: 37 lines (+19/-0)
2 files modified
config.yaml (+18/-0)
hooks/hooks.py (+1/-0)
To merge this branch: bzr merge lp:~mikemc/charms/trusty/glance-simplestreams-sync/add-source-config
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review via email: mp+282806@code.launchpad.net

This proposal supersedes a proposal from 2016-01-15.

Commit message

Add 'source' and 'key' config options to support adding a PPA source for packages installed by the charm.

Description of the change

Add 'source' and 'key' config options to support adding a PPA source for packages installed by the charm.

This is potentially generally useful but is motivated by wanting the cloud-installer/simplestreams-testing PPA on trusty. That PPA had been unconditionally installed, but that was causing issues and will be removed by this branch: https://code.launchpad.net/~freyes/charms/trusty/glance-simplestreams-sync/lp1522929/+merge/279644

This option allows us to add that PPA only when required.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) 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 2015-09-08 16:25:57 +0000
3+++ config.yaml 2016-01-15 20:02:49 +0000
4@@ -78,3 +78,21 @@
5 description: |
6 A comma-separated list of nagios servicegroups.
7 If left empty, the nagios_context will be used as the servicegroup
8+ source:
9+ type: string
10+ default:
11+ description: |
12+ Optional configuration to support use of additional sources such as:
13+
14+ - ppa:myteam/ppa
15+ - cloud:trusty-proposed/kilo
16+ - http://my.archive.com/ubuntu main
17+
18+ The last option should be used in conjunction with the key configuration
19+ option.
20+ key:
21+ type: string
22+ default:
23+ description: |
24+ Key ID to import to the apt keyring to support use with arbitary source
25+ configuration from outside of Launchpad archives or PPA's.
26
27=== modified file 'hooks/hooks.py'
28--- hooks/hooks.py 2016-01-15 20:02:49 +0000
29+++ hooks/hooks.py 2016-01-15 20:02:49 +0000
30@@ -195,6 +195,7 @@
31 @hooks.hook('install')
32 def install():
33 execd_preinstall()
34+ add_source(hookenv.config('source'), hookenv.config('key'))
35 for directory in [CONF_FILE_DIR, USR_SHARE_DIR]:
36 hookenv.log("creating config dir at {}".format(directory))
37 if not os.path.isdir(directory):

Subscribers

People subscribed via source and target branches