summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-03-26 22:51:59 -0400
committerScott Moser <smoser@ubuntu.com>2015-03-26 22:51:59 -0400
commitf32a0c32081a4c38b9738bd65a2efc35f26ee983 (patch)
tree9720912bc337afd63f6135e2e0290a427648ca90
parentef4a19658f354f1cb52b59c093d38d8448e26a70 (diff)
downloadvyos-cloud-init-f32a0c32081a4c38b9738bd65a2efc35f26ee983.tar.gz
vyos-cloud-init-f32a0c32081a4c38b9738bd65a2efc35f26ee983.zip
improve doc, change 'click_packages' path to be 'snaps'
-rw-r--r--cloudinit/config/cc_snappy.py45
1 files changed, 32 insertions, 13 deletions
diff --git a/cloudinit/config/cc_snappy.py b/cloudinit/config/cc_snappy.py
index 61c70f03..09a8d239 100644
--- a/cloudinit/config/cc_snappy.py
+++ b/cloudinit/config/cc_snappy.py
@@ -1,5 +1,36 @@
# vi: ts=4 expandtab
#
+"""
+snappy modules allows configuration of snappy.
+Example config:
+ #cloud-config
+ snappy:
+ system_snappy: auto
+ ssh_enabled: False
+ packages: [etcd, pkg2]
+ configs:
+ pkgname: pkgname-config-blob
+ pkg2: config-blob
+ packages_dir: '/writable/user-data/cloud-init/snaps'
+
+ - ssh_enabled:
+ This defaults to 'False'. Set to a non-false value to enable ssh service
+ - snap installation and config
+ The above would install 'etcd', and then install 'pkg2' with a
+ '--config=<file>' argument where 'file' as 'config-blob' inside it.
+ If 'pkgname' is installed already, then 'snappy config pkgname <file>'
+ will be called where 'file' has 'pkgname-config-blob' as its content.
+
+ If 'packages_dir' has files in it that end in '.snap', then they are
+ installed. Given 3 files:
+ <packages_dir>/foo.snap
+ <packages_dir>/foo.config
+ <packages_dir>/bar.snap
+ cloud-init will invoke:
+ snappy install "--config=<packages_dir>/foo.config" \
+ <packages_dir>/foo.snap
+ snappy install <packages_dir>/bar.snap
+"""
from cloudinit import log as logging
from cloudinit import templater
@@ -18,24 +49,12 @@ SNAPPY_CMD = "snappy"
BUILTIN_CFG = {
'packages': [],
- 'packages_dir': '/writable/user-data/cloud-init/click_packages',
+ 'packages_dir': '/writable/user-data/cloud-init/snaps',
'ssh_enabled': False,
'system_snappy': "auto",
'configs': {},
}
-"""
-snappy:
- system_snappy: auto
- ssh_enabled: True
- packages:
- - etcd
- - pkg2
- configs:
- pkgname: config-blob
- pkgname2: config-blob
-"""
-
def get_fs_package_ops(fspath):
if not fspath: