%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/salt/states/cryptdev.pyo |
�
���^c @@ sn d Z d d l m Z m Z m Z d d l Z e j e � Z d d d e
e d d � Z d e
e d � Z
d S( u�
Opening of Encrypted Devices
=======================
Ensure that an encrypted device is mapped with the `mapped` function:
.. code-block:: yaml
mappedname:
cryptdev.mapped:
- device: /dev/sdb1
- keyfile: /etc/keyfile.key
- opts:
- size=256
swap:
crypted.mapped:
- device: /dev/sdx4
- keyfile: /dev/urandom
- opts: swap,cipher=aes-cbc-essiv:sha256,size=256
mappedbyuuid:
crypted.mapped:
- device: UUID=066e0200-2867-4ebe-b9e6-f30026ca2314
- keyfile: /etc/keyfile.key
- config: /etc/alternate-crypttab
.. versionadded:: 2018.3.0
i ( t absolute_importt print_functiont unicode_literalsNu
/etc/crypttabu namec C@ s� i | d 6i d 6t d 6d d 6} | rH | rH t | d <d | d <| S| r� | d k sr | d k sr | d k r� t | d <d | d d
<n� | r4t d � } | | j � k r4| r� t j d � n t d
r� d | d <d | d <q1t d | | | � }
|
rd | d d
<q1d | d d
<t | d <q4n | r�t d
r�t d | | d | d | d | d | �} | r�| d k r�d j | � | d d <n | d k r�d j | � | d d <q�q�d j | � | d d <t | d <n | S( uk
Verify that a device is mapped
name
The name under which the device is to be mapped
device
The device name, typically the device node, such as ``/dev/sdb1``
or ``UUID=066e0200-2867-4ebe-b9e6-f30026ca2314``.
keyfile
Either ``None`` if the password is to be entered manually on boot, or
an absolute path to a keyfile. If the password is to be asked
interactively, the mapping cannot be performed with ``immediate=True``.
opts
A list object of options or a comma delimited list
config
Set an alternative location for the crypttab, if the map is persistent,
Default is ``/etc/crypttab``
persist
Set if the map should be saved in the crypttab, Default is ``True``
immediate
Set if the device mapping should be executed immediately. Requires that
the keyfile not be ``None``, because the password cannot be asked
interactively. Note that options are not passed through on the initial
mapping. Default is ``False``.
match_on
A name or list of crypttab properties on which this state should be applied.
Default is ``name``, meaning that the line is matched only by the name
parameter. If the desired configuration requires two devices mapped to
the same name, supply a list of parameters to match on.
u nameu changesu resultu u commentuJ Either persist or immediate must be set, otherwise this state does nothingu noneu -u5 Device cannot be mapped immediately without a keyfileu
cryptsetupu cryptdev.activeu6 Ignore cryptdev configuration when mapping immediatelyu testu"