Merge ~ack/maas:root-dir-snap-overlay into maas:2.7

Proposed by Alberto Donato
Status: Merged
Approved by: Alberto Donato
Approved revision: 8546e06f08a141c34244d034fcd1d1188048ae94
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ack/maas:root-dir-snap-overlay
Merge into: maas:2.7
Diff against target: 38 lines (+8/-0)
3 files modified
snap/hooks/install (+1/-0)
snap/local/tree/bin/maas-deb-migrate (+5/-0)
snap/snapcraft.yaml (+2/-0)
Reviewer Review Type Date Requested Status
Björn Tillenius Approve
Review via email: mp+379872@code.launchpad.net

Commit message

LP:1852405 - add overlay for /root directory in the snap, so ssh keys can be used

To post a comment you must log in.
Revision history for this message
Björn Tillenius (bjornt) wrote :

+1. But please file a bug and link it to this MP, and reference the bug in the commit message.

review: Approve

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap/hooks/install b/snap/hooks/install
2index 00c1c1a..ba8b96c 100755
3--- a/snap/hooks/install
4+++ b/snap/hooks/install
5@@ -24,6 +24,7 @@ if [ "$user_migration_done" -ne 1 ]; then
6 chown -R snap_daemon:snap_daemon "$SNAP_COMMON/log/proxy"
7 chown -R snap_daemon:snap_daemon "$SNAP_COMMON/proxy/"{cache,spool}
8 fi
9+mkdir -p "$SNAP_DATA/root"
10 mkdir -p "$SNAP_DATA/preseeds"
11 mkdir -p "$SNAP_DATA/bind"
12 mkdir -p "$SNAP_DATA/proxy"
13diff --git a/snap/local/tree/bin/maas-deb-migrate b/snap/local/tree/bin/maas-deb-migrate
14index f29a93f..751989e 100755
15--- a/snap/local/tree/bin/maas-deb-migrate
16+++ b/snap/local/tree/bin/maas-deb-migrate
17@@ -58,6 +58,11 @@ migrate_data() {
18 if [ -d /var/lib/maas ]; then
19 mv /var/lib/maas "$SNAP_CURRENT/var/lib"
20 chown -R root:root "$SNAP_CURRENT/var/lib/maas"
21+
22+ mkdir -p "$SNAP_CURRENT/root"
23+ if [ -d "$SNAP_CURRENT/var/lib/maas/.ssh" ]; then
24+ mv "$SNAP_CURRENT/var/lib/maas/.ssh" "$SNAP_CURRENT/root"
25+ fi
26 fi
27 if [ -d /var/spool/maas-proxy ]; then
28 mv /var/spool/maas-proxy/* /var/snap/maas/common/proxy/spool/
29diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
30index b771880..f703023 100644
31--- a/snap/snapcraft.yaml
32+++ b/snap/snapcraft.yaml
33@@ -331,3 +331,5 @@ layout:
34 bind: $SNAP/etc/libvirt
35 /etc/freeipmi:
36 bind: $SNAP/etc/freeipmi
37+ /root:
38+ bind: $SNAP_DATA/root

Subscribers

People subscribed via source and target branches