Current File : //lib/python2.7/site-packages/cloudinit/config/cc_snappy.pyo |
�
oB�]c @ s@ d Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l Z d d l
Z
e j e � Z
e Z d a d Z i g d
6d d 6d
d 6d
d 6i d 6Z d g Z d � Z d � Z d d d d � Z d � Z d d d � Z d d d d � Z d � Z d � Z d � Z d � Z d � Z d S( s�
Snappy
------
**Summary:** snappy modules allows configuration of snappy.
**Deprecated**: Use :ref:`snap` module instead. This module will not exist
in cloud-init 18.3.
The below example config config would install ``etcd``, and then install
``pkg2.smoser`` with a ``<config-file>`` argument where ``config-file`` has
``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.
Entries in ``config`` can be namespaced or non-namespaced for a package.
In either case, the config provided to snappy command is non-namespaced.
The package name is provided as it appears.
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 <packages_dir>/foo.snap <packages_dir>/foo.config
- snappy install <packages_dir>/bar.snap
.. note::
that if provided a ``config`` entry for ``ubuntu-core``, then
cloud-init will invoke: snappy config ubuntu-core <config>
Allowing you to configure ubuntu-core in this way.
The ``ssh_enabled`` key controls the system's ssh service. The default value
is ``auto``. Options are:
- **True:** enable ssh service
- **False:** disable ssh service
- **auto:** enable ssh service if either ssh keys have been provided
or user has requested password authentication (ssh_pwauth).
**Internal name:** ``cc_snappy``
**Module frequency:** per instance
**Supported distros:** ubuntu
**Config keys**::
#cloud-config
snappy:
system_snappy: auto
ssh_enabled: auto
packages: [etcd, pkg2.smoser]
config:
pkgname:
key2: value2
pkg2:
key1: value1
packages_dir: '/writable/user-data/cloud-init/snaps'
i����( t log( t PER_INSTANCE( t
temp_utils( t safeyaml( t utilNt snappyt .t packagess$ /writable/user-data/cloud-init/snapst packages_dirt autot ssh_enabledt
system_snappyt configt ubuntuc C sX t j j | � } | j d � d } | j d � d } | j d � d } | | | f S( NR i t _( t ost patht basenamet
rpartitiont partition( t fnamet fname_noextt namet shortname( ( s>