Configure Pacemaker/Cororsync clusters with the Pacemaker/Cororsync conifguration system (PCS)
pcs
New in version 2016.3.0.
salt.modules.pcs.
auth
(nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None)¶Authorize nodes to the cluster
a list of nodes which should be authorized to the cluster
user for communitcation with PCS (default: hacluster)
password for pcsuser (default: hacluster)
list of extra option for the 'pcs cluster auth' command
CLI Example:
salt '*' pcs.auth nodes='[ node1.example.org node2.example.org ]' pcsuser=hacluster pcspasswd=hoonetorg extra_args="[ '--force' ]"
salt.modules.pcs.
cib_create
(cibfile, scope='configuration', extra_args=None)¶Create a CIB-file from the current CIB of the cluster
name/path of the file containing the CIB
specific section of the CIB (default: configuration)
additional options for creating the CIB-file
CLI Example:
salt '*' pcs.cib_create cibfile='/tmp/VIP_apache_1.cib' scope=False
salt.modules.pcs.
cib_push
(cibfile, scope='configuration', extra_args=None)¶Push a CIB-file as the new CIB to the cluster
name/path of the file containing the CIB
specific section of the CIB (default: configuration)
additional options for creating the CIB-file
CLI Example:
salt '*' pcs.cib_push cibfile='/tmp/VIP_apache_1.cib' scope=False
salt.modules.pcs.
cluster_node_add
(node, extra_args=None)¶Add a node to the pacemaker cluster via pcs command
node that should be added
list of extra option for the 'pcs cluster node add' command
CLI Example:
salt '*' pcs.cluster_node_add node=node2.example.org
salt.modules.pcs.
cluster_setup
(nodes, pcsclustername='pcscluster', extra_args=None)¶Setup pacemaker cluster via pcs command
a list of nodes which should be set up
Name of the Pacemaker cluster (default: pcscluster)
list of extra option for the 'pcs cluster setup' command
CLI Example:
salt '*' pcs.cluster_setup nodes='[ node1.example.org node2.example.org ]' pcsclustername=pcscluster
salt.modules.pcs.
config_show
(cibfile=None)¶Show config of cluster
name/path of the file containing the CIB
CLI Example:
salt '*' pcs.config_show cibfile='/tmp/cib_for_galera'
salt.modules.pcs.
is_auth
(nodes)¶Check if nodes are already authorized
a list of nodes to be checked for authorization to the cluster
CLI Example:
salt '*' pcs.is_auth nodes='[node1.example.org node2.example.org]'
salt.modules.pcs.
item_create
(item, item_id, item_type, create='create', extra_args=None, cibfile=None)¶Create an item via pcs command (mainly for use with the pcs state module)
config, property, resource, constraint etc.
id of the item
item type
create command (create or set f.e., default: create)
additional options for the pcs command
use cibfile instead of the live CIB
salt.modules.pcs.
item_show
(item, item_id=None, item_type=None, show='show', extra_args=None, cibfile=None)¶Show an item via pcs command (mainly for use with the pcs state module)
config, property, resource, constraint etc.
id of the item
item type
show command (probably None, default: show)
additional options for the pcs command
use cibfile instead of the live CIB
salt.modules.pcs.
prop_set
(prop, value, extra_args=None, cibfile=None)¶Set the value of a cluster property
name of the property
value of the property prop
additional options for the pcs property command
use cibfile instead of the live CIB
CLI Example:
salt '*' pcs.prop_set prop='no-quorum-policy' value='ignore' cibfile='/tmp/2_node_cluster.cib'
salt.modules.pcs.
prop_show
(prop, extra_args=None, cibfile=None)¶Show the value of a cluster property
name of the property
additional options for the pcs property command
use cibfile instead of the live CIB
CLI Example:
salt '*' pcs.prop_show cibfile='/tmp/2_node_cluster.cib' prop='no-quorum-policy' cibfile='/tmp/2_node_cluster.cib'
salt.modules.pcs.
resource_create
(resource_id, resource_type, resource_options=None, cibfile=None)¶Create a resource via pcs command
name for the resource
resource type (f.e. ocf:heartbeat:IPaddr2 or VirtualIP)
additional options for creating the resource
use cibfile instead of the live CIB for manipulation
CLI Example:
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'
salt.modules.pcs.
resource_show
(resource_id, extra_args=None, cibfile=None)¶Show a resource via pcs command
name of the resource
additional options for the pcs command
use cibfile instead of the live CIB
CLI Example:
salt '*' pcs.resource_show resource_id='galera' cibfile='/tmp/cib_for_galera.cib'
salt.modules.pcs.
stonith_create
(stonith_id, stonith_device_type, stonith_device_options=None, cibfile=None)¶Create a stonith resource via pcs command
name for the stonith resource
name of the stonith agent fence_eps, fence_xvm f.e.
additional options for creating the stonith resource
use cibfile instead of the live CIB for manipulation
CLI Example:
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'
salt.modules.pcs.
stonith_show
(stonith_id, extra_args=None, cibfile=None)¶Show the value of a cluster stonith
name for the stonith resource
additional options for the pcs stonith command
use cibfile instead of the live CIB
CLI Example:
salt '*' pcs.stonith_show stonith_id='eps_fence' cibfile='/tmp/2_node_cluster.cib'