Configure Pacemaker/Cororsync clusters with the Pacemaker/Cororsync conifguration system (PCS)
depends: | pcs |
---|
New in version 2016.3.0.
Authorize nodes to the cluster
CLI Example:
salt '*' pcs.auth nodes='[ node1.example.org node2.example.org ]' pcsuser=hacluster pcspasswd=hoonetorg extra_args="[ '--force' ]"
Create a CIB-file from the current CIB of the cluster
CLI Example:
salt '*' pcs.cib_create cibfile='/tmp/VIP_apache_1.cib' scope=False
Push a CIB-file as the new CIB to the cluster
CLI Example:
salt '*' pcs.cib_push cibfile='/tmp/VIP_apache_1.cib' scope=False
Add a node to the pacemaker cluster via pcs command
CLI Example:
salt '*' pcs.cluster_node_add node=node2.example.org
Setup pacemaker cluster via pcs command
CLI Example:
salt '*' pcs.cluster_setup nodes='[ node1.example.org node2.example.org ]' pcsclustername=pcscluster
Show config of cluster
CLI Example:
salt '*' pcs.config_show cibfile='/tmp/cib_for_galera'
Check if nodes are already authorized
CLI Example:
salt '*' pcs.is_auth nodes='[node1.example.org node2.example.org]'
Create an item via pcs command (mainly for use with the pcs state module)
Show an item via pcs command (mainly for use with the pcs state module)
Set the value of a cluster property
CLI Example:
salt '*' pcs.prop_set prop='no-quorum-policy' value='ignore' cibfile='/tmp/2_node_cluster.cib'
Show the value of a cluster property
CLI Example:
salt '*' pcs.prop_show cibfile='/tmp/2_node_cluster.cib' prop='no-quorum-policy' cibfile='/tmp/2_node_cluster.cib'
Create a resource via pcs command
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'
Show a resource via pcs command
CLI Example:
salt '*' pcs.resource_show resource_id='galera' cibfile='/tmp/cib_for_galera.cib'
Create a stonith resource via pcs command
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'
Show the value of a cluster stonith
CLI Example:
salt '*' pcs.stonith_show stonith_id='eps_fence' cibfile='/tmp/2_node_cluster.cib'
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.pcs.html