From f32a0c32081a4c38b9738bd65a2efc35f26ee983 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 26 Mar 2015 22:51:59 -0400 Subject: improve doc, change 'click_packages' path to be 'snaps' --- cloudinit/config/cc_snappy.py | 45 ++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) (limited to 'cloudinit') 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=' argument where 'file' as 'config-blob' inside it. + If 'pkgname' is installed already, then 'snappy config pkgname ' + 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: + /foo.snap + /foo.config + /bar.snap + cloud-init will invoke: + snappy install "--config=/foo.config" \ + /foo.snap + snappy install /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: -- cgit v1.2.3