Merge ~andreserl/maas:lp1696771_snap_preseeds into maas:master

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: c0c0fedb465c3059db41136767a33b25b1cfdc1c
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~andreserl/maas:lp1696771_snap_preseeds
Merge into: maas:master
Diff against target: 39 lines (+9/-0)
3 files modified
dev/null (+0/-0)
snap/hooks/configure (+8/-0)
src/maasserver/djangosettings/snappy.py (+1/-0)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
MAAS Lander Approve
Review via email: mp+348093@code.launchpad.net

Commit message

LP: #1696771 - Allow overriding preseeds in SNAP_DATA/preseeds & provide template files

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp1696771_snap_preseeds lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: c0c0fedb465c3059db41136767a33b25b1cfdc1c

review: Approve
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Nice!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap/conf/empty.tgt b/snap/conf/empty.tgt
2deleted file mode 100644
3index e69de29..0000000
4--- a/snap/conf/empty.tgt
5+++ /dev/null
6diff --git a/snap/hooks/configure b/snap/hooks/configure
7index 258943e..bbc8c89 100755
8--- a/snap/hooks/configure
9+++ b/snap/hooks/configure
10@@ -12,10 +12,18 @@ mkdir -p "$SNAP_COMMON/proxy/cache"
11 chown -R nobody:nogroup "$SNAP_COMMON/proxy/cache"
12 mkdir -p "$SNAP_COMMON/proxy/spool"
13 chown -R nobody:nogroup "$SNAP_COMMON/proxy/spool"
14+mkdir -p "$SNAP_DATA/preseeds"
15 mkdir -p "$SNAP_DATA/bind"
16 mkdir -p "$SNAP_DATA/proxy"
17 mkdir -p "$SNAP_DATA/supervisord"
18 mkdir -p "$SNAP_DATA/var/lib/maas"
19
20+# Always overwrite sample preseeds to ensure samples are up-to-date in case
21+# we do changes that need to be reflected.
22+cp "$SNAP/etc/maas/preseeds/curtin_userdata" "$SNAP_DATA/preseeds/curtin_userdata.sample"
23+cp "$SNAP/etc/maas/preseeds/curtin_userdata_centos" "$SNAP_DATA/preseeds/curtin_userdata_centos.sample"
24+cp "$SNAP/etc/maas/preseeds/curtin_userdata_custom" "$SNAP_DATA/preseeds/curtin_userdata_custom.sample"
25+cp "$SNAP/etc/maas/preseeds/curtin_userdata_windows" "$SNAP_DATA/preseeds/curtin_userdata_windows.sample"
26+
27 # Perform migrations. Does nothing in 'rack' or 'none' mode.
28 exec "$SNAP/command-maas.wrapper" migrate --configure
29diff --git a/src/maasserver/djangosettings/snappy.py b/src/maasserver/djangosettings/snappy.py
30index 59dcebd..7648e00 100644
31--- a/src/maasserver/djangosettings/snappy.py
32+++ b/src/maasserver/djangosettings/snappy.py
33@@ -25,5 +25,6 @@ STATIC_ROOT = os.path.join(
34
35 # Override the preseed locations.
36 PRESEED_TEMPLATE_LOCATIONS = (
37+ os.path.join(os.environ['SNAP_DATA'], 'preseeds'),
38 os.path.join(os.environ['SNAP'], 'etc', 'maas', 'preseeds'),
39 )

Subscribers

People subscribed via source and target branches