%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/pcs.pyo

�
���^c@@s/dZddlmZmZmZddlZddlmZd�Z	dddddd�Zdddd	�Zd
d
dd�Z
d�Zd
dd�Zdd�Zddd�Zddd�Zdd�Zddd�Zddd�Zddd�Zddd�Zddd�Zddd�ZdS(u�
Configure a Pacemaker/Corosync cluster with PCS
===============================================

Configure Pacemaker/Cororsync clusters with the
Pacemaker/Cororsync conifguration system (PCS)

:depends: pcs

.. versionadded:: 2016.3.0
i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@stjjjd�rdStS(u/
    Only load if pcs package is installed
    upcs(tsalttutilstpathtwhichtFalse(((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt__virtual__sushowcC@sqdg}t|tj�r.|d|g7}nt|tj�rP||g7}n"t|ttf�rr||7}n|d	kr�||g7}nt|tj�r�||g7}n"t|ttf�r�||7}nt|tj�r�||g7}nt|ttf�r||7}n|d
krWt|ttf�sDd|krW|dg7}qWntd|dddt�S(u�
    Show an item via pcs command
    (mainly for use with the pcs state module)

    item
        config, property, resource, constraint etc.
    item_id
        id of the item
    item_type
        item type
    show
        show command (probably None, default: show)
    extra_args
        additional options for the pcs command
    cibfile
        use cibfile instead of the live CIB
    upcsu-fu
constraintu--fullucmd.run_alltoutput_loglevelutracetpython_shell(u
constraint(u
constraint(t
isinstanceRtstring_typestlistttuplet__salt__R(titemtitem_idt	item_typetshowt
extra_argstcibfiletcmd((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt	item_shows*	


"ucreatecC@s�dg}t|tj�r.|d|g7}nt|tj�rP||g7}n"t|ttf�rr||7}n|d	kr�t|tj�r�||g7}q�nt|tj�r�||g7}n"t|ttf�r�||7}n|d
kr%||g7}t|tj�r%||g7}q%nt|ttf�rl|dkr_|dj|�g}n||7}ntd|dddt�S(u�
    Create an item via pcs command
    (mainly for use with the pcs state module)

    item
        config, property, resource, constraint etc.
    item_id
        id of the item
    item_type
        item type
    create
        create command (create or set f.e., default: create)
    extra_args
        additional options for the pcs command
    cibfile
        use cibfile instead of the live CIB
    upcsu-fu
constraintuid={0}ucmd.run_allR
utraceR(u
constraint(u
constraint(u
constraint(RRR
RRtformatRR(RRRtcreateRRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytitem_createPs.	



u	haclustercC@s�dddg}|r(|d|g7}n|rA|d|g7}nt|ttf�rc||7}n||7}td|ddd	t�S(
u
    Authorize nodes to the cluster

    nodes
        a list of nodes which should be authorized to the cluster
    pcsuser
        user for communitcation with PCS (default: hacluster)
    pcspasswd
        password for pcsuser (default: hacluster)
    extra_args
        list of extra option for the 'pcs cluster auth' command

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.auth nodes='[ node1.example.org node2.example.org ]' pcsuser=hacluster pcspasswd=hoonetorg extra_args="[ '--force' ]"
    upcsuclusteruauthu-uu-pucmd.run_allR
utraceR(RRRRR(tnodestpcsusert	pcspasswdRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytauth�s

cC@s9dddg}||7}td|ddddd	t�S(
u�
    Check if nodes are already authorized

    nodes
        a list of nodes to be checked for authorization to the cluster

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.is_auth nodes='[node1.example.org node2.example.org]'
    upcsuclusteruauthucmd.run_alltstdinu

R
utraceR(RR(RR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytis_auth�s

u
pcsclustercC@sedddg}|d|g7}||7}t|ttf�rK||7}ntd|dddt�S(	u�
    Setup pacemaker cluster via pcs command

    nodes
        a list of nodes which should be set up
    pcsclustername
        Name of the Pacemaker cluster (default: pcscluster)
    extra_args
        list of extra option for the 'pcs cluster setup' command

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.cluster_setup nodes='[ node1.example.org node2.example.org ]' pcsclustername=pcscluster
    upcsuclusterusetupu--nameucmd.run_allR
utraceR(RRRRR(RtpcsclusternameRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt
cluster_setup�s

cC@s[ddddg}||g7}t|ttf�rA||7}ntd|dddt�S(	u&
    Add a node to the pacemaker cluster via pcs command

    node
        node that should be added
    extra_args
        list of extra option for the 'pcs cluster node add' command

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.cluster_node_add node=node2.example.org
    upcsuclusterunodeuadducmd.run_allR
utraceR(RRRRR(tnodeRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytcluster_node_add�s


u
configurationcC@syddd|g}t|tj�r=|dj|�g7}nt|ttf�r_||7}ntd|dddt�S(	u�
    Create a CIB-file from the current CIB of the cluster

    cibfile
        name/path of the file containing the CIB
    scope
        specific section of the CIB (default: configuration)
    extra_args
        additional options for creating the CIB-file

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.cib_create cibfile='/tmp/VIP_apache_1.cib' scope=False
    upcsuclusterucibu	scope={0}ucmd.run_allR
utraceR(RRR
RRRRR(RtscopeRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt
cib_create�s
cC@syddd|g}t|tj�r=|dj|�g7}nt|ttf�r_||7}ntd|dddt�S(	uw
    Push a CIB-file as the new CIB to the cluster

    cibfile
        name/path of the file containing the CIB
    scope
        specific section of the CIB (default: configuration)
    extra_args
        additional options for creating the CIB-file

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.cib_push cibfile='/tmp/VIP_apache_1.cib' scope=False
    upcsuclusterucib-pushu	scope={0}ucmd.run_allR
utraceR(RRR
RRRRR(RR&RR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytcib_pushs
c	C@stddddddd|�S(u�
    Show config of cluster

    cibfile
        name/path of the file containing the CIB

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.config_show cibfile='/tmp/cib_for_galera'
    RuconfigRRRN(RtNone(R((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytconfig_show"s
c	C@stddd|d|d|�S(u|
    Show the value of a cluster property

    prop
        name of the property
    extra_args
        additional options for the pcs property command
    cibfile
        use cibfile instead of the live CIB

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.prop_show cibfile='/tmp/2_node_cluster.cib' prop='no-quorum-policy' cibfile='/tmp/2_node_cluster.cib'
    RupropertyRRR(R(tpropRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt	prop_show2sc
C@s7tddddj||�dd
ddd|d	|�S(u�
    Set the value of a cluster property

    prop
        name of the property
    value
        value of the property prop
    extra_args
        additional options for the pcs property command
    cibfile
        use cibfile instead of the live CIB

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.prop_set prop='no-quorum-policy' value='ignore' cibfile='/tmp/2_node_cluster.cib'
    RupropertyRu{0}={1}RRusetRRN(RRR)(R+tvalueRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytprop_setFsc	C@stddd|d|d|�S(ui
    Show the value of a cluster stonith

    stonith_id
        name for the stonith resource
    extra_args
        additional options for the pcs stonith command
    cibfile
        use cibfile instead of the live CIB

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.stonith_show stonith_id='eps_fence' cibfile='/tmp/2_node_cluster.cib'
    RustonithRRR(R(t
stonith_idRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytstonith_showascC@s%tddd|d|d|d|�S(u
    Create a stonith resource via pcs command

    stonith_id
        name for the stonith resource
    stonith_device_type
        name of the stonith agent fence_eps, fence_xvm f.e.
    stonith_device_options
        additional options for creating the stonith resource
    cibfile
        use cibfile instead of the live CIB for manipulation

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.stonith_create stonith_id='eps_fence' stonith_device_type='fence_eps'
                                    stonith_device_options="['pcmk_host_map=node1.example.org:01;node2.example.org:02', 'ipaddr=myepsdevice.example.org', 'action=reboot', 'power_wait=5', 'verbose=1', 'debug=/var/log/pcsd/eps_fence.log', 'login=hidden', 'passwd=hoonetorg']" cibfile='/tmp/cib_for_stonith.cib'
    RustonithRRRR(R(R/tstonith_device_typetstonith_device_optionsR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytstonith_createus
c	C@stddd|d|d|�S(uT
    Show a resource via pcs command

    resource_id
        name of the resource
    extra_args
        additional options for the pcs command
    cibfile
        use cibfile instead of the live CIB

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.resource_show resource_id='galera' cibfile='/tmp/cib_for_galera.cib'
    RuresourceRRR(R(tresource_idRR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt
resource_show�scC@s%tddd|d|d|d|�S(ud
    Create a resource via pcs command

    resource_id
        name for the resource
    resource_type
        resource type (f.e. ocf:heartbeat:IPaddr2 or VirtualIP)
    resource_options
        additional options for creating the resource
    cibfile
        use cibfile instead of the live CIB for manipulation

    CLI Example:

    .. code-block:: bash

        salt '*' pcs.resource_create resource_id='galera' resource_type='ocf:heartbeat:galera' resource_options="['wsrep_cluster_address=gcomm://node1.example.org,node2.example.org,node3.example.org', '--master']" cibfile='/tmp/cib_for_galera.cib'
    RuresourceRRRR(R(R4t
resource_typetresource_optionsR((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pytresource_create�s
(t__doc__t
__future__RRRtsalt.utils.pathRtsalt.extRR	R)RRRR!R#R%R'R(R*R,R.R0R3R5R8(((s4/usr/lib/python2.7/site-packages/salt/modules/pcs.pyt<module>s&		35"	

Zerion Mini Shell 1.0