Merge lp:~lazypower/charms/trusty/docker/trunk into lp:charms/trusty/docker

Proposed by Charles Butler
Status: Merged
Merged at revision: 5
Proposed branch: lp:~lazypower/charms/trusty/docker/trunk
Merge into: lp:charms/trusty/docker
Diff against target: 119 lines (+37/-8)
7 files modified
config.yaml (+7/-0)
playbooks/install-or-upgrade.yaml (+6/-0)
playbooks/installation-status.yaml (+5/-1)
playbooks/latest-docker.yaml (+1/-3)
playbooks/network-relation-changed.yaml (+4/-4)
playbooks/site.yaml (+5/-0)
playbooks/uninstall-docker.yaml (+9/-0)
To merge this branch: bzr merge lp:~lazypower/charms/trusty/docker/trunk
Reviewer Review Type Date Requested Status
Matt Bruzek (community) Approve
Whit Morriss (community) Approve
Review via email: mp+257196@code.launchpad.net

Description of the change

  Import of v0.0.6
  ================
  Adds dockerpy + virtualenv to baseline install
  Adds configurable option to set the version installed when latest=true
  Patched a bug affecting empty template rendering during SDN network configuration
  Adds stop hook to strip the core docker installation from the system during destroy-of-service cycle.

To post a comment you must log in.
Revision history for this message
Whit Morriss (whitmo) wrote :

+1 LGTM. Needed for k8s upstreaming.

review: Approve
5. By Matt Bruzek

[lazypower] Import of v0.0.6
  ================
  Adds dockerpy + virtualenv to baseline install
  Adds configurable option to set the version installed when latest=true
  Patched a bug affecting empty template rendering during SDN network configuration
  Adds stop hook to strip the core docker installation from the system during destroy-of-service cycle.

Revision history for this message
Matt Bruzek (mbruzek) wrote :

Charles,

Thanks for this update, I deployed the charm and it works as expected.

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-01-16 22:42:54 +0000
3+++ config.yaml 2015-04-22 21:37:39 +0000
4@@ -5,3 +5,10 @@
5 description: |
6 If True, deploy the latest version of docker, when False (default)
7 installs docker.io from the Ubuntu package archive."
8+ version:
9+ type: string
10+ default: 1.5.0
11+ description: |
12+ When latest = true, specify the version to install from the PPA.
13+ latest = false will always assume use the current stable in distro.
14+
15
16=== added symlink 'hooks/stop'
17=== target is u'hooks.py'
18=== modified file 'playbooks/install-or-upgrade.yaml'
19--- playbooks/install-or-upgrade.yaml 2015-01-16 22:42:54 +0000
20+++ playbooks/install-or-upgrade.yaml 2015-04-22 21:37:39 +0000
21@@ -4,3 +4,9 @@
22
23 - name: Add ubuntu to Docker group
24 user: name=ubuntu state=present groups="docker"
25+
26+- name: install virtualenv
27+ apt: name=virtualenvwrapper state=present
28+
29+- name: Install docker-py
30+ pip: "name=docker-py virtualenv={{ charm_dir}}/.venv"
31
32=== modified file 'playbooks/installation-status.yaml'
33--- playbooks/installation-status.yaml 2015-01-16 22:42:54 +0000
34+++ playbooks/installation-status.yaml 2015-04-22 21:37:39 +0000
35@@ -4,11 +4,15 @@
36 shell: "dpkg -l docker.io | grep docker.io | cut -d' ' -f1"
37 register: universe_check
38
39+# Updated due to bug #24
40 - name: check for lxc-docker
41- shell: "dpkg -l lxc-docker | grep lxc-docker | cut -d' ' -f1"
42+ shell: "dpkg -l lxc-docker-{{version}} | grep lxc-docker | cut -d' ' -f1"
43 register: latest_check
44
45 - set_fact:
46 universe_installed: "{{universe_check.stdout == 'ii'}}"
47 latest_installed: "{{latest_check.stdout == 'ii'}}"
48
49+- debug: msg="{{latest_installed}}"
50+- debug: msg="{{universe_installed}}"
51+
52
53=== modified file 'playbooks/latest-docker.yaml'
54--- playbooks/latest-docker.yaml 2015-01-16 22:42:54 +0000
55+++ playbooks/latest-docker.yaml 2015-04-22 21:37:39 +0000
56@@ -12,6 +12,4 @@
57 - debug: msg="Installing latest"
58
59 - name: Install required packages.
60- apt: pkg={{ item }} state=latest update_cache=yes
61- with_items:
62- - lxc-docker
63+ apt: name=lxc-docker-{{ version }} state=present update_cache=yes
64
65=== modified file 'playbooks/network-relation-changed.yaml'
66--- playbooks/network-relation-changed.yaml 2015-01-16 22:42:54 +0000
67+++ playbooks/network-relation-changed.yaml 2015-04-22 21:37:39 +0000
68@@ -34,13 +34,13 @@
69 docker_opts: "{{ docker_opts }} --mtu {{ flannel_mtu }}"
70 when: "{{ flannel_mtu != '' }}"
71
72-- name: Render docker defaults template
73+- name: Render docker.io defaults template
74 template: src=docker dest=/etc/default/docker.io
75- when: universe_installed
76+ when: universe_installed == "True" and flannel_subnet != ''
77
78-- name: Render docker defaults template
79+- name: Render lxc-docker defaults template
80 template: src=docker dest=/etc/default/docker
81- when: latest_installed
82+ when: latest_installed == "True" and flannel_subnet != ''
83
84 - name: Halt docker service
85 service: name=docker state=stopped
86
87=== modified file 'playbooks/site.yaml'
88--- playbooks/site.yaml 2015-01-16 22:42:54 +0000
89+++ playbooks/site.yaml 2015-04-22 21:37:39 +0000
90@@ -6,6 +6,7 @@
91 tags:
92 - config-changed
93 - network-relation-changed
94+ - stop
95
96 - name: install or upgrade
97 include: install-or-upgrade.yaml
98@@ -23,3 +24,7 @@
99 tags:
100 - network-relation-changed
101
102+ - name: Uninstall Docker
103+ include: uninstall-docker.yaml
104+ tags:
105+ - stop
106
107=== added file 'playbooks/uninstall-docker.yaml'
108--- playbooks/uninstall-docker.yaml 1970-01-01 00:00:00 +0000
109+++ playbooks/uninstall-docker.yaml 2015-04-22 21:37:39 +0000
110@@ -0,0 +1,9 @@
111+---
112+- name: remove docker.io
113+ apt: name=docker.io state=absent
114+ when: universe_installed
115+
116+- name: remove lxc-docker
117+ apt: name=lxc-docker state=absent
118+ when: latest_installed
119+

Subscribers

People subscribed via source and target branches

to all changes: