%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/nfs_export.pyo

�
���^c@@s\dZddlmZmZmZddlZd�Zddddd�Z	dd�Z
dS(u�
Management of NFS exports
===============================================

.. versionadded:: 2018.3.0

To ensure an NFS export exists:

.. code-block:: yaml

    add_simple_export:
      nfs_export.present:
        - name:     '/srv/nfs'
        - hosts:    '10.0.2.0/24'
        - options:
          - 'rw'

This creates the following in /etc/exports:

.. code-block:: bash

    /srv/nfs 10.0.2.0/24(rw)

For more complex exports with multiple groups of hosts, use 'clients':

.. code-block:: yaml

    add_complex_export:
      nfs_export.present:
        - name: '/srv/nfs'
        - clients:
          # First export, same as simple one above
          - hosts: '10.0.2.0/24'
            options:
              - 'rw'
          # Second export
          - hosts: '*.example.com'
            options:
              - 'ro'
              - 'subtree_check'

This creates the following in /etc/exports:

.. code-block:: bash

    /srv/nfs 10.0.2.0/24(rw) 192.168.0.0/24,172.19.0.0/16(ro,subtree_check)

Any export of the given path will be modified to match the one specified.

To ensure an NFS export is absent:

.. code-block:: yaml

    delete_export:
      nfs_export.absent:
        - name: '/srv/nfs'

i(tabsolute_importtprint_functiontunicode_literalsNcC@s/d}tjjj|�r%t|�StdfS(u,
    Only work with nfs tools installed
    uexportfsuSThe nfs_exports state module failed to load: the exportfs binary is not in the path(tsalttutilstpathtwhichtbooltFalse(tcmd((s:/usr/lib/python2.7/site-packages/salt/states/nfs_export.pyt__virtual__@s

u/etc/exportscC@s�|}i|d6id6dd6dd6}|sf|sLt|d<d|d<|Si|d6|d6g}ntd	|�}||kr|||kr�t|d<d
j|�|d<|S||dd<|||dd<td
r�d|d<dj|�|d<|Std||�nGd|dd<||dd<td
rYd|d<dj|�|d<|Std}x)|D]!}	||||	d|	d�qjW||dd<td�}
|
d|d<|
d|d<|S(u�
    Ensure that the named export is present with the given options

    name
        The export path to configure

    clients
        A list of hosts and the options applied to them.
        This option may not be used in combination with
        the 'hosts' or 'options' shortcuts.

    .. code-block:: yaml

        - clients:
          # First export
          - hosts: '10.0.2.0/24'
            options:
              - 'rw'
          # Second export
          - hosts: '*.example.com'
            options:
              - 'ro'
              - 'subtree_check'

    hosts
        A string matching a number of hosts, for example:

    .. code-block:: yaml

        hosts: '10.0.2.123'

        hosts: '10.0.2.0/24'

        hosts: 'minion1.example.com'

        hosts: '*.example.com'

        hosts: '*'

    options
        A list of NFS options, for example:

    .. code-block:: yaml

        options:
          - 'rw'
          - 'subtree_check'

    unameuchangesuresultuucommentu+Either 'clients' or 'hosts' must be defineduhostsuoptionsunfs3.list_exportsuExport {0} already configuredunewuoldutestuExport {0} would be changedunfs3.del_exportuExport {0} would be addedunfs3.add_exportunfs3.reload_exportsustderrN(tNoneRt__salt__tTruetformatt__opts__(tnametclientsthoststoptionstexportsRtrettoldt
add_exporttexpt
try_reload((s:/usr/lib/python2.7/site-packages/salt/states/nfs_export.pytpresentOsL6











cC@s|}i|d6id6dd6dd6}td|�}||kr�tdr�dj|�|d<|||d|<d|d<|Std	||�td
�}|ds�|d|d<ndj|�|d<|d|d<|||d|<nd
j|�|d<t|d<|S(u`
    Ensure that the named path is not exported

    name
        The export path to remove
    unameuchangesuresultuucommentunfs3.list_exportsutestuExport {0} would be removedunfs3.del_exportunfs3.reload_exportsustderruExport {0} removeduExport {0} already absentN(RRRRR
(RRRRRR((s:/usr/lib/python2.7/site-packages/salt/states/nfs_export.pytabsent�s,






(t__doc__t
__future__RRRtsalt.utils.pathRR
RRR(((s:/usr/lib/python2.7/site-packages/salt/states/nfs_export.pyt<module>;s	d

Zerion Mini Shell 1.0