Merge ~vultaire/charm-juju-lxd:profile-fix into ~afreiberger/charm-juju-lxd:init_with_dir_storage

Proposed by Paul Goins
Status: Merged
Approved by: Drew Freiberger
Approved revision: 9260fc5f073f7fcff50be21be5033d91664c967e
Merged at revision: 9260fc5f073f7fcff50be21be5033d91664c967e
Proposed branch: ~vultaire/charm-juju-lxd:profile-fix
Merge into: ~afreiberger/charm-juju-lxd:init_with_dir_storage
Diff against target: 59 lines (+37/-1)
2 files modified
files/lxd-profile-dir.yaml (+32/-0)
reactive/juju_lxd.py (+5/-1)
Reviewer Review Type Date Requested Status
Drew Freiberger Approve
Review via email: mp+370802@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Drew Freiberger (afreiberger) wrote :

lgtm

Revision history for this message
Drew Freiberger (afreiberger) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/lxd-profile-dir.yaml b/files/lxd-profile-dir.yaml
2new file mode 100644
3index 0000000..fb1f463
4--- /dev/null
5+++ b/files/lxd-profile-dir.yaml
6@@ -0,0 +1,32 @@
7+name: juju-default
8+config:
9+ boot.autostart: "false"
10+ security.nesting: "true"
11+ security.privileged: "true"
12+ linux.kernel_modules: openvswitch,nbd,ip_tables,ip6_tables
13+devices:
14+ eth0:
15+ mtu: "9000"
16+ name: eth0
17+ nictype: bridged
18+ parent: lxdbr0
19+ type: nic
20+ eth1:
21+ mtu: "9000"
22+ name: eth1
23+ nictype: bridged
24+ parent: lxdbr0
25+ type: nic
26+ kvm:
27+ path: /dev/kvm
28+ type: unix-char
29+ mem:
30+ path: /dev/mem
31+ type: unix-char
32+ root:
33+ path: /
34+ type: disk
35+ pool: default
36+ tun:
37+ path: /dev/net/tun
38+ type: unix-char
39diff --git a/files/lxd-profile.yaml b/files/lxd-profile-zfs.yaml
40similarity index 100%
41rename from files/lxd-profile.yaml
42rename to files/lxd-profile-zfs.yaml
43diff --git a/reactive/juju_lxd.py b/reactive/juju_lxd.py
44index 25177e5..db1c0dd 100644
45--- a/reactive/juju_lxd.py
46+++ b/reactive/juju_lxd.py
47@@ -106,7 +106,11 @@ def lxd_init():
48 except:
49 pass
50
51- with open('files/lxd-profile.yaml', 'r') as profileyaml:
52+ if use_zfs:
53+ default_profile_yaml = 'files/lxd-profile-zfs.yaml'
54+ else:
55+ default_profile_yaml = 'files/lxd-profile-dir.yaml'
56+ with open(default_profile_yaml, 'r') as profileyaml:
57 try:
58 subprocess.check_output(['lxc', 'profile', 'edit', 'juju-default'],
59 stdin=profileyaml)

Subscribers

People subscribed via source and target branches

to all changes: