summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Powers <josh.powers@canonical.com>2017-03-24 15:36:46 -0700
committerScott Moser <smoser@brickies.net>2017-04-12 13:02:21 -0400
commita07f2629f0a38b6277477b0002d39400d1ea1685 (patch)
treeb9407495e83a07b95ed1aae049361a17ffe96c87
parentdad97585be0f30202a5a351800f20d4432b94694 (diff)
downloadvyos-cloud-init-a07f2629f0a38b6277477b0002d39400d1ea1685.tar.gz
vyos-cloud-init-a07f2629f0a38b6277477b0002d39400d1ea1685.zip
snap: allows for creating cloud-init snap
Add a basic snapcraft.yaml file to allow the execution of cloud-init as a snap. This will always pull down the latest source from master for the snap. setup.py will now also set the default init system to be systemd when no other is passed to it.
-rw-r--r--.gitignore4
-rwxr-xr-xsetup.py4
-rw-r--r--snapcraft.yaml21
3 files changed, 26 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 3946ec76..b0500a68 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,7 @@ __pycache__
.tox
.coverage
doc/rtd_html
+parts
+prime
+stage
+*.snap
diff --git a/setup.py b/setup.py
index e6693c90..32a44d94 100755
--- a/setup.py
+++ b/setup.py
@@ -138,9 +138,7 @@ class InitsysInstallData(install):
self.init_system = self.init_system.split(",")
if len(self.init_system) == 0:
- raise DistutilsArgError(
- ("You must specify one of (%s) when"
- " specifying init system(s)!") % (", ".join(INITSYS_TYPES)))
+ self.init_system = ['systemd']
bad = [f for f in self.init_system if f not in INITSYS_TYPES]
if len(bad) != 0:
diff --git a/snapcraft.yaml b/snapcraft.yaml
new file mode 100644
index 00000000..24e8e74d
--- /dev/null
+++ b/snapcraft.yaml
@@ -0,0 +1,21 @@
+name: cloud-init
+version: master
+summary: Init scripts for cloud instances
+description: |
+ Cloud instances need special scripts to run during initialisation to
+ retrieve and install ssh keys and to let the user run various scripts.
+
+grade: stable
+confinement: classic
+
+apps:
+ cloud-init:
+ # LP: #1669306
+ command: usr/bin/python3 $SNAP/bin/cloud-init
+ plugs: [network]
+
+parts:
+ cloud-init:
+ plugin: python
+ source-type: git
+ source: https://git.launchpad.net/cloud-init