skriptfabrik.pacemaker

Ansible 角色:pacemaker

Ansible Galaxy Ansible Role

描述

此角色提供 pacemaker/corosync 服务,用于设置和配置高可用性集群。

安装

ansible-galaxy install skriptfabrik.pacemaker

需求

角色变量

变量 类型 默认 备注
corosync_authkey_file 字符串 /etc/corosync/authkey corosync 授权密钥文件路径
corosync_bindnet_interface 字符串 集群通信所用的接口
corosync_cluster_name 字符串 corosync-cluster corosync 集群名称
corosync_config_file 字符串 /etc/corosync/corosync.conf corosync 配置文件路径
corosync_log_file 字符串 /var/log/corosync/corosync.log corosync 日志文件路径
pacemaker_cluster_group 字符串 集群 ansible 主机组名称
pacemaker_cluster_properties 字典列表 集群设置定义
pacemaker_cluster_resources 字典列表 集群资源定义
pacemaker_cluster_constraints 字典列表 集群约束定义

pacemaker_cluster_properties 定义字典

类型 默认 备注
name 字符串 集群属性名称
state 字符串 present present: 创建或更新资源
absent: 移除资源
value 任意类型 null 集群属性值(如果未定义值则设置为默认)

pacemaker_cluster_resources 定义字典

类型 默认 备注
resource_id 字符串 唯一的集群资源名称
state 字符串 present present: 创建或更新资源
absent: 移除资源
provider 字符串 资源提供者的名称(使用 pcs resource providers 列出所有可用的提供者)
options 字符串列表 [] 提供者选项的可选列表
operations 字典列表 [] 可选的资源操作列表
stickiness 整数 0 可选的资源粘性值
test_command 字符串 null 测试服务资源配置的可选命令

operations 定义字典

类型 默认 备注
name 字符串 操作名称(例如 startstopmonitor
state 字符串 present present: 创建或更新资源
absent: 移除资源
options 字符串列表 [] 可选的操作选项列表

pacemaker_cluster_constraints 定义字典

类型 默认 备注
type 字符串 约束类型
可以是 colocationorder
colocation 字典 type=colocation 的共享约束设置
order 字典 type=order 的顺序约束设置

colocation 约束定义字典

类型 默认 备注
state 字符串 present present: 创建或更新约束
absent: 移除约束
source_resource_id 字符串 约束源资源 ID
target_resource_id 字符串 约束目标资源 ID
score 整数/字符串 INFINITY 约束分数

order 约束定义字典

类型 默认 备注
first_resource 字符串 第一个资源的 ID
first_resource_action 字符串 第一个资源的操作 (例如 start)
second_resource 字符串 第二个资源的 ID
second_resource_action 字符串 第二个资源的可选操作 (例如 start)
options 字符串列表 [] 可选的顺序选项列表

依赖

示例剧本

- hosts: all
  roles:
    - skriptfabrik.pacemaker

作者

许可证

该项目遵循 MIT 许可证。

版权

(c) 2022, skriptfabrik GmbH

关于项目

HA Cluster manager configuration with pacemaker and corosync

安装
ansible-galaxy install skriptfabrik.pacemaker
许可证
mit
下载
2.2k