├── handlers └── main.yml ├── vars ├── main.yml ├── debian10.yml ├── debian11.yml ├── debian12.yml ├── debian13.yml ├── redhat6.yml ├── fedora31.yml ├── fedora32.yml ├── almalinux9.yml ├── centos10.yml ├── centos9.yml ├── redhat10.yml ├── redhat9.yml ├── almalinux10.yml ├── redhat7.yml ├── fedora36.yml ├── fedora37.yml ├── fedora38.yml ├── fedora39.yml ├── fedora40.yml ├── fedora41.yml ├── fedora42.yml ├── fedora43.yml ├── fedora33.yml ├── fedora34.yml ├── fedora35.yml ├── centos8.yml ├── redhat8.yml └── almalinux8.yml ├── videos ├── default_playbook-centos-7.6 │ ├── hosts-default │ ├── playbook-default.yml │ ├── our_environment │ └── script.sh ├── default_playbook-fedora29 │ ├── playbook-default.yml │ ├── hosts-default │ ├── our_environment │ └── script.sh ├── default_playbook │ ├── hosts-default │ ├── playbook-default.yml │ ├── script.sh │ └── our_environment ├── README-recordings ├── default_playbook-recording ├── default_playbook-fedora29-recording └── default_playbook-centos-7.6-recording ├── tasks ├── fence_custom.yml ├── cluster_property.yml ├── debian_tasks.yml ├── cluster_resource_defaults.yml ├── cluster_resource.yml ├── cluster_constraint_order.yml ├── cluster_constraint_colocation.yml ├── cluster_constraint_location.yml ├── rocky_repos.yml ├── almalinux_repos.yml ├── firewall.yml ├── install_local_media.yml ├── fence_kdump.yml ├── fence_aws.yml ├── fence_xvm.yml ├── fence_vmware_soap.yml ├── redhat_repos.yml ├── fence_vmware_rest.yml ├── centos_repos.yml ├── install_normal.yml └── main.yml ├── files └── iptables ├── meta └── main.yml ├── ansible-deps-el7 ├── python-markupsafe.spec.orig ├── python-markupsafe.spec ├── python-jinja2.spec.orig └── python-jinja2.spec ├── defaults └── main.yml ├── README.md └── LICENSE /handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restart iptables 3 | service: 4 | name: 'iptables' 5 | state: 'restarted' 6 | -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # common values that can be overriden by other files in this directory 3 | kdump_service_name: 'kdump' 4 | -------------------------------------------------------------------------------- /videos/default_playbook-centos-7.6/hosts-default: -------------------------------------------------------------------------------- 1 | [servers] 2 | 192.168.22.41 vm_name=fastvm-centos-7.6-41 3 | 192.168.22.42 vm_name=fastvm-centos-7.6-42 4 | -------------------------------------------------------------------------------- /videos/default_playbook-centos-7.6/playbook-default.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: servers 3 | remote_user: root 4 | roles: 5 | - { role: ondrejhome.ha-cluster-pacemaker } 6 | -------------------------------------------------------------------------------- /videos/default_playbook-fedora29/playbook-default.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: servers 3 | remote_user: root 4 | roles: 5 | - { role: ondrejhome.ha-cluster-pacemaker } 6 | -------------------------------------------------------------------------------- /videos/default_playbook-fedora29/hosts-default: -------------------------------------------------------------------------------- 1 | [servers] 2 | 192.168.22.43 vm_name=fastvm-fedora29-43 ansible_python_interpreter=/usr/bin/python3 3 | 192.168.22.44 vm_name=fastvm-fedora29-44 ansible_python_interpreter=/usr/bin/python3 4 | -------------------------------------------------------------------------------- /videos/default_playbook/hosts-default: -------------------------------------------------------------------------------- 1 | [servers] 2 | 192.168.34.41 vm_name=fastvm-centos-7.5-41 3 | 192.168.34.42 vm_name=fastvm-centos-7.5-42 4 | -------------------------------------------------------------------------------- /tasks/fence_custom.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create custom fence device 3 | pcs_resource: 4 | name: "{{ item.key }}" 5 | resource_class: 'stonith' 6 | resource_type: "{{ item.value.fence_type }}" 7 | options: "{{ item.value.fence_options }}" 8 | with_dict: "{{ cluster_fence_config | default({}) }}" 9 | run_once: true 10 | -------------------------------------------------------------------------------- /tasks/cluster_property.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure cluster properties - pcs_property 3 | pcs_property: 4 | name: "{{ item.name }}" 5 | state: "{{ item.state | default(omit) }}" 6 | node: "{{ item.node | default(omit) }}" 7 | value: "{{ item.value | default(omit) }}" 8 | with_items: "{{ cluster_property }}" 9 | run_once: true 10 | -------------------------------------------------------------------------------- /tasks/debian_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if Corosync configuration is default configuration 3 | command: '/usr/bin/dpkg --verify corosync' 4 | register: result 5 | changed_when: false 6 | check_mode: false 7 | 8 | - name: Destroy default configuration 9 | pcs_cluster: 10 | state: 'absent' 11 | when: not result.stdout | regex_search(".* \/etc\/corosync\/corosync.conf$", multiline=True) 12 | -------------------------------------------------------------------------------- /vars/debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - pacemaker-cli-utils 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | - pacemaker-cli-utils 10 | fence_kdump_packages: 11 | - kdump-tools 12 | 13 | kdump_service_name: 'kdump-tools' 14 | cluster_configure_fence_xvm: false 15 | cluster_firewall: false 16 | 17 | pcsd_configuration_file: /etc/default/pcsd 18 | -------------------------------------------------------------------------------- /vars/debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - pacemaker-cli-utils 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | - pacemaker-cli-utils 10 | fence_kdump_packages: 11 | - kdump-tools 12 | 13 | kdump_service_name: 'kdump-tools' 14 | cluster_configure_fence_xvm: false 15 | cluster_firewall: false 16 | 17 | pcsd_configuration_file: /etc/default/pcsd 18 | -------------------------------------------------------------------------------- /vars/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - pacemaker-cli-utils 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | - pacemaker-cli-utils 10 | fence_kdump_packages: 11 | - kdump-tools 12 | 13 | kdump_service_name: 'kdump-tools' 14 | cluster_configure_fence_xvm: false 15 | cluster_firewall: false 16 | 17 | pcsd_configuration_file: /etc/default/pcsd 18 | -------------------------------------------------------------------------------- /vars/debian13.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - pacemaker-cli-utils 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | - pacemaker-cli-utils 10 | fence_kdump_packages: 11 | - kdump-tools 12 | 13 | kdump_service_name: 'kdump-tools' 14 | cluster_configure_fence_xvm: false 15 | cluster_firewall: false 16 | 17 | pcsd_configuration_file: /etc/default/pcsd 18 | -------------------------------------------------------------------------------- /tasks/cluster_resource_defaults.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure cluster resource defaults - pcs_resource_defaults 3 | pcs_resource_defaults: 4 | name: "{{ item.name }}" 5 | state: "{{ item.state | default(omit) }}" 6 | defaults_type: "{{ item.defaults_type | default(omit) }}" 7 | value: "{{ item.value | default(omit) }}" 8 | with_items: "{{ cluster_resource_defaults }}" 9 | run_once: true 10 | -------------------------------------------------------------------------------- /vars/redhat6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - cman 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | fence_xvm_packages: 10 | - fence-virt 11 | fence_kdump_packages: 12 | - fence-agents 13 | - kexec-tools 14 | fence_vmware_soap_packages: 15 | - fence-agents 16 | firewall_packages: 17 | - iptables 18 | 19 | pcsd_configuration_file: /etc/sysconfig/pcsd 20 | -------------------------------------------------------------------------------- /videos/default_playbook/playbook-default.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: servers 3 | remote_user: root 4 | roles: 5 | - { role: ondrejhome.ha-cluster-pacemaker } 6 | -------------------------------------------------------------------------------- /vars/fedora31.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | - python3-requests 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/fedora32.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | - python3-requests 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/almalinux9.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | pacemaker_remote_packages: 5 | - pcs 6 | - pacemaker-remote 7 | fence_xvm_packages: 8 | - fence-virt 9 | fence_kdump_packages: 10 | - fence-agents-kdump 11 | - kexec-tools 12 | fence_vmware_soap_packages: 13 | - fence-agents-vmware-soap 14 | fence_vmware_rest_packages: 15 | - fence-agents-vmware-rest 16 | fence_aws_packages: 17 | - fence-agents-aws 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/centos10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | pacemaker_remote_packages: 5 | - pcs 6 | - pacemaker-remote 7 | fence_xvm_packages: 8 | - fence-virt 9 | fence_kdump_packages: 10 | - fence-agents-kdump 11 | - kexec-tools 12 | fence_vmware_soap_packages: 13 | - fence-agents-vmware-soap 14 | fence_vmware_rest_packages: 15 | - fence-agents-vmware-rest 16 | fence_aws_packages: 17 | - fence-agents-aws 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/centos9.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | pacemaker_remote_packages: 5 | - pcs 6 | - pacemaker-remote 7 | fence_xvm_packages: 8 | - fence-virt 9 | fence_kdump_packages: 10 | - fence-agents-kdump 11 | - kexec-tools 12 | fence_vmware_soap_packages: 13 | - fence-agents-vmware-soap 14 | fence_vmware_rest_packages: 15 | - fence-agents-vmware-rest 16 | fence_aws_packages: 17 | - fence-agents-aws 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/redhat10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | pacemaker_remote_packages: 5 | - pcs 6 | - pacemaker-remote 7 | fence_xvm_packages: 8 | - fence-virt 9 | fence_kdump_packages: 10 | - fence-agents-kdump 11 | - kexec-tools 12 | fence_vmware_soap_packages: 13 | - fence-agents-vmware-soap 14 | fence_vmware_rest_packages: 15 | - fence-agents-vmware-rest 16 | fence_aws_packages: 17 | - fence-agents-aws 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/redhat9.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | pacemaker_remote_packages: 5 | - pcs 6 | - pacemaker-remote 7 | fence_xvm_packages: 8 | - fence-virt 9 | fence_kdump_packages: 10 | - fence-agents-kdump 11 | - kexec-tools 12 | fence_vmware_soap_packages: 13 | - fence-agents-vmware-soap 14 | fence_vmware_rest_packages: 15 | - fence-agents-vmware-rest 16 | fence_aws_packages: 17 | - fence-agents-aws 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/almalinux10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | pacemaker_remote_packages: 5 | - pcs 6 | - pacemaker-remote 7 | fence_xvm_packages: 8 | - fence-virt 9 | fence_kdump_packages: 10 | - fence-agents-kdump 11 | - kexec-tools 12 | fence_vmware_soap_packages: 13 | - fence-agents-vmware-soap 14 | fence_vmware_rest_packages: 15 | - fence-agents-vmware-rest 16 | fence_aws_packages: 17 | - fence-agents-aws 18 | firewall_packages: 19 | - firewalld 20 | 21 | pcsd_configuration_file: /etc/sysconfig/pcsd 22 | -------------------------------------------------------------------------------- /vars/redhat7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora36.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora37.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora38.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora39.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora40.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora41.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora42.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora43.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | fence_vmware_rest_packages: 16 | - fence-agents-vmware-rest 17 | fence_aws_packages: 18 | - fence-agents-aws 19 | firewall_packages: 20 | - firewalld 21 | 22 | pcsd_configuration_file: /etc/sysconfig/pcsd 23 | -------------------------------------------------------------------------------- /vars/fedora33.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | - python3-requests 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | fence_aws_packages: 19 | - fence-agents-aws 20 | firewall_packages: 21 | - firewalld 22 | 23 | pcsd_configuration_file: /etc/sysconfig/pcsd 24 | -------------------------------------------------------------------------------- /vars/fedora34.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | - python3-requests 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | fence_aws_packages: 19 | - fence-agents-aws 20 | firewall_packages: 21 | - firewalld 22 | 23 | pcsd_configuration_file: /etc/sysconfig/pcsd 24 | -------------------------------------------------------------------------------- /vars/fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | pacemaker_remote_packages: 6 | - pcs 7 | - pacemaker-remote 8 | fence_xvm_packages: 9 | - fence-virt 10 | fence_kdump_packages: 11 | - fence-agents-kdump 12 | - kexec-tools 13 | fence_vmware_soap_packages: 14 | - fence-agents-vmware-soap 15 | - python3-requests 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | fence_aws_packages: 19 | - fence-agents-aws 20 | firewall_packages: 21 | - firewalld 22 | 23 | pcsd_configuration_file: /etc/sysconfig/pcsd 24 | -------------------------------------------------------------------------------- /vars/centos8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - libknet1-crypto-nss-plugin 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | fence_xvm_packages: 10 | - fence-virt 11 | fence_kdump_packages: 12 | - fence-agents-kdump 13 | - kexec-tools 14 | fence_vmware_soap_packages: 15 | - fence-agents-vmware-soap 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | fence_aws_packages: 19 | - fence-agents-aws 20 | firewall_packages: 21 | - firewalld 22 | 23 | pcsd_configuration_file: /etc/sysconfig/pcsd 24 | -------------------------------------------------------------------------------- /vars/redhat8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - libknet1-crypto-nss-plugin 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | fence_xvm_packages: 10 | - fence-virt 11 | fence_kdump_packages: 12 | - fence-agents-kdump 13 | - kexec-tools 14 | fence_vmware_soap_packages: 15 | - fence-agents-vmware-soap 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | fence_aws_packages: 19 | - fence-agents-aws 20 | firewall_packages: 21 | - firewalld 22 | 23 | pcsd_configuration_file: /etc/sysconfig/pcsd 24 | -------------------------------------------------------------------------------- /vars/almalinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pacemaker_packages: 3 | - pcs 4 | - pacemaker 5 | - libknet1-crypto-nss-plugin 6 | pacemaker_remote_packages: 7 | - pcs 8 | - pacemaker-remote 9 | fence_xvm_packages: 10 | - fence-virt 11 | fence_kdump_packages: 12 | - fence-agents-kdump 13 | - kexec-tools 14 | fence_vmware_soap_packages: 15 | - fence-agents-vmware-soap 16 | fence_vmware_rest_packages: 17 | - fence-agents-vmware-rest 18 | fence_aws_packages: 19 | - fence-agents-aws 20 | firewall_packages: 21 | - firewalld 22 | 23 | pcsd_configuration_file: /etc/sysconfig/pcsd 24 | -------------------------------------------------------------------------------- /tasks/cluster_resource.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure cluster resources - pcs_resource 3 | pcs_resource: 4 | name: "{{ item.name }}" 5 | state: "{{ item.state | default(omit) }}" 6 | resource_class: "{{ item.resource_class | default(omit) }}" 7 | resource_type: "{{ item.resource_type | default(omit) }}" 8 | options: "{{ item.options | default(omit) }}" 9 | force_resource_update: "{{ item.force_resource_update | default(omit) }}" 10 | child_name: "{{ item.child_name | default(omit) }}" 11 | with_items: "{{ cluster_resource }}" 12 | run_once: true 13 | -------------------------------------------------------------------------------- /tasks/cluster_constraint_order.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure cluster order constraints - pcs_constraint_order 3 | pcs_constraint_order: 4 | resource1: "{{ item.resource1 }}" 5 | resource2: "{{ item.resource2 }}" 6 | state: "{{ item.state | default(omit) }}" 7 | resource1_action: "{{ item.resource1_action | default(omit) }}" 8 | resource2_action: "{{ item.resource2_action | default(omit) }}" 9 | kind: "{{ item.kind | default(omit) }}" 10 | symmetrical: "{{ item.symmetrical | default(omit) }}" 11 | with_items: "{{ cluster_constraint_order }}" 12 | run_once: true 13 | -------------------------------------------------------------------------------- /tasks/cluster_constraint_colocation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure cluster colocation constraints - pcs_constraint_colocation 3 | pcs_constraint_colocation: 4 | resource1: "{{ item.resource1 }}" 5 | resource2: "{{ item.resource2 }}" 6 | state: "{{ item.state | default(omit) }}" 7 | resource1_role: "{{ item.resource1_role | default(omit) }}" 8 | resource2_role: "{{ item.resource2_role | default(omit) }}" 9 | score: "{{ item.score | default(omit) }}" 10 | influence: "{{ item.influence | default(omit) }}" 11 | with_items: "{{ cluster_constraint_colocation }}" 12 | run_once: true 13 | -------------------------------------------------------------------------------- /videos/default_playbook-fedora29/our_environment: -------------------------------------------------------------------------------- 1 | ============================================================ 2 | KVM running 2 VMs with following configuration. 3 | Key for fence_xvm is located at /etc/cluster/fence_xvm.key 4 | on machine from which we run ansible. 5 | VM-1: 6 | IP address: 192.168.22.43 7 | VM name: fastvm-fedora29-41 (as seen by hypervisor) 8 | VM hostname: fastvm-fedora29-41 9 | VM-2: 10 | IP address: 192.168.22.44 11 | VM name: fastvm-fedora29-42 (as seen by hypervisor) 12 | VM hostname: fastvm-fedora29-42 13 | ============================================================ 14 | -------------------------------------------------------------------------------- /videos/default_playbook-centos-7.6/our_environment: -------------------------------------------------------------------------------- 1 | ============================================================ 2 | KVM running 2 VMs with following configuration. 3 | Key for fence_xvm is located at /etc/cluster/fence_xvm.key 4 | on machine from which we run ansible. 5 | VM-1: 6 | IP address: 192.168.34.41 7 | VM name: fastvm-centos-7.6-41 (as seen by hypervisor) 8 | VM hostname: fastvm-centos-7-6-41 9 | VM-2: 10 | IP address: 192.168.34.42 11 | VM name: fastvm-centos-7.6-42 (as seen by hypervisor) 12 | VM hostname: fastvm-centos-7-6-42 13 | ============================================================ 14 | -------------------------------------------------------------------------------- /tasks/cluster_constraint_location.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure cluster location constraints - pcs_constraint_location 3 | pcs_constraint_location: 4 | resource: "{{ item.resource }}" 5 | state: "{{ item.state | default(omit) }}" 6 | node_name: "{{ item.node_name | default(omit) }}" 7 | rule: "{{ item.rule | default(omit) }}" 8 | constraint_id: "{{ item.constraint_id | default(omit) }}" 9 | resource1_role: "{{ item.resource1_role | default(omit) }}" 10 | resource2_role: "{{ item.resource2_role | default(omit) }}" 11 | score: "{{ item.score | default(omit) }}" 12 | with_items: "{{ cluster_constraint_location }}" 13 | run_once: true 14 | -------------------------------------------------------------------------------- /files/iptables: -------------------------------------------------------------------------------- 1 | # Firewall configuration written by system-config-firewall 2 | # Manual customization of this file is not recommended. 3 | *filter 4 | :INPUT ACCEPT [0:0] 5 | :FORWARD ACCEPT [0:0] 6 | :OUTPUT ACCEPT [0:0] 7 | -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT 8 | -A INPUT -p icmp -j ACCEPT 9 | -A INPUT -i lo -j ACCEPT 10 | -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 11 | -A INPUT -m state --state NEW -p tcp -m tcp --dport 2224 -j ACCEPT 12 | -A INPUT -m state --state NEW -p tcp -m tcp --dport 3121 -j ACCEPT 13 | -A INPUT -m state --state NEW -p tcp -m tcp --dport 21064 -j ACCEPT 14 | -A INPUT -m state --state NEW -p udp -m udp --dport 5405 -j ACCEPT 15 | -A INPUT -m state --state NEW -p tcp -m tcp --dport 1229 -j ACCEPT 16 | -A INPUT -j REJECT --reject-with icmp-host-prohibited 17 | -A FORWARD -j REJECT --reject-with icmp-host-prohibited 18 | COMMIT 19 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Ondrej Faměra 4 | description: pacemaker basic cluster role with fencing configuration (xvm, kdump, custom) 5 | license: GPLv3 6 | min_ansible_version: 2.8 7 | platforms: 8 | - name: EL 9 | versions: 10 | - 6 11 | - 7 12 | - 8 13 | - 9 14 | - 10 15 | - name: Fedora 16 | versions: 17 | - 31 18 | - 32 19 | - 33 20 | - 34 21 | - 35 22 | - 36 23 | - 37 24 | - 38 25 | - 39 26 | - 40 27 | - 41 28 | - 42 29 | - 43 30 | - name: Debian 31 | versions: 32 | - 'buster' 33 | - 'bullseye' 34 | - 'bookworm' 35 | - 'trixie' 36 | galaxy_tags: 37 | - clustering 38 | - pacemaker 39 | dependencies: 40 | - {role: ondrejhome.pcs-modules-2} 41 | -------------------------------------------------------------------------------- /videos/README-recordings: -------------------------------------------------------------------------------- 1 | == Howto for recodings == 2 | Below is procedure for making recordings of this role. 3 | Any recording should be done using asciinema v2 format. 4 | 5 | 1. Have some machine that will be executing the commands. 6 | I will use remote machine (VM) in this procedure - 192.168.34.62 7 | 8 | 2. Copy all scripts that will be used to machine user 'user' 9 | 10 | 3. Make sure that: 11 | - you can login to machine as 'user' without password 12 | - user 'user' on machine can login without password to all future cluster nodes (needed for ansible) 13 | - machine contains /etc/cluster/fence_xvm.key 14 | 15 | 4. Run recording using command below. 16 | # asciinema rec default_playbook-recording -c "ssh user@192.168.34.62 bash script.sh" 17 | 18 | 5. Edit recording file to make sure that timings are not too long. 19 | (it is borring to look at non-moving output for long time) 20 | -------------------------------------------------------------------------------- /tasks/rocky_repos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get list of active repositories 3 | command: yum repolist 4 | args: 5 | warn: "{{ (ansible_version.full is version('2.14', '<')) | ternary(false, omit) }}" 6 | register: yum_repolist 7 | changed_when: false 8 | check_mode: false 9 | 10 | - name: Enable highavailability repository (Rocky 8) 11 | ini_file: 12 | dest: '/etc/yum.repos.d/Rocky-HighAvailability.repo' 13 | section: 'ha' 14 | option: 'enabled' 15 | value: '1' 16 | create: 'no' 17 | mode: '0644' 18 | when: >- 19 | 'HighAvailability' not in yum_repolist.stdout 20 | and enable_repos | bool 21 | and ansible_distribution_major_version in ['8'] 22 | 23 | - name: Enable highavailability repository (Rocky 9) 24 | ini_file: 25 | dest: '/etc/yum.repos.d/rocky-addons.repo' 26 | section: 'highavailability' 27 | option: 'enabled' 28 | value: '1' 29 | create: 'no' 30 | mode: '0644' 31 | when: >- 32 | 'highavailability' not in yum_repolist.stdout 33 | and enable_repos | bool 34 | and ansible_distribution_major_version in ['9'] 35 | -------------------------------------------------------------------------------- /tasks/almalinux_repos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get list of active repositories 3 | command: yum repolist 4 | args: 5 | warn: "{{ (ansible_version.full is version('2.14', '<')) | ternary(false, omit) }}" 6 | register: yum_repolist 7 | changed_when: false 8 | check_mode: false 9 | 10 | - name: Enable highavailability repository (AlmaLinux 8.3+) 11 | ini_file: 12 | dest: '/etc/yum.repos.d/almalinux-ha.repo' 13 | section: 'ha' 14 | option: 'enabled' 15 | value: '1' 16 | create: 'no' 17 | mode: '0644' 18 | when: >- 19 | 'HighAvailability' not in yum_repolist.stdout 20 | and enable_repos | bool 21 | and ansible_distribution_major_version in ['8'] 22 | 23 | - name: Enable highavailability repository (AlmaLinux 9/10) 24 | ini_file: 25 | dest: '/etc/yum.repos.d/almalinux-highavailability.repo' 26 | section: 'highavailability' 27 | option: 'enabled' 28 | value: '1' 29 | create: 'no' 30 | mode: '0644' 31 | when: >- 32 | 'HighAvailability' not in yum_repolist.stdout 33 | and enable_repos | bool 34 | and ansible_distribution_major_version in ['9','10'] 35 | -------------------------------------------------------------------------------- /videos/default_playbook/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export ANSIBLE_FORCE_COLOR=true 3 | ## 4 | echo "[user@examples ~]$ cat /etc/redhat-release" 5 | cat /etc/redhat-release 6 | sleep 1 7 | 8 | ## 9 | echo "[user@examples ~]$ ansible --version" 10 | ansible --version 11 | sleep 1 12 | 13 | ## 14 | echo "[user@examples ~]$ cat our_environment" 15 | cat our_environment 16 | sleep 4 17 | 18 | ## 19 | echo "[user@examples ~]$ ls -l /etc/cluster/fence_xvm.key" 20 | ls -l /etc/cluster/fence_xvm.key 21 | sleep 2 22 | 23 | ## 24 | echo "[user@examples ~]$ ansible-galaxy install ondrejhome.ha-cluster-pacemaker,19.0.0 ondrejhome.pcs-modules-2,19.0.0 -p roles" 25 | ansible-galaxy install ondrejhome.ha-cluster-pacemaker,19.0.0 ondrejhome.pcs-modules-2,19.0.0 -p roles 26 | sleep 2 27 | 28 | ## 29 | echo "[user@examples ~]$ cat hosts-default" 30 | cat hosts-default 31 | sleep 2 32 | 33 | ## 34 | echo "[user@examples ~]$ cat playbook-default.yml" 35 | cat playbook-default.yml 36 | sleep 2 37 | 38 | ## 39 | echo "[user@examples ~]$ ansible-playbook -i hosts-default playbook-default.yml" 40 | ansible-playbook -i hosts-default playbook-default.yml 41 | sleep 2 42 | -------------------------------------------------------------------------------- /videos/default_playbook-fedora29/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export ANSIBLE_FORCE_COLOR=true 3 | ## 4 | echo "[user@examples ~]$ cat /etc/redhat-release" 5 | cat /etc/redhat-release 6 | sleep 1 7 | 8 | ## 9 | echo "[user@examples ~]$ ansible --version" 10 | ansible --version 11 | sleep 1 12 | 13 | ## 14 | echo "[user@examples ~]$ cat our_environment" 15 | cat our_environment 16 | sleep 4 17 | 18 | ## 19 | echo "[user@examples ~]$ ls -l /etc/cluster/fence_xvm.key" 20 | ls -l /etc/cluster/fence_xvm.key 21 | sleep 2 22 | 23 | ## 24 | echo "[user@examples ~]$ ansible-galaxy install ondrejhome.ha-cluster-pacemaker,19.0.0 ondrejhome.pcs-modules-2,19.0.0 -p roles" 25 | ansible-galaxy install ondrejhome.ha-cluster-pacemaker,19.0.0 ondrejhome.pcs-modules-2,19.0.0 -p roles 26 | sleep 2 27 | 28 | ## 29 | echo "[user@examples ~]$ cat hosts-default" 30 | cat hosts-default 31 | sleep 2 32 | 33 | ## 34 | echo "[user@examples ~]$ cat playbook-default.yml" 35 | cat playbook-default.yml 36 | sleep 2 37 | 38 | ## 39 | echo "[user@examples ~]$ ansible-playbook -i hosts-default playbook-default.yml" 40 | ansible-playbook -i hosts-default playbook-default.yml 41 | sleep 2 42 | -------------------------------------------------------------------------------- /tasks/firewall.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure firewalld 3 | when: 4 | - ansible_distribution in ['RedHat','CentOS','AlmaLinux','Rocky','Fedora'] 5 | - not (ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6') 6 | block: 7 | - name: Enable and start firewalld service 8 | service: 9 | name: 'firewalld' 10 | enabled: true 11 | state: 'started' 12 | 13 | - name: Enable 'high-availability' firewalld service 14 | firewalld: 15 | service: 'high-availability' 16 | permanent: true 17 | state: 'enabled' 18 | immediate: true 19 | 20 | - name: Configure iptables (EL6) 21 | when: 22 | - ansible_distribution in ['RedHat'] 23 | - ansible_distribution_major_version == '6' 24 | block: 25 | - name: Copy iptables configuration 26 | copy: 27 | src: 'iptables' 28 | dest: '/etc/sysconfig/iptables' 29 | owner: 'root' 30 | group: 'root' 31 | mode: '0644' 32 | notify: 33 | - Restart iptables 34 | 35 | - name: Enable and start iptables service 36 | service: 37 | name: 'iptables' 38 | enabled: true 39 | state: 'started' 40 | 41 | - name: Run handlers to reload iptables on system 42 | meta: flush_handlers 43 | -------------------------------------------------------------------------------- /videos/default_playbook/our_environment: -------------------------------------------------------------------------------- 1 | ============================================================ 2 | KVM running 2 VMs with following configuration. 3 | Key for fence_xvm is located at /etc/cluster/fence_xvm.key 4 | on machine from which we run ansible. 5 | VM-1: 6 | IP address: 192.168.34.41 7 | VM name: fastvm-centos-7.5-41 (as seen by hypervisor) 8 | VM hostname: fastvm-centos-7-5-41 9 | VM-2: 10 | IP address: 192.168.34.42 11 | VM name: fastvm-centos-7.5-42 (as seen by hypervisor) 12 | VM hostname: fastvm-centos-7-5-42 13 | ============================================================ 14 | -------------------------------------------------------------------------------- /tasks/install_local_media.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Mount cdrom to /media/CentOS 3 | mount: 4 | name: '/media/CentOS' 5 | src: '/dev/cdrom' 6 | state: 'mounted' 7 | fstype: 'iso9660' 8 | opts: 'ro' 9 | 10 | - name: Install libselinux-python to work with SELinux setting 11 | yum: 12 | name: 'libselinux-python' 13 | state: 'installed' 14 | disablerepo: '*' 15 | enablerepo: "c{{ ansible_distribution_major_version }}-media" 16 | 17 | - name: Install firewall packages 18 | yum: 19 | name: '{{ firewall_packages }}' 20 | state: 'installed' 21 | disablerepo: '*' 22 | enablerepo: "c{{ ansible_distribution_major_version }}-media" 23 | when: cluster_firewall|bool 24 | 25 | - name: Install Pacemaker cluster packages to all nodes 26 | yum: 27 | name: "{{ pacemaker_packages }}" 28 | state: 'installed' 29 | disablerepo: '*' 30 | enablerepo: "c{{ ansible_distribution_major_version }}-media" 31 | 32 | - name: Install package(s) for fence_xvm 33 | yum: 34 | name: "{{ fence_xvm_packages }}" 35 | state: 'installed' 36 | disablerepo: '*' 37 | enablerepo: "c{{ ansible_distribution_major_version }}-media" 38 | when: cluster_configure_fence_xvm|bool 39 | 40 | - name: Install package(s) for fence_kdump 41 | yum: 42 | name: "{{ fence_kdump_packages }}" 43 | state: 'installed' 44 | disablerepo: '*' 45 | enablerepo: "c{{ ansible_distribution_major_version }}-media" 46 | when: cluster_configure_fence_kdump|bool 47 | -------------------------------------------------------------------------------- /videos/default_playbook-centos-7.6/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export ANSIBLE_FORCE_COLOR=true 3 | ## 4 | echo "!! python-jinja2 package in CentOS/RHEL is very old and has some incopatibilities." 5 | echo "Newer version is required when running plaubook from CentOS/RHEL machine !!" 6 | echo "You can use steps below as root to get newer version of python-jinja2 package." 7 | echo "" 8 | ## 9 | echo "[root@examples ~]# curl https://copr.fedorainfracloud.org/coprs/ondrejhome/ansible-deps-el7/repo/epel-7/ondrejhome-ansible-deps-el7-epel-7.repo > /etc/yum.repos.d/ondrejhome-ansible-deps-el7-epel-7.repo" 10 | echo "[root@examples ~]# yum update python-jinja2 python-markupsafe" 11 | echo "" 12 | sleep 10 13 | ## 14 | echo "[user@examples ~]$ cat /etc/redhat-release" 15 | cat /etc/redhat-release 16 | sleep 1 17 | 18 | ## 19 | echo "[user@examples ~]$ ansible --version" 20 | ansible --version 21 | sleep 1 22 | 23 | ## 24 | echo "[user@examples ~]$ cat our_environment" 25 | cat our_environment 26 | sleep 4 27 | 28 | ## 29 | echo "[user@examples ~]$ ls -l /etc/cluster/fence_xvm.key" 30 | ls -l /etc/cluster/fence_xvm.key 31 | sleep 2 32 | 33 | ## 34 | echo "[user@examples ~]$ ansible-galaxy install ondrejhome.ha-cluster-pacemaker,19.0.0 ondrejhome.pcs-modules-2,19.0.0 -p roles" 35 | ansible-galaxy install ondrejhome.ha-cluster-pacemaker,19.0.0 ondrejhome.pcs-modules-2,19.0.0 -p roles 36 | sleep 2 37 | 38 | ## 39 | echo "[user@examples ~]$ cat hosts-default" 40 | cat hosts-default 41 | sleep 2 42 | 43 | ## 44 | echo "[user@examples ~]$ cat playbook-default.yml" 45 | cat playbook-default.yml 46 | sleep 2 47 | 48 | ## 49 | echo "[user@examples ~]$ ansible-playbook -i hosts-default playbook-default.yml" 50 | ansible-playbook -i hosts-default playbook-default.yml 51 | sleep 2 52 | -------------------------------------------------------------------------------- /tasks/fence_kdump.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Enable kdump service 3 | service: 4 | name: "{{ kdump_service_name }}" 5 | state: 'started' 6 | enabled: true 7 | 8 | - name: Configure separate stonith devices per cluster node 9 | when: cluster_configure_stonith_style is not defined or cluster_configure_stonith_style == 'one-device-per-node' 10 | block: 11 | - name: Create fence_kdump STONITH devices 12 | pcs_resource: 13 | name: "fence-kdump-{{ hostvars[item][cluster_hostname_fact] }}" 14 | resource_class: 'stonith' 15 | resource_type: 'fence_kdump' 16 | options: "pcmk_host_list={{ hostvars[item][cluster_hostname_fact] }} {% if ansible_distribution == 'Debian' %}pcmk_monitor_action=metadata{% endif %}" 17 | with_items: "{{ play_hosts }}" 18 | run_once: true 19 | # FIXME: fence_kdump on Debian returns exit code 1 for 'monitor' op so we use 'metadata' as dummy replacement 20 | 21 | - name: Create fence constraints 22 | pcs_constraint_location: 23 | resource: "fence-kdump-{{ hostvars[item][cluster_hostname_fact] }}" 24 | node_name: "{{ hostvars[item][cluster_hostname_fact] }}" 25 | score: '-INFINITY' 26 | with_items: '{{ play_hosts }}' 27 | run_once: true 28 | 29 | - name: Configure single stonith device for all nodes 30 | when: cluster_configure_stonith_style is defined and cluster_configure_stonith_style == 'one-device-per-cluster' 31 | block: 32 | - name: Create fence_kdump STONITH device 33 | pcs_resource: 34 | name: "fence-kdump" 35 | resource_class: 'stonith' 36 | resource_type: 'fence_kdump' 37 | options: >- 38 | pcmk_host_map="{% for item in groups['cluster' + rand_id + '_node_is_remote_False'] %}{{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }};{% endfor %}" 39 | run_once: true 40 | -------------------------------------------------------------------------------- /tasks/fence_aws.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if 'instance_id' variable is defined for each node 3 | fail: 4 | msg: "'instance_id' must be defined for each node and Instance ID of instance as seen by AWS Console." 5 | when: instance_id is not defined 6 | 7 | - name: Check if 'fence_aws_region' variable is defined for inventory 8 | fail: 9 | msg: "'fence_aws_region' must be defined for each node." 10 | when: fence_aws_region is not defined 11 | 12 | - name: Configure separate stonith devices per cluster node 13 | when: cluster_configure_stonith_style is not defined or cluster_configure_stonith_style == 'one-device-per-node' 14 | block: 15 | - name: Create fence_aws STONITH devices 16 | pcs_resource: 17 | name: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 18 | resource_class: 'stonith' 19 | resource_type: 'fence_aws' 20 | options: >- 21 | pcmk_host_map={{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['instance_id'] }}; 22 | region={{ fence_aws_region }} 23 | {{ fence_aws_options }} 24 | with_items: "{{ play_hosts }}" 25 | run_once: true 26 | 27 | - name: Create fence constraints 28 | pcs_constraint_location: 29 | resource: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 30 | node_name: "{{ hostvars[item][cluster_hostname_fact] }}" 31 | score: '-INFINITY' 32 | with_items: "{{ play_hosts }}" 33 | run_once: true 34 | 35 | - name: Configure single stonith device for all nodes 36 | when: cluster_configure_stonith_style is defined and cluster_configure_stonith_style == 'one-device-per-cluster' 37 | block: 38 | - name: Create fence_aws STONITH device 39 | pcs_resource: 40 | name: 'fence-aws' 41 | resource_class: 'stonith' 42 | resource_type: 'fence_aws' 43 | options: >- 44 | pcmk_host_map="{% for item in groups['cluster' + rand_id + '_node_is_remote_False'] %}{{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['instance_id'] }};{% endfor %}" 45 | region={{ fence_aws_region }} 46 | {{ fence_aws_options }} 47 | run_once: true 48 | -------------------------------------------------------------------------------- /tasks/fence_xvm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if 'vm_name' variable is defined for each node 3 | fail: 4 | msg: "'vm_name' must be defined for each node and contain name of VM as seen by hypervisor." 5 | when: vm_name is not defined 6 | 7 | - name: Create /etc/cluster directory 8 | file: 9 | path: '/etc/cluster' 10 | state: 'directory' 11 | mode: '0755' 12 | 13 | - name: Copy fence_xvm key to all cluster nodes 14 | copy: 15 | src: "{{ fence_xvm_key }}" 16 | dest: '/etc/cluster/fence_xvm.key' 17 | owner: 'root' 18 | group: 'root' 19 | mode: '0640' 20 | 21 | - name: Enable fence_xvm port(1229/tcp) in firewalld 22 | firewalld: 23 | port: '1229/tcp' 24 | permanent: true 25 | state: 'enabled' 26 | immediate: true 27 | when: >- 28 | (ansible_distribution_major_version in [ "7", "8", "9" ] or ansible_distribution == 'Fedora') 29 | and cluster_firewall|bool 30 | 31 | - name: Configure separate stonith devices per cluster node 32 | when: cluster_configure_stonith_style is not defined or cluster_configure_stonith_style == 'one-device-per-node' 33 | block: 34 | - name: Create fence_xvm STONITH devices 35 | pcs_resource: 36 | name: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 37 | resource_class: 'stonith' 38 | resource_type: 'fence_xvm' 39 | options: >- 40 | pcmk_host_map={{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }}; 41 | op monitor interval=30s 42 | with_items: "{{ play_hosts }}" 43 | run_once: true 44 | 45 | - name: Create fence constraints 46 | pcs_constraint_location: 47 | resource: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 48 | node_name: "{{ hostvars[item][cluster_hostname_fact] }}" 49 | score: '-INFINITY' 50 | with_items: "{{ play_hosts }}" 51 | run_once: true 52 | 53 | - name: Configure single stonith device for all nodes 54 | when: cluster_configure_stonith_style is defined and cluster_configure_stonith_style == 'one-device-per-cluster' 55 | block: 56 | - name: Create fence_xvm STONITH device 57 | pcs_resource: 58 | name: "fence-xvm" 59 | resource_class: 'stonith' 60 | resource_type: 'fence_xvm' 61 | options: >- 62 | pcmk_host_map="{% for item in groups['cluster' + rand_id + '_node_is_remote_False'] %}{{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }};{% endfor %}" 63 | op monitor interval=30s 64 | run_once: true 65 | 66 | # FIXME - EL6 firewall 67 | -------------------------------------------------------------------------------- /tasks/fence_vmware_soap.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if 'vm_name' variable is defined for each node 3 | fail: 4 | msg: "'vm_name' must be defined for each node and contain name or UUID of VM as seen by hypervisor." 5 | when: vm_name is not defined 6 | 7 | - name: Check if 'fence_vmware_ipaddr' variable is defined 8 | fail: 9 | msg: "'fence_vmware_ipaddr' variable has to be defined and contain 'hostname' or 'IP address' of vCenter/hypervisor" 10 | when: fence_vmware_ipaddr is not defined 11 | 12 | - name: Check if 'fence_vmware_login' variable is defined 13 | fail: 14 | msg: "'fence_vmware_login' variable has to be defined and contain username to vCenter or hypervisor" 15 | when: fence_vmware_login is not defined 16 | 17 | - name: Check if 'fence_vmware_passwd' variable is defined 18 | fail: 19 | msg: "'fence_vmware_passwd' variable has to be defined and contain password for user {{ fence_vmware_login }}" 20 | when: fence_vmware_passwd is not defined 21 | 22 | - name: Configure separate stonith devices per cluster node 23 | when: cluster_configure_stonith_style is not defined or cluster_configure_stonith_style == 'one-device-per-node' 24 | block: 25 | - name: Create fence_vmware_soap STONITH devices 26 | pcs_resource: 27 | name: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 28 | resource_class: 'stonith' 29 | resource_type: 'fence_vmware_soap' 30 | options: >- 31 | pcmk_host_map={{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }}; 32 | ipaddr={{ fence_vmware_ipaddr }} 33 | login={{ fence_vmware_login }} 34 | passwd={{ fence_vmware_passwd }} 35 | {{ fence_vmware_options }} 36 | with_items: "{{ play_hosts }}" 37 | run_once: true 38 | 39 | - name: Create fence constraints 40 | pcs_constraint_location: 41 | resource: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 42 | node_name: "{{ hostvars[item][cluster_hostname_fact] }}" 43 | score: '-INFINITY' 44 | with_items: "{{ play_hosts }}" 45 | run_once: true 46 | 47 | - name: Configure single stonith device for all nodes 48 | when: cluster_configure_stonith_style is defined and cluster_configure_stonith_style == 'one-device-per-cluster' 49 | block: 50 | - name: Create fence_vmware_soap STONITH device 51 | pcs_resource: 52 | name: 'fence-vmware-soap' 53 | resource_class: 'stonith' 54 | resource_type: 'fence_vmware_soap' 55 | options: >- 56 | pcmk_host_map="{% for item in groups['cluster' + rand_id + '_node_is_remote_False'] %}{{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }};{% endfor %}" 57 | ipaddr={{ fence_vmware_ipaddr }} 58 | login={{ fence_vmware_login }} 59 | passwd={{ fence_vmware_passwd }} 60 | {{ fence_vmware_options }} 61 | run_once: true 62 | -------------------------------------------------------------------------------- /tasks/redhat_repos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get list of active repositories 3 | command: yum repolist 4 | args: 5 | warn: "{{ (ansible_version.full is version('2.14', '<')) | ternary(false, omit) }}" 6 | register: yum_repolist 7 | changed_when: false 8 | check_mode: false 9 | 10 | - name: Enable HA/RS repository (RHEL 6/7) 11 | command: >- 12 | subscription-manager repos 13 | --enable="rhel-{{ repos_type }}-for-rhel-{{ ansible_distribution_major_version }}-server-rpms" 14 | changed_when: true 15 | when: >- 16 | ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-rpms'] | join 17 | not in yum_repolist.stdout 18 | and enable_repos | bool 19 | and ansible_distribution_major_version in ['6','7'] 20 | 21 | - name: Enable HA/RS EUS repository (RHEL 6/7) 22 | command: >- 23 | subscription-manager repos 24 | --enable="rhel-{{ repos_type }}-for-rhel-{{ ansible_distribution_major_version }}-server-eus-rpms" 25 | changed_when: true 26 | when: >- 27 | ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-eus-rpms'] | join 28 | not in yum_repolist.stdout 29 | and enable_eus_repos | bool 30 | and ansible_distribution_major_version in ['6','7'] 31 | 32 | - name: Enable HA E4S repository (RHEL 6/7) 33 | command: >- 34 | subscription-manager repos 35 | --enable="rhel-ha-for-rhel-{{ ansible_distribution_major_version }}-server-e4s-rpms" 36 | changed_when: true 37 | when: >- 38 | ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-e4s-rpms'] | join 39 | not in yum_repolist.stdout 40 | and enable_e4s_repos | bool 41 | and ansible_distribution_major_version in ['6','7'] 42 | 43 | - name: Enable HA/RS BETA repository (RHEL 6/7) 44 | command: >- 45 | subscription-manager repos 46 | --enable="rhel-{{ repos_type }}-for-rhel-{{ ansible_distribution_major_version }}-server-beta-rpms" 47 | changed_when: true 48 | when: >- 49 | ['rhel-',repos_type,'-for-rhel-',ansible_distribution_major_version,'-server-beta-rpms'] | join 50 | not in yum_repolist.stdout 51 | and enable_beta_repos | bool 52 | and ansible_distribution_major_version in ['6','7'] 53 | 54 | - name: Enable HA/RS repository (RHEL 8/9/10) 55 | command: >- 56 | subscription-manager repos 57 | --enable="rhel-{{ ansible_distribution_major_version }}-for-x86_64-{{ (repos_type == 'rs') | ternary('resilientstorage', 'highavailability') }}-rpms" 58 | changed_when: true 59 | when: >- 60 | ['rhel-',ansible_distribution_major_version,'-for-x86_64-',(repos_type == 'rs') | ternary( 'resilientstorage', 'highavailability'),'-rpms'] | join 61 | not in yum_repolist.stdout 62 | and enable_repos | bool 63 | and ansible_distribution_major_version in ['8','9','10'] 64 | 65 | - name: Enable single custom repository 66 | command: subscription-manager repos --enable="{{ custom_repository }}" 67 | changed_when: true 68 | when: "custom_repository is defined and custom_repository not in yum_repolist.stdout|default(custom_repository)" 69 | -------------------------------------------------------------------------------- /tasks/fence_vmware_rest.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check minimal system version requirement 3 | fail: 4 | msg: "'fence_vmware_rest' is not present on EL6." 5 | when: ansible_distribution_major_version == '6' 6 | 7 | - name: Check if 'vm_name' variable is defined for each node 8 | fail: 9 | msg: "'vm_name' must be defined for each node and contain name or UUID of VM as seen by hypervisor." 10 | when: vm_name is not defined 11 | 12 | - name: Check if 'fence_vmware_ipaddr' variable is defined 13 | fail: 14 | msg: "'fence_vmware_ipaddr' variable has to be defined and contain 'hostname' or 'IP address' of vCenter/hypervisor" 15 | when: fence_vmware_ipaddr is not defined 16 | 17 | - name: Check if 'fence_vmware_login' variable is defined 18 | fail: 19 | msg: "'fence_vmware_login' variable has to be defined and contain username to vCenter or hypervisor" 20 | when: fence_vmware_login is not defined 21 | 22 | - name: Check if 'fence_vmware_passwd' variable is defined 23 | fail: 24 | msg: "'fence_vmware_passwd' variable has to be defined and contain password for user {{ fence_vmware_login }}" 25 | when: fence_vmware_passwd is not defined 26 | 27 | - name: Configure separate stonith devices per cluster node 28 | when: cluster_configure_stonith_style is not defined or cluster_configure_stonith_style == 'one-device-per-node' 29 | block: 30 | - name: Create fence_vmware_rest STONITH devices 31 | pcs_resource: 32 | name: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 33 | resource_class: 'stonith' 34 | resource_type: 'fence_vmware_rest' 35 | options: >- 36 | pcmk_host_map={{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }}; 37 | ipaddr={{ fence_vmware_ipaddr }} 38 | login={{ fence_vmware_login }} 39 | passwd={{ fence_vmware_passwd }} 40 | {{ fence_vmware_options }} 41 | with_items: "{{ play_hosts }}" 42 | run_once: true 43 | 44 | - name: Create fence constraints 45 | pcs_constraint_location: 46 | resource: "fence-{{ hostvars[item][cluster_hostname_fact] }}" 47 | node_name: "{{ hostvars[item][cluster_hostname_fact] }}" 48 | score: '-INFINITY' 49 | with_items: "{{ play_hosts }}" 50 | run_once: true 51 | 52 | - name: Configure single stonith device for all nodes 53 | when: cluster_configure_stonith_style is defined and cluster_configure_stonith_style == 'one-device-per-cluster' 54 | block: 55 | - name: Create fence_vmware_rest STONITH device 56 | pcs_resource: 57 | name: 'fence-vmware-rest' 58 | resource_class: 'stonith' 59 | resource_type: 'fence_vmware_rest' 60 | options: >- 61 | pcmk_host_map="{% for item in groups['cluster' + rand_id + '_node_is_remote_False'] %}{{ hostvars[item][cluster_hostname_fact] }}:{{ hostvars[item]['vm_name'] }};{% endfor %}" 62 | ipaddr={{ fence_vmware_ipaddr }} 63 | login={{ fence_vmware_login }} 64 | passwd={{ fence_vmware_passwd }} 65 | {{ fence_vmware_options }} 66 | run_once: true 67 | -------------------------------------------------------------------------------- /tasks/centos_repos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get list of active repositories 3 | command: yum repolist 4 | args: 5 | warn: "{{ (ansible_version.full is version('2.14', '<')) | ternary(false, omit) }}" 6 | register: yum_repolist 7 | changed_when: false 8 | check_mode: false 9 | 10 | - name: EOL enable highavailability repository (CentOS 8.1, 8.2) 11 | ini_file: 12 | dest: '/etc/yum.repos.d/CentOS-HA.repo' 13 | section: 'HighAvailability' 14 | option: 'enabled' 15 | value: '1' 16 | create: 'no' 17 | mode: '0644' 18 | when: >- 19 | 'HighAvailability' not in yum_repolist.stdout 20 | and enable_repos | bool 21 | and ansible_distribution_version in ['8.1', '8.2'] 22 | 23 | - name: EOL enable highavailability repository (CentOS 8.3, 8.4, 8.5) 24 | ini_file: 25 | dest: '/etc/yum.repos.d/CentOS-Linux-HighAvailability.repo' 26 | section: 'ha' 27 | option: 'enabled' 28 | value: '1' 29 | create: 'no' 30 | mode: '0644' 31 | when: >- 32 | 'HighAvailability' not in yum_repolist.stdout 33 | and enable_repos | bool 34 | and ansible_distribution_major_version in ['8'] 35 | and ansible_distribution_version not in ['8.0', '8.1', '8.2', '8'] 36 | 37 | - name: EOL disable mirrorlist for CentOS Linux 8.1, 8.2 HA repository 38 | ini_file: 39 | dest: '/etc/yum.repos.d/CentOS-HA.repo' 40 | section: 'HighAvailability' 41 | option: 'mirrorlist' 42 | create: 'no' 43 | mode: '0644' 44 | state: absent 45 | when: >- 46 | enable_repos | bool 47 | and ansible_distribution_version in ['8.1', '8.2'] 48 | 49 | - name: EOL disable mirrorlist for CentOS Linux 8.3, 8.4, 8.5 HA repository 50 | ini_file: 51 | dest: '/etc/yum.repos.d/CentOS-Linux-HighAvailability.repo' 52 | section: 'ha' 53 | option: 'mirrorlist' 54 | create: 'no' 55 | mode: '0644' 56 | state: absent 57 | when: >- 58 | enable_repos | bool 59 | and ansible_distribution_version in ['8.3', '8.4', '8.5'] 60 | 61 | - name: EOL configure baseurl for CentOS Linux 8.1, 8.2 HA repository 62 | ini_file: 63 | dest: '/etc/yum.repos.d/CentOS-HA.repo' 64 | section: 'HighAvailability' 65 | option: 'baseurl' 66 | value: 'http://vault.centos.org/$contentdir/$releasever/HighAvailability/$basearch/os/' 67 | create: 'no' 68 | mode: '0644' 69 | state: present 70 | when: >- 71 | enable_repos | bool 72 | and ansible_distribution_version in ['8.1', '8.2'] 73 | 74 | - name: EOL configure baseurl for CentOS Linux 8.3, 8.4, 8.5 HA repository 75 | ini_file: 76 | dest: '/etc/yum.repos.d/CentOS-Linux-HighAvailability.repo' 77 | section: 'ha' 78 | option: 'baseurl' 79 | value: 'http://vault.centos.org/$contentdir/$releasever/HighAvailability/$basearch/os/' 80 | create: 'no' 81 | mode: '0644' 82 | state: present 83 | when: >- 84 | enable_repos | bool 85 | and ansible_distribution_version in ['8.3', '8.4', '8.5'] 86 | 87 | - name: Enable highavailability repository (CentOS 8 Stream) 88 | ini_file: 89 | dest: '/etc/yum.repos.d/CentOS-Stream-HighAvailability.repo' 90 | section: 'ha' 91 | option: 'enabled' 92 | value: '1' 93 | create: 'no' 94 | mode: '0644' 95 | when: >- 96 | 'HighAvailability' not in yum_repolist.stdout 97 | and enable_repos | bool 98 | and ansible_distribution_major_version in ['8'] 99 | and ansible_distribution_version not in ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] 100 | 101 | - name: Enable highavailability repository (CentOS 9/10 Stream) 102 | ini_file: 103 | dest: '/etc/yum.repos.d/centos-addons.repo' 104 | section: 'highavailability' 105 | option: 'enabled' 106 | value: '1' 107 | create: 'no' 108 | mode: '0644' 109 | when: >- 110 | 'HighAvailability' not in yum_repolist.stdout 111 | and enable_repos | bool 112 | and ansible_distribution_major_version in ['9', '10'] 113 | -------------------------------------------------------------------------------- /tasks/install_normal.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Construct list of packages for installation 3 | run_once: true 4 | delegate_to: localhost 5 | block: 6 | - name: "Packages: Add pacemaker/pacemaker-remote packages" 7 | set_fact: 8 | packages_for_installation: "{{ cluster_node_is_remote | bool | ternary(pacemaker_remote_packages, pacemaker_packages) }}" 9 | 10 | - name: "Packages: Add libselinux-python package to work with SELinux setting" 11 | set_fact: 12 | packages_for_installation: "{{ packages_for_installation + ['libselinux-python'] }}" 13 | when: 14 | - not (ansible_distribution in ['RedHat','CentOS','AlmaLinux','Rocky'] and ansible_distribution_major_version == '8') 15 | - not (ansible_distribution in ['RedHat','CentOS','AlmaLinux','Rocky'] and ansible_distribution_major_version == '9') 16 | - not (ansible_distribution in ['RedHat','CentOS','AlmaLinux'] and ansible_distribution_major_version == '10') 17 | - not (ansible_distribution == 'Fedora' and ansible_distribution_major_version >= '31') 18 | - not (ansible_distribution == 'Debian') 19 | 20 | - name: "Packages: Add python3-setuptools package for compatibility with distutils module" 21 | set_fact: 22 | packages_for_installation: "{{ packages_for_installation + ['python3-setuptools'] }}" 23 | when: 24 | - (ansible_distribution in ['AlmaLinux'] and ansible_distribution_major_version == '10') or (ansible_distribution == 'Fedora' and ansible_distribution_major_version >= '42') 25 | 26 | - name: "Packages: Add pcs-modules-2 Debian dependencies (Debian 10/11/12)" 27 | set_fact: 28 | packages_for_installation: "{{ packages_for_installation + ['python3-distutils'] }}" 29 | when: 30 | - ansible_distribution == 'Debian' 31 | - ansible_distribution_major_version in ['10','11','12'] 32 | 33 | - name: "Packages: Add pcs-modules-2 Debian dependencies (Debian 13)" 34 | set_fact: 35 | packages_for_installation: "{{ packages_for_installation + ['python3-setuptools'] }}" 36 | when: 37 | - ansible_distribution == 'Debian' 38 | - ansible_distribution_major_version in ['13'] 39 | 40 | - name: "Packages: Add firewall packages" 41 | set_fact: 42 | packages_for_installation: "{{ packages_for_installation + firewall_packages }}" 43 | when: cluster_firewall|bool 44 | 45 | - name: "Packages: Add fence_xvm packages" 46 | set_fact: 47 | packages_for_installation: "{{ packages_for_installation + fence_xvm_packages }}" 48 | when: cluster_configure_fence_xvm|bool 49 | 50 | - name: "Packages: Add fence_kdump packages" 51 | set_fact: 52 | packages_for_installation: "{{ packages_for_installation + fence_kdump_packages }}" 53 | when: cluster_configure_fence_kdump|bool 54 | 55 | - name: "Packages: Add fence_vmware_rest packages" 56 | set_fact: 57 | packages_for_installation: "{{ packages_for_installation + fence_vmware_rest_packages }}" 58 | when: cluster_configure_fence_vmware_rest is defined and cluster_configure_fence_vmware_rest|bool 59 | 60 | - name: "Packages: Add fence_vmware_soap packages" 61 | set_fact: 62 | packages_for_installation: "{{ packages_for_installation + fence_vmware_soap_packages }}" 63 | when: cluster_configure_fence_vmware_soap is defined and cluster_configure_fence_vmware_soap|bool 64 | 65 | - name: "Packages: Add fence_aws packages" 66 | set_fact: 67 | packages_for_installation: "{{ packages_for_installation + fence_aws_packages }}" 68 | when: cluster_configure_fence_aws|bool 69 | 70 | - name: Workaround for Fedora systems python3-libdnf5 package 71 | # https://github.com/ansible/ansible/issues/84206 72 | when: 73 | - ansible_distribution == 'Fedora' 74 | - ansible_distribution_major_version in ['41','42', '43'] 75 | block: 76 | - name: (fedora-workaround) Fetch list of installed RPMs 77 | command: rpm -qa 78 | register: rpm_qa 79 | changed_when: false 80 | check_mode: false 81 | - name: (fedora-workaround) Install python3-libdnf5 package if missing 82 | command: dnf install -y python3-libdnf5 83 | when: rpm_qa.stdout_lines | select('search', '^python3-libdnf5-[0-9]') | length == 0 84 | 85 | - name: Install packages (YUM) 86 | yum: 87 | name: "{{ packages_for_installation }}" 88 | state: 'installed' 89 | when: ansible_distribution != 'Debian' 90 | 91 | - name: Install packages (APT) 92 | apt: 93 | name: "{{ packages_for_installation }}" 94 | state: 'present' 95 | cache_valid_time: 3600 96 | install_recommends: "{{ omit if ansible_distribution_major_version not in ['13'] else 'false' }}" 97 | when: ansible_distribution == 'Debian' 98 | -------------------------------------------------------------------------------- /ansible-deps-el7/python-markupsafe.spec.orig: -------------------------------------------------------------------------------- 1 | %if 0%{?fedora} > 12 2 | %global with_python3 1 3 | %else 4 | %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} 5 | %endif 6 | 7 | Name: python-markupsafe 8 | Version: 0.11 9 | Release: 10%{?dist} 10 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 11 | 12 | Group: Development/Languages 13 | License: BSD 14 | URL: http://pypi.python.org/pypi/MarkupSafe 15 | Source0: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz 16 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 17 | 18 | BuildRequires: python-devel python-setuptools-devel 19 | 20 | %if 0%{?with_python3} 21 | BuildRequires: python3-devel python3-setuptools 22 | # For /usr/bin/2to3 23 | BuildRequires: python-tools 24 | %endif # if with_python3 25 | 26 | 27 | %description 28 | A library for safe markup escaping. 29 | 30 | %if 0%{?with_python3} 31 | %package -n python3-markupsafe 32 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 33 | Group: Development/Languages 34 | 35 | %description -n python3-markupsafe 36 | A library for safe markup escaping. 37 | %endif #if with_python3 38 | 39 | %prep 40 | %setup -q -n MarkupSafe-%{version} 41 | 42 | %if 0%{?with_python3} 43 | rm -rf %{py3dir} 44 | cp -a . %{py3dir} 45 | 2to3 --write --nobackups %{py3dir} 46 | %endif # with_python3 47 | 48 | %build 49 | CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build 50 | 51 | %if 0%{?with_python3} 52 | pushd %{py3dir} 53 | CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build 54 | popd 55 | %endif # with_python3 56 | 57 | 58 | %install 59 | rm -rf $RPM_BUILD_ROOT 60 | %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT 61 | # C code errantly gets installed 62 | rm $RPM_BUILD_ROOT/%{python_sitearch}/markupsafe/*.c 63 | 64 | %if 0%{?with_python3} 65 | pushd %{py3dir} 66 | %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT 67 | rm $RPM_BUILD_ROOT/%{python3_sitearch}/markupsafe/*.c 68 | popd 69 | %endif # with_python3 70 | 71 | 72 | %check 73 | %{__python} setup.py test 74 | 75 | %if 0%{?with_python3} 76 | pushd %{py3dir} 77 | %{__python3} setup.py test 78 | popd 79 | %endif # with_python3 80 | 81 | %clean 82 | rm -rf $RPM_BUILD_ROOT 83 | 84 | 85 | %files 86 | %defattr(-,root,root,-) 87 | %doc AUTHORS LICENSE README.rst 88 | %{python_sitearch}/* 89 | 90 | %if 0%{?with_python3} 91 | %files -n python3-markupsafe 92 | %defattr(-,root,root,-) 93 | %doc AUTHORS LICENSE README.rst 94 | %{python3_sitearch}/* 95 | %endif # with_python3 96 | 97 | 98 | %changelog 99 | * Fri Jan 24 2014 Daniel Mach - 0.11-10 100 | - Mass rebuild 2014-01-24 101 | 102 | * Fri Dec 27 2013 Daniel Mach - 0.11-9 103 | - Mass rebuild 2013-12-27 104 | 105 | * Thu Feb 14 2013 Fedora Release Engineering - 0.11-8 106 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 107 | 108 | * Sat Aug 04 2012 David Malcolm - 0.11-7 109 | - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 110 | 111 | * Fri Aug 3 2012 David Malcolm - 0.11-6 112 | - remove rhel logic from with_python3 conditional 113 | 114 | * Sat Jul 21 2012 Fedora Release Engineering - 0.11-5 115 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 116 | 117 | * Sat Jan 14 2012 Fedora Release Engineering - 0.11-4 118 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 119 | 120 | * Tue Feb 08 2011 Fedora Release Engineering - 0.11-3 121 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 122 | 123 | * Wed Dec 29 2010 David Malcolm - 0.11-2 124 | - rebuild for newer python3 125 | 126 | * Thu Sep 30 2010 Luke Macken - 0.11-1 127 | - Update to 0.11 128 | 129 | * Wed Aug 25 2010 Thomas Spura - 0.9.2-5 130 | - rebuild with python3.2 131 | http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html 132 | 133 | * Fri Jul 23 2010 David Malcolm - 0.9.2-4 134 | - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild 135 | 136 | * Thu Jun 24 2010 Kyle VanderBeek - 0.9.2-3 137 | - Fix missing setuptools BuildRequires. 138 | 139 | * Thu Jun 24 2010 Kyle VanderBeek - 0.9.2-2 140 | - Fixed sitearch and python3 definitions to work better with older Fedora/RHEL. 141 | 142 | * Wed Jun 23 2010 Kyle VanderBeek - 0.9.2-1 143 | - Initial version. 144 | -------------------------------------------------------------------------------- /ansible-deps-el7/python-markupsafe.spec: -------------------------------------------------------------------------------- 1 | %if 0%{?fedora} > 12 2 | %global with_python3 1 3 | %else 4 | %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} 5 | %endif 6 | 7 | Name: python-markupsafe 8 | Version: 0.23 9 | Release: 1.el7 10 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 11 | 12 | Group: Development/Languages 13 | License: BSD 14 | URL: http://pypi.python.org/pypi/MarkupSafe 15 | Source0: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz 16 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 17 | 18 | BuildRequires: python-devel python-setuptools-devel 19 | 20 | %if 0%{?with_python3} 21 | BuildRequires: python3-devel python3-setuptools 22 | # For /usr/bin/2to3 23 | BuildRequires: python-tools 24 | %endif # if with_python3 25 | 26 | 27 | %description 28 | A library for safe markup escaping. 29 | 30 | %if 0%{?with_python3} 31 | %package -n python3-markupsafe 32 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 33 | Group: Development/Languages 34 | 35 | %description -n python3-markupsafe 36 | A library for safe markup escaping. 37 | %endif #if with_python3 38 | 39 | %prep 40 | %setup -q -n MarkupSafe-%{version} 41 | 42 | %if 0%{?with_python3} 43 | rm -rf %{py3dir} 44 | cp -a . %{py3dir} 45 | 2to3 --write --nobackups %{py3dir} 46 | %endif # with_python3 47 | 48 | %build 49 | CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build 50 | 51 | %if 0%{?with_python3} 52 | pushd %{py3dir} 53 | CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build 54 | popd 55 | %endif # with_python3 56 | 57 | 58 | %install 59 | rm -rf $RPM_BUILD_ROOT 60 | %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT 61 | # C code errantly gets installed 62 | rm $RPM_BUILD_ROOT/%{python_sitearch}/markupsafe/*.c 63 | 64 | %if 0%{?with_python3} 65 | pushd %{py3dir} 66 | %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT 67 | rm $RPM_BUILD_ROOT/%{python3_sitearch}/markupsafe/*.c 68 | popd 69 | %endif # with_python3 70 | 71 | 72 | %check 73 | %{__python} setup.py test 74 | 75 | %if 0%{?with_python3} 76 | pushd %{py3dir} 77 | %{__python3} setup.py test 78 | popd 79 | %endif # with_python3 80 | 81 | %clean 82 | rm -rf $RPM_BUILD_ROOT 83 | 84 | 85 | %files 86 | %defattr(-,root,root,-) 87 | %doc AUTHORS LICENSE README.rst 88 | %{python_sitearch}/* 89 | 90 | %if 0%{?with_python3} 91 | %files -n python3-markupsafe 92 | %defattr(-,root,root,-) 93 | %doc AUTHORS LICENSE README.rst 94 | %{python3_sitearch}/* 95 | %endif # with_python3 96 | 97 | 98 | %changelog 99 | * Mon Jan 7 2019 Ondrej Famera - 0.23-1 100 | - bump version to 0.23 - no changes to spec file since previous version 101 | 102 | * Fri Jan 24 2014 Daniel Mach - 0.11-10 103 | - Mass rebuild 2014-01-24 104 | 105 | * Fri Dec 27 2013 Daniel Mach - 0.11-9 106 | - Mass rebuild 2013-12-27 107 | 108 | * Thu Feb 14 2013 Fedora Release Engineering - 0.11-8 109 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 110 | 111 | * Sat Aug 04 2012 David Malcolm - 0.11-7 112 | - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 113 | 114 | * Fri Aug 3 2012 David Malcolm - 0.11-6 115 | - remove rhel logic from with_python3 conditional 116 | 117 | * Sat Jul 21 2012 Fedora Release Engineering - 0.11-5 118 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 119 | 120 | * Sat Jan 14 2012 Fedora Release Engineering - 0.11-4 121 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 122 | 123 | * Tue Feb 08 2011 Fedora Release Engineering - 0.11-3 124 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 125 | 126 | * Wed Dec 29 2010 David Malcolm - 0.11-2 127 | - rebuild for newer python3 128 | 129 | * Thu Sep 30 2010 Luke Macken - 0.11-1 130 | - Update to 0.11 131 | 132 | * Wed Aug 25 2010 Thomas Spura - 0.9.2-5 133 | - rebuild with python3.2 134 | http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html 135 | 136 | * Fri Jul 23 2010 David Malcolm - 0.9.2-4 137 | - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild 138 | 139 | * Thu Jun 24 2010 Kyle VanderBeek - 0.9.2-3 140 | - Fix missing setuptools BuildRequires. 141 | 142 | * Thu Jun 24 2010 Kyle VanderBeek - 0.9.2-2 143 | - Fixed sitearch and python3 definitions to work better with older Fedora/RHEL. 144 | 145 | * Wed Jun 23 2010 Kyle VanderBeek - 0.9.2-1 146 | - Initial version. 147 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # use local installation media instead of configured repositories (CentOS only) 3 | use_local_media: false 4 | 5 | # user used for authorizing cluster nodes 6 | cluster_user: hacluster 7 | cluster_user_pass: testtest 8 | # group to which cluster user belongs (should be 'haclient') 9 | cluster_group: haclient 10 | 11 | # name of the cluster 12 | cluster_name: pacemaker 13 | 14 | # configuration of firewall for clustering, NOTE in RHEL/Centos 6 this replaces iptables configuration file! 15 | cluster_firewall: true 16 | 17 | # enable cluster on boot on normal (not pacemaker_remote) nodes 18 | cluster_enable_service: true 19 | 20 | # configure cluster with fence_xvm fencing device ? 21 | # this will copy key defined by 'fence_xvm_key' to nodes and add fencing devices to cluster 22 | # NOTE: you need to define 'vm_name' in the inventory for each cluster node 23 | cluster_configure_fence_xvm: true 24 | 25 | # location of the fence_xvm.key file 26 | fence_xvm_key: '/etc/cluster/fence_xvm.key' 27 | 28 | # configure cluster with fence_kdump fencing device ? 29 | cluster_configure_fence_kdump: false 30 | 31 | # configure cluster with fence_vmware_soap/fence_vmware_rest fencing device? 32 | # You must provide IP/hostname of vCenter/hypervisor and username/password that is able to start/stop VMs for this cluster 33 | cluster_configure_fence_vmware_soap: false 34 | cluster_configure_fence_vmware_rest: false 35 | # fence_vmware_ipaddr: '' 36 | # fence_vmware_login: '' 37 | # fence_vmware_passwd: '' 38 | 39 | # by default we use encrypted configuration (ssl=1) without validating certificates (ssl_insecure=1) 40 | fence_vmware_options: 'ssl="1" ssl_insecure="1"' 41 | # NOTE: Only one of fence_vmware_soap/fence_vmware_rest can be configured as stonith devices share same name. 42 | 43 | # configure cluster with fence_aws fencing device? 44 | # You must provide AWS region and configure Instance Profile (in AWS) that is able to start/stop instances for this cluster 45 | # NOTE: you need to define 'instance_id' in the inventory for each cluster node 46 | cluster_configure_fence_aws: false 47 | # fence_aws_region: '' 48 | 49 | # aws fence device options variable allows to define additional options for fence_aws devices. 50 | # For example of some used options check documents below. 51 | # https://access.redhat.com/articles/4175371#create-stonith 52 | # https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-resources-1.html 53 | fence_aws_options: '' 54 | 55 | # custom fence device configuration variable which allows you to define your own fence devices 56 | # for proper options check examples below 57 | # 58 | # cluster_fence_config: 59 | # fence_device_1: 60 | # fence_type: 'fence_vmware_soap' 61 | # fence_options: 'pcmk_host_map="fastvm-1:vm_name_on_hypevisor1" ipaddr="vcenter.hostname" login="root" passwd="testest" ssl="1" ssl_insecure="1" op monitor interval=30s' 62 | # fence_device_2: 63 | # fence_type: 'fence_xvm' 64 | # fence_options: 'pcmk_host_map="fastvm-2:vm_name_n_hypervisor2" op monitor interval=30s' 65 | 66 | # How to map fence devices to cluster nodes? 67 | # by default for every cluster node a separate stonith devices is created ('one-device-per-node'). 68 | # Some fence agents can fence multiple nodes using same stonith device ('one-device-per-cluster') 69 | # and can have trouble when using multiple devices due to same user login count limits. 70 | # available options: 71 | # - 'one-device-per-node' - (default) - one stonith device per cluster node is created 72 | # - 'one-device-per-cluster' - (on supported fence agents) - only one cluster-wide stonith device is created for all nodes, supported fence agents: 'fence_vmware_rest', 'fence_vmware_soap', 'fence_xvm', 'fence_kdump' 73 | cluster_configure_stonith_style: 'one-device-per-node' 74 | 75 | # (RHEL only) enable repositories(channels) containing the packages needed. 76 | # by default only High Availability is enabled 77 | # E4S repositories are High Availability only 78 | enable_repos: true 79 | enable_eus_repos: false 80 | enable_e4s_repos: false 81 | enable_beta_repos: false 82 | 83 | # (RHEL only) repos_type: 84 | # - ha - High Availability channel 85 | # - rs - Resilient Storage channel 86 | repos_type: 'ha' 87 | 88 | # (RHEL only) custom_repository 89 | # Enable custom arbitrary repository with needed packages 90 | # custom_repository: '' 91 | 92 | # Enable/Disable PCSD web GUI 93 | # available options are: 94 | # 'nochange' (default) - don't change the PCSD GUI settings 95 | # true - enable PCSD GUI 96 | # false - disable PCSD GUI 97 | enable_pcsd_gui: 'nochange' 98 | 99 | # Cluster transport protocol 100 | # avaialble options: 101 | # 'default' (default) - use the OS default for cluster transport 102 | # 'udp' - UDP multicast 103 | # 'udpu' - UDP unicast 104 | cluster_transport: 'default' 105 | 106 | # Allow adding nodes to existing cluster 107 | allow_cluster_expansion: false 108 | 109 | # Cluster network interface. If specified the role will map hosts to IPv4 addresses from this interface. 110 | # By default the IPv4 addresses from `ansible_default_ipv4` are used. For exmaple to use IPv4 addresses 111 | # from interface `ens8` use `cluster_net_iface: 'ens8'`. Interface must exists on all cluster nodes. 112 | cluster_net_iface: '' 113 | 114 | # Redundant network interface. If specified the role will setup a corosync redundant ring using the default IPv4 from this interface. 115 | # Interface must exist on all cluster nodes. 116 | rrp_interface: '' 117 | 118 | # Whether to add hosts to /etc/hosts. 119 | cluster_etc_hosts: true 120 | 121 | # Which Ansible fact to use as the hostname of cluster nodes. 122 | cluster_hostname_fact: "ansible_hostname" 123 | 124 | # Whether the node should be setup as a remote pacemaker node. 125 | cluster_node_is_remote: false 126 | 127 | # Ordered list of variables for detecting primary cluster IP (ring0) 128 | ring0_ip_ordered_detection_list: 129 | - "{{ hostvars[inventory_hostname]['ansible_' + cluster_net_iface].ipv4.address | default('') }}" 130 | - "{{ ansible_default_ipv4.address | default('') }}" 131 | - "{{ ansible_all_ipv4_addresses[0] | default('') }}" 132 | -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Generate random ID for this cluster deployment 3 | set_fact: 4 | rand_id: "{{ 1024 | random }}" 5 | run_once: true 6 | changed_when: false 7 | check_mode: false 8 | # This ID is used for ansible group names grouping machines from this run of role. 9 | # If this role is run multiple times in single playbook with different hosts this 10 | # ID will distinguish these different hosts 11 | # FIXME: this is workaround for inability to "remove things from groups" 12 | 13 | - name: Add a group to the inventory for remote nodes 14 | changed_when: false 15 | group_by: 16 | key: "cluster{{ rand_id }}_node_is_remote_{{ cluster_node_is_remote | bool }}" 17 | 18 | - name: Check if cluster consist of at least 2 nodes 19 | fail: 20 | msg: 'Cluster must have at least 2 full members' 21 | when: groups['cluster'+rand_id+'_node_is_remote_False']|default([])|count() < 2 22 | run_once: true 23 | 24 | - name: Check if cluster_user_pass is not default 25 | assert: 26 | that: 27 | - cluster_user_pass != 'testtest' 28 | fail_msg: 'It is strongly recommended to define a password' 29 | ignore_errors: true 30 | run_once: true 31 | 32 | - name: Include distribution version specific variables 33 | include_vars: "{{ item }}" 34 | with_first_found: 35 | - "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 36 | - "{{ ansible_distribution_file_variety | lower }}{{ ansible_distribution_major_version }}.yml" 37 | 38 | - name: Include distribution specific repository configuration 39 | include_tasks: "{{ item }}" 40 | with_first_found: 41 | - files: 42 | - "{{ ansible_distribution | lower }}_repos.yml" 43 | skip: true 44 | 45 | - name: Install packages from local media 46 | include_tasks: install_local_media.yml 47 | when: use_local_media|bool 48 | 49 | - name: Install packages from system defined repositories 50 | include_tasks: install_normal.yml 51 | when: not use_local_media|bool 52 | 53 | - name: Include distribution specific tasks 54 | include_tasks: "{{ item }}" 55 | with_first_found: 56 | - files: 57 | - "{{ ansible_distribution | lower }}_tasks.yml" 58 | skip: true 59 | 60 | - name: Detect the primary (ring0) cluster IP on all nodes 61 | set_fact: 62 | ring0_ip: "{{ item }}" 63 | loop: "{{ ring0_ip_ordered_detection_list }}" 64 | when: ring0_ip|default('')|count() == 0 65 | # NOTE: first detected IP from given list of possibilities is being used for given node 66 | 67 | - name: Verify that we were able to detect primary (ring0) cluster IP on all nodes 68 | fail: 69 | msg: "Unable to determine ring0 IP address on node {{ inventory_hostname }}. Try setting 'cluster_net_iface' for this node to give it hint where to look for cluster ip." 70 | when: ring0_ip|count() == 0 71 | 72 | # WARNING: the hostname is resolved from /etc/hosts file! If you change hostname 73 | # of machine through /etc/hosts the ansible will pick it up and use it! 74 | - name: Add hosts to /etc/hosts 75 | lineinfile: 76 | dest: '/etc/hosts' 77 | regexp: "{{ hostvars[item]['ring0_ip'] }} " 78 | line: > 79 | {{ hostvars[item]['ring0_ip'] }} 80 | {{ hostvars[item][cluster_hostname_fact] }} 81 | mode: '0644' 82 | with_items: "{{ play_hosts }}" 83 | when: 84 | - cluster_etc_hosts | bool 85 | 86 | - name: Create cluster system group 87 | group: 88 | name: "{{ cluster_group }}" 89 | state: 'present' 90 | 91 | - name: Create cluster system user 92 | user: 93 | name: "{{ cluster_user }}" 94 | state: 'present' 95 | password: >- 96 | {{ cluster_user_pass | 97 | password_hash('sha512', ansible_hostname | replace('-', 'x') | 98 | truncate(16, True, '', 0)) }} 99 | groups: "{{ cluster_group }}" 100 | comment: 'HA Cluster Administrator' 101 | 102 | - name: Enable/Disable PCSD web GUI 103 | lineinfile: 104 | dest: "{{ pcsd_configuration_file }}" 105 | regexp: 'PCSD_DISABLE_GUI=.*' 106 | line: "PCSD_DISABLE_GUI={{ enable_pcsd_gui | bool | ternary('false', 'true') }}" 107 | mode: '0644' 108 | when: enable_pcsd_gui != 'nochange' 109 | 110 | - name: Enable and start PCSD service 111 | service: 112 | name: 'pcsd' 113 | enabled: true 114 | state: 'started' 115 | 116 | - name: (Debian 11) Enable and start PCSD-ruby service 117 | service: 118 | name: 'pcsd-ruby' 119 | enabled: true 120 | state: 'started' 121 | when: 122 | - ansible_distribution|lower == 'debian' 123 | - ansible_distribution_major_version == '11' 124 | 125 | - name: Setup firewall 126 | include_tasks: "firewall.yml" 127 | when: cluster_firewall|bool 128 | 129 | - name: Authorize cluster nodes 130 | pcs_auth: 131 | node_name: "{{ hostvars[item][cluster_hostname_fact] }}" 132 | username: "{{ cluster_user }}" 133 | password: "{{ cluster_user_pass }}" 134 | with_items: "{{ play_hosts }}" 135 | when: not cluster_node_is_remote | bool 136 | 137 | - name: Set corosync redundant ring node ip if requested (from rrp_interface) 138 | set_fact: 139 | rrp_ip: "{{ hostvars[inventory_hostname]['ansible_' + rrp_interface].ipv4.address }}" 140 | when: 141 | - rrp_ip is not defined 142 | - rrp_interface is defined 143 | - rrp_interface and 'ansible_'+rrp_interface in hostvars[inventory_hostname] 144 | 145 | - name: Validate redundant ring ip 146 | fail: 147 | msg: >- 148 | invalid redundant ip {{ rrp_ip }} for {{ ansible_hostname }}: 149 | must be different than primary ip {{ ring0_ip }} 150 | when: 151 | - rrp_ip is defined 152 | - rrp_ip == ring0_ip 153 | with_items: "{{ play_hosts }}" 154 | run_once: true 155 | delegate_to: 'localhost' 156 | any_errors_fatal: true 157 | 158 | - name: Setup cluster 159 | pcs_cluster: 160 | node_list: >- 161 | {% for item in groups['cluster' + rand_id + '_node_is_remote_False'] %} 162 | {{ hostvars[item][cluster_hostname_fact] }}{% if hostvars[item].rrp_ip is defined %},{{ hostvars[item].rrp_ip }}{% endif %} 163 | {% endfor %} 164 | cluster_name: "{{ cluster_name }}" 165 | transport: "{{ cluster_transport }}" 166 | allowed_node_changes: "{% if allow_cluster_expansion | bool %}add{% else %}none{% endif %}" 167 | run_once: true 168 | 169 | - name: Start cluster services on all nodes 170 | service: 171 | name: "{{ item }}" 172 | state: 'started' 173 | with_items: 174 | - pacemaker 175 | - corosync 176 | when: not cluster_node_is_remote | bool 177 | 178 | - name: Enable cluster services on boot 179 | service: 180 | name: "{{ item }}" 181 | enabled: true 182 | with_items: 183 | - pacemaker 184 | - corosync 185 | when: 186 | - cluster_enable_service | bool 187 | - not cluster_node_is_remote | bool 188 | 189 | - name: Block for adding remote nodes 190 | vars: 191 | delegate_host: "{{ hostvars[groups['cluster' + rand_id + '_node_is_remote_False'][0]].inventory_hostname }}" 192 | # NOTE: Without this, the host's ansible_host variable will not be 193 | # respected when using delegate_to. 194 | ansible_host: "{{ hostvars[delegate_host].ansible_host | default(delegate_host) }}" 195 | when: 196 | - groups['cluster'+rand_id+'_node_is_remote_False'] is defined 197 | - groups['cluster'+rand_id+'_node_is_remote_True']|default([])|count() > 0 198 | delegate_to: "{{ delegate_host }}" 199 | block: 200 | - name: Get pcs status 201 | command: pcs status 202 | run_once: true 203 | changed_when: false 204 | check_mode: false 205 | register: pcs_status 206 | 207 | - name: Add remote node 208 | vars: 209 | cluster_hostname: "{{ hostvars[inventory_hostname][cluster_hostname_fact] }}" 210 | command: pcs cluster node add-remote {{ cluster_hostname }} 211 | changed_when: true 212 | when: 213 | - cluster_node_is_remote | bool 214 | - (pcs_status.stdout | regex_search('\\b' ~ cluster_hostname ~ '\\s+\\(ocf::pacemaker:remote\\)') or '') | length == 0 215 | 216 | ### fencing setup 217 | - name: Setup automatic fence_xvm 218 | include_tasks: fence_xvm.yml 219 | when: cluster_configure_fence_xvm is defined and cluster_configure_fence_xvm|bool 220 | 221 | - name: Setup fence_vmware_soap 222 | include_tasks: fence_vmware_soap.yml 223 | when: cluster_configure_fence_vmware_soap is defined and cluster_configure_fence_vmware_soap|bool 224 | 225 | - name: Setup fence_vmware_rest 226 | include_tasks: fence_vmware_rest.yml 227 | when: cluster_configure_fence_vmware_rest is defined and cluster_configure_fence_vmware_rest|bool 228 | 229 | - name: Setup fence_kdump 230 | include_tasks: fence_kdump.yml 231 | when: cluster_configure_fence_kdump is defined and cluster_configure_fence_kdump|bool 232 | 233 | - name: Setup fence_aws 234 | include_tasks: fence_aws.yml 235 | when: cluster_configure_fence_aws is defined and cluster_configure_fence_aws|bool 236 | 237 | - name: Setup custom fence devices 238 | include_tasks: fence_custom.yml 239 | 240 | ### Cluster configuration setup 241 | - name: Configure cluster properties 242 | include_tasks: cluster_property.yml 243 | when: cluster_property is defined 244 | 245 | - name: Configure cluster resource defaults 246 | include_tasks: cluster_resource_defaults.yml 247 | when: cluster_resource_defaults is defined 248 | 249 | - name: Configure cluster resources 250 | include_tasks: cluster_resource.yml 251 | when: cluster_resource is defined 252 | 253 | - name: Configure cluster order constraints 254 | include_tasks: cluster_constraint_order.yml 255 | when: cluster_constraint_order is defined 256 | 257 | - name: Configure cluster colocation constraints 258 | include_tasks: cluster_constraint_colocation.yml 259 | when: cluster_constraint_colocation is defined 260 | 261 | - name: Configure cluster location constraints 262 | include_tasks: cluster_constraint_location.yml 263 | when: cluster_constraint_location is defined 264 | -------------------------------------------------------------------------------- /ansible-deps-el7/python-jinja2.spec.orig: -------------------------------------------------------------------------------- 1 | %if 0%{?fedora} > 12 2 | %global with_python3 1 3 | %else 4 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} 5 | %endif 6 | 7 | # Enable building without docs to avoid a circular dependency between this 8 | # and python-sphinx: 9 | %global with_docs 1 10 | 11 | Name: python-jinja2 12 | Version: 2.7.2 13 | Release: 2%{?dist} 14 | Summary: General purpose template engine 15 | Group: Development/Languages 16 | License: BSD 17 | URL: http://jinja.pocoo.org/ 18 | Source0: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz 19 | Patch1: %{name}-align-jinjaext-with-compatibility-cleanups.patch 20 | # Patch for CVE-2014-0012, see https://bugzilla.redhat.com/show_bug.cgi?id=1051421 21 | # for discussion (not yet sent upstream) 22 | Patch2: python-jinja2-fix-CVE-2014-0012.patch 23 | BuildArch: noarch 24 | BuildRequires: python-devel 25 | BuildRequires: python-setuptools 26 | BuildRequires: python-markupsafe 27 | %if 0%{?with_docs} 28 | BuildRequires: python-sphinx 29 | %endif # with_docs 30 | Requires: python-babel >= 0.8 31 | Requires: python-markupsafe 32 | %if 0%{?with_python3} 33 | BuildRequires: python3-devel 34 | BuildRequires: python3-setuptools 35 | BuildRequires: python3-markupsafe 36 | %endif # with_python3 37 | 38 | 39 | %description 40 | Jinja2 is a template engine written in pure Python. It provides a 41 | Django inspired non-XML syntax but supports inline expressions and an 42 | optional sandboxed environment. 43 | 44 | If you have any exposure to other text-based template languages, such 45 | as Smarty or Django, you should feel right at home with Jinja2. It's 46 | both designer and developer friendly by sticking to Python's 47 | principles and adding functionality useful for templating 48 | environments. 49 | 50 | 51 | %if 0%{?with_python3} 52 | %package -n python3-jinja2 53 | Summary: General purpose template engine 54 | Group: Development/Languages 55 | Requires: python3-markupsafe 56 | # babel isn't py3k ready yet, and is only a weak dependency 57 | #Requires: python3-babel >= 0.8 58 | 59 | 60 | %description -n python3-jinja2 61 | Jinja2 is a template engine written in pure Python. It provides a 62 | Django inspired non-XML syntax but supports inline expressions and an 63 | optional sandboxed environment. 64 | 65 | If you have any exposure to other text-based template languages, such 66 | as Smarty or Django, you should feel right at home with Jinja2. It's 67 | both designer and developer friendly by sticking to Python's 68 | principles and adding functionality useful for templating 69 | environments. 70 | %endif # with_python3 71 | 72 | 73 | %prep 74 | %setup -q -n Jinja2-%{version} 75 | %patch1 -p1 76 | %patch2 -p1 77 | 78 | # cleanup 79 | find . -name '*.pyo' -o -name '*.pyc' -delete 80 | 81 | # fix EOL 82 | sed -i 's|\r$||g' LICENSE 83 | 84 | %if 0%{?with_python3} 85 | cp -a . %{py3dir} 86 | %endif # with_python3 87 | 88 | 89 | %build 90 | %{__python} setup.py build 91 | 92 | # for now, we build docs using Python 2.x and use that for both 93 | # packages. 94 | %if 0%{?with_docs} 95 | make -C docs html PYTHONPATH=$(pwd) 96 | %endif # with_docs 97 | 98 | %if 0%{?with_python3} 99 | pushd %{py3dir} 100 | %{__python3} setup.py build 101 | popd 102 | %endif # with_python3 103 | 104 | 105 | %install 106 | %{__python} setup.py install -O1 --skip-build \ 107 | --root %{buildroot} 108 | 109 | # remove hidden file 110 | rm -rf docs/_build/html/.buildinfo 111 | 112 | %if 0%{?with_python3} 113 | pushd %{py3dir} 114 | %{__python3} setup.py install -O1 --skip-build \ 115 | --root %{buildroot} 116 | popd 117 | %endif # with_python3 118 | 119 | 120 | %check 121 | make test 122 | 123 | 124 | %if 0%{?with_python3} 125 | pushd %{py3dir} 126 | make test 127 | popd 128 | %endif # with_python3 129 | 130 | 131 | %files 132 | %doc AUTHORS CHANGES LICENSE 133 | %if 0%{?with_docs} 134 | %doc docs/_build/html 135 | %endif # with_docs 136 | %doc ext 137 | %doc examples 138 | %{python_sitelib}/* 139 | %exclude %{python_sitelib}/jinja2/_debugsupport.c 140 | 141 | 142 | %if 0%{?with_python3} 143 | %files -n python3-jinja2 144 | %doc AUTHORS CHANGES LICENSE 145 | %if 0%{?with_docs} 146 | %doc docs/_build/html 147 | %endif # with_docs 148 | %doc ext 149 | %doc examples 150 | %{python3_sitelib}/* 151 | %exclude %{python3_sitelib}/jinja2/_debugsupport.c 152 | %endif # with_python3 153 | 154 | 155 | %changelog 156 | * Tue Jan 28 2014 Bohuslav Kabrda - 2.7.2-2 157 | - Fix CVE-2014-0012. 158 | Resolves: rhbz#1051427 159 | 160 | * Wed Jan 15 2014 Bohuslav Kabrda - 2.7.2-1 161 | - Reverted flawed patch for #1051427 (this reintroduces #1052102). 162 | - Spec cleanup (removed rhel < 7 specific stuff). 163 | - Update to 2.7.2. 164 | Resolves: rhbz#1052777 165 | 166 | * Tue Jan 14 2014 Tomas Radej - 2.6-8 167 | - Using secure tmp dir 168 | - Replaced tabs with spaces 169 | Resolves: rhbz#1051427 170 | 171 | * Fri Dec 27 2013 Daniel Mach - 2.6-7 172 | - Mass rebuild 2013-12-27 173 | 174 | * Thu Feb 14 2013 Fedora Release Engineering - 2.6-6 175 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 176 | 177 | * Sat Aug 04 2012 David Malcolm - 2.6-5 178 | - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 179 | 180 | * Fri Aug 3 2012 David Malcolm - 2.6-4 181 | - remove rhel logic from with_python3 conditional 182 | 183 | * Sat Jul 21 2012 Fedora Release Engineering - 2.6-3 184 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 185 | 186 | * Sat Jan 14 2012 Fedora Release Engineering - 2.6-2 187 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 188 | 189 | * Mon Jul 25 2011 Thomas Moschny - 2.6-1 190 | - Update to 2.6. 191 | 192 | * Tue Feb 08 2011 Fedora Release Engineering - 2.5.5-4 193 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 194 | 195 | * Tue Jan 18 2011 Thomas Moschny - 2.5.5-3 196 | - Re-enable html doc generation. 197 | - Remove conditional for F-12 and below. 198 | - Do not silently fail the testsuite for with py3k. 199 | 200 | * Mon Nov 1 2010 Michel Salim - 2.5.5-2 201 | - Move python3 runtime requirements to python3 subpackage 202 | 203 | * Wed Oct 27 2010 Thomas Moschny - 2.5.5-1 204 | - Update to 2.5.5. 205 | 206 | * Wed Aug 25 2010 Thomas Moschny - 2.5.2-4 207 | - Revert to previous behavior: fail the build on failed test. 208 | - Rebuild for Python 3.2. 209 | 210 | * Wed Aug 25 2010 Dan Horák - 2.5.2-3 211 | - %%ifnarch doesn't work on noarch package so don't fail the build on failed tests 212 | 213 | * Wed Aug 25 2010 Dan Horák - 2.5.2-2 214 | - disable the testsuite on s390(x) 215 | 216 | * Thu Aug 19 2010 Thomas Moschny - 2.5.2-1 217 | - Update to upstream version 2.5.2. 218 | - Package depends on python-markupsafe and is noarch now. 219 | 220 | * Thu Jul 22 2010 David Malcolm - 2.5-4 221 | - add explicit build-requirement on python-setuptools 222 | - fix doc disablement for python3 subpackage 223 | 224 | * Thu Jul 22 2010 David Malcolm - 2.5-3 225 | - support disabling documentation in the build to break a circular build-time 226 | dependency with python-sphinx; disable docs for now 227 | 228 | * Thu Jul 22 2010 David Malcolm - 2.5-2 229 | - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild 230 | 231 | * Tue Jul 13 2010 Thomas Moschny - 2.5-1 232 | - Update to upstream version 2.5. 233 | - Create python3 subpackage. 234 | - Minor specfile fixes. 235 | - Add examples directory. 236 | - Thanks to Gareth Armstrong for additional hints. 237 | 238 | * Wed Apr 21 2010 Thomas Moschny - 2.4.1-1 239 | - Update to 2.4.1. 240 | 241 | * Tue Apr 13 2010 Thomas Moschny - 2.4-1 242 | - Update to 2.4. 243 | 244 | * Tue Feb 23 2010 Thomas Moschny - 2.3.1-1 245 | - Update to 2.3.1. 246 | - Docs are built using Sphinx now. 247 | - Run the testsuite. 248 | 249 | * Sat Sep 19 2009 Thomas Moschny - 2.2.1-1 250 | - Update to 2.2.1, mainly a bugfix release. 251 | - Remove patch no longer needed. 252 | - Remove conditional for FC-8. 253 | - Compilation of speedup module has to be explicitly requested now. 254 | 255 | * Sun Jul 26 2009 Fedora Release Engineering - 2.1.1-3 256 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild 257 | 258 | * Thu Feb 26 2009 Fedora Release Engineering - 2.1.1-2 259 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 260 | 261 | * Sat Jan 10 2009 Thomas Moschny - 2.1.1-1 262 | - Update to 2.1.1 (bugfix release). 263 | 264 | * Thu Dec 18 2008 Thomas Moschny - 2.1-1 265 | - Update to 2.1, which fixes a number of bugs. 266 | See http://jinja.pocoo.org/2/documentation/changelog#version-2-1. 267 | 268 | * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.0-3 269 | - Rebuild for Python 2.6 270 | 271 | * Tue Jul 22 2008 Thomas Moschny - 2.0-2 272 | - Use rpm buildroot macro instead of RPM_BUILD_ROOT. 273 | 274 | * Sun Jul 20 2008 Thomas Moschny - 2.0-1 275 | - Upstream released 2.0. 276 | 277 | * Sun Jun 29 2008 Thomas Moschny - 2.0-0.1.rc1 278 | - Modified specfile from the existing python-jinja package. 279 | -------------------------------------------------------------------------------- /ansible-deps-el7/python-jinja2.spec: -------------------------------------------------------------------------------- 1 | %if 0%{?fedora} > 12 2 | %global with_python3 1 3 | %else 4 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} 5 | %endif 6 | 7 | # Enable building without docs to avoid a circular dependency between this 8 | # and python-sphinx: 9 | %global with_docs 1 10 | 11 | Name: python-jinja2 12 | Version: 2.9.6 13 | Release: 1.el7 14 | Summary: General purpose template engine 15 | Group: Development/Languages 16 | License: BSD 17 | URL: http://jinja.pocoo.org/ 18 | Source0: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz 19 | BuildArch: noarch 20 | BuildRequires: python-devel 21 | BuildRequires: python-setuptools 22 | BuildRequires: python-markupsafe >= 0.23 23 | %if 0%{?with_docs} 24 | BuildRequires: python-sphinx 25 | %endif # with_docs 26 | Requires: python-babel >= 0.8 27 | Requires: python-markupsafe >= 0.23 28 | %if 0%{?with_python3} 29 | BuildRequires: python3-devel 30 | BuildRequires: python3-setuptools 31 | BuildRequires: python3-markupsafe 32 | %endif # with_python3 33 | 34 | 35 | %description 36 | Jinja2 is a template engine written in pure Python. It provides a 37 | Django inspired non-XML syntax but supports inline expressions and an 38 | optional sandboxed environment. 39 | 40 | If you have any exposure to other text-based template languages, such 41 | as Smarty or Django, you should feel right at home with Jinja2. It's 42 | both designer and developer friendly by sticking to Python's 43 | principles and adding functionality useful for templating 44 | environments. 45 | 46 | 47 | %if 0%{?with_python3} 48 | %package -n python3-jinja2 49 | Summary: General purpose template engine 50 | Group: Development/Languages 51 | Requires: python3-markupsafe 52 | # babel isn't py3k ready yet, and is only a weak dependency 53 | #Requires: python3-babel >= 0.8 54 | 55 | 56 | %description -n python3-jinja2 57 | Jinja2 is a template engine written in pure Python. It provides a 58 | Django inspired non-XML syntax but supports inline expressions and an 59 | optional sandboxed environment. 60 | 61 | If you have any exposure to other text-based template languages, such 62 | as Smarty or Django, you should feel right at home with Jinja2. It's 63 | both designer and developer friendly by sticking to Python's 64 | principles and adding functionality useful for templating 65 | environments. 66 | %endif # with_python3 67 | 68 | 69 | %prep 70 | %setup -q -n Jinja2-%{version} 71 | 72 | # cleanup 73 | find . -name '*.pyo' -o -name '*.pyc' -delete 74 | 75 | # fix EOL 76 | sed -i 's|\r$||g' LICENSE 77 | 78 | %if 0%{?with_python3} 79 | cp -a . %{py3dir} 80 | %endif # with_python3 81 | 82 | 83 | %build 84 | %{__python} setup.py build 85 | 86 | # for now, we build docs using Python 2.x and use that for both 87 | # packages. 88 | %if 0%{?with_docs} 89 | make -C docs html PYTHONPATH=$(pwd) 90 | %endif # with_docs 91 | 92 | %if 0%{?with_python3} 93 | pushd %{py3dir} 94 | %{__python3} setup.py build 95 | popd 96 | %endif # with_python3 97 | 98 | 99 | %install 100 | %{__python} setup.py install -O1 --skip-build \ 101 | --root %{buildroot} 102 | 103 | # these files are valid only on Python 3.6+ 104 | rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py 105 | rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py 106 | 107 | # remove hidden file 108 | rm -rf docs/_build/html/.buildinfo 109 | 110 | %if 0%{?with_python3} 111 | pushd %{py3dir} 112 | %{__python3} setup.py install -O1 --skip-build \ 113 | --root %{buildroot} 114 | popd 115 | %endif # with_python3 116 | 117 | 118 | %check 119 | 120 | 121 | %if 0%{?with_python3} 122 | pushd %{py3dir} 123 | make test 124 | popd 125 | %endif # with_python3 126 | 127 | 128 | %files 129 | %doc AUTHORS CHANGES LICENSE 130 | %if 0%{?with_docs} 131 | %doc docs/_build/html 132 | %endif # with_docs 133 | %doc ext 134 | %doc examples 135 | %{python_sitelib}/* 136 | %exclude %{python_sitelib}/jinja2/_debugsupport.c 137 | 138 | 139 | %if 0%{?with_python3} 140 | %files -n python3-jinja2 141 | %doc AUTHORS CHANGES LICENSE 142 | %if 0%{?with_docs} 143 | %doc docs/_build/html 144 | %endif # with_docs 145 | %doc ext 146 | %doc examples 147 | %{python3_sitelib}/* 148 | %exclude %{python3_sitelib}/jinja2/_debugsupport.c 149 | %endif # with_python3 150 | 151 | 152 | %changelog 153 | * Mon Jan 7 2019 Ondrej Famera - 2.9.6-1 154 | - bump to version 2.9.6 155 | - remove CVE patch that is already upstream 156 | - remove other patch that prevents build from working 157 | - remove tests section as there are no tests 158 | - remove file specific to python3 as this will be build only for python2 159 | - make dependent on python-markupsafe 0.23 or newer 160 | 161 | * Tue Jan 28 2014 Bohuslav Kabrda - 2.7.2-2 162 | - Fix CVE-2014-0012. 163 | Resolves: rhbz#1051427 164 | 165 | * Wed Jan 15 2014 Bohuslav Kabrda - 2.7.2-1 166 | - Reverted flawed patch for #1051427 (this reintroduces #1052102). 167 | - Spec cleanup (removed rhel < 7 specific stuff). 168 | - Update to 2.7.2. 169 | Resolves: rhbz#1052777 170 | 171 | * Tue Jan 14 2014 Tomas Radej - 2.6-8 172 | - Using secure tmp dir 173 | - Replaced tabs with spaces 174 | Resolves: rhbz#1051427 175 | 176 | * Fri Dec 27 2013 Daniel Mach - 2.6-7 177 | - Mass rebuild 2013-12-27 178 | 179 | * Thu Feb 14 2013 Fedora Release Engineering - 2.6-6 180 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 181 | 182 | * Sat Aug 04 2012 David Malcolm - 2.6-5 183 | - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 184 | 185 | * Fri Aug 3 2012 David Malcolm - 2.6-4 186 | - remove rhel logic from with_python3 conditional 187 | 188 | * Sat Jul 21 2012 Fedora Release Engineering - 2.6-3 189 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 190 | 191 | * Sat Jan 14 2012 Fedora Release Engineering - 2.6-2 192 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 193 | 194 | * Mon Jul 25 2011 Thomas Moschny - 2.6-1 195 | - Update to 2.6. 196 | 197 | * Tue Feb 08 2011 Fedora Release Engineering - 2.5.5-4 198 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 199 | 200 | * Tue Jan 18 2011 Thomas Moschny - 2.5.5-3 201 | - Re-enable html doc generation. 202 | - Remove conditional for F-12 and below. 203 | - Do not silently fail the testsuite for with py3k. 204 | 205 | * Mon Nov 1 2010 Michel Salim - 2.5.5-2 206 | - Move python3 runtime requirements to python3 subpackage 207 | 208 | * Wed Oct 27 2010 Thomas Moschny - 2.5.5-1 209 | - Update to 2.5.5. 210 | 211 | * Wed Aug 25 2010 Thomas Moschny - 2.5.2-4 212 | - Revert to previous behavior: fail the build on failed test. 213 | - Rebuild for Python 3.2. 214 | 215 | * Wed Aug 25 2010 Dan Horák - 2.5.2-3 216 | - %%ifnarch doesn't work on noarch package so don't fail the build on failed tests 217 | 218 | * Wed Aug 25 2010 Dan Horák - 2.5.2-2 219 | - disable the testsuite on s390(x) 220 | 221 | * Thu Aug 19 2010 Thomas Moschny - 2.5.2-1 222 | - Update to upstream version 2.5.2. 223 | - Package depends on python-markupsafe and is noarch now. 224 | 225 | * Thu Jul 22 2010 David Malcolm - 2.5-4 226 | - add explicit build-requirement on python-setuptools 227 | - fix doc disablement for python3 subpackage 228 | 229 | * Thu Jul 22 2010 David Malcolm - 2.5-3 230 | - support disabling documentation in the build to break a circular build-time 231 | dependency with python-sphinx; disable docs for now 232 | 233 | * Thu Jul 22 2010 David Malcolm - 2.5-2 234 | - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild 235 | 236 | * Tue Jul 13 2010 Thomas Moschny - 2.5-1 237 | - Update to upstream version 2.5. 238 | - Create python3 subpackage. 239 | - Minor specfile fixes. 240 | - Add examples directory. 241 | - Thanks to Gareth Armstrong for additional hints. 242 | 243 | * Wed Apr 21 2010 Thomas Moschny - 2.4.1-1 244 | - Update to 2.4.1. 245 | 246 | * Tue Apr 13 2010 Thomas Moschny - 2.4-1 247 | - Update to 2.4. 248 | 249 | * Tue Feb 23 2010 Thomas Moschny - 2.3.1-1 250 | - Update to 2.3.1. 251 | - Docs are built using Sphinx now. 252 | - Run the testsuite. 253 | 254 | * Sat Sep 19 2009 Thomas Moschny - 2.2.1-1 255 | - Update to 2.2.1, mainly a bugfix release. 256 | - Remove patch no longer needed. 257 | - Remove conditional for FC-8. 258 | - Compilation of speedup module has to be explicitly requested now. 259 | 260 | * Sun Jul 26 2009 Fedora Release Engineering - 2.1.1-3 261 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild 262 | 263 | * Thu Feb 26 2009 Fedora Release Engineering - 2.1.1-2 264 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 265 | 266 | * Sat Jan 10 2009 Thomas Moschny - 2.1.1-1 267 | - Update to 2.1.1 (bugfix release). 268 | 269 | * Thu Dec 18 2008 Thomas Moschny - 2.1-1 270 | - Update to 2.1, which fixes a number of bugs. 271 | See http://jinja.pocoo.org/2/documentation/changelog#version-2-1. 272 | 273 | * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.0-3 274 | - Rebuild for Python 2.6 275 | 276 | * Tue Jul 22 2008 Thomas Moschny - 2.0-2 277 | - Use rpm buildroot macro instead of RPM_BUILD_ROOT. 278 | 279 | * Sun Jul 20 2008 Thomas Moschny - 2.0-1 280 | - Upstream released 2.0. 281 | 282 | * Sun Jun 29 2008 Thomas Moschny - 2.0-0.1.rc1 283 | - Modified specfile from the existing python-jinja package. 284 | -------------------------------------------------------------------------------- /videos/default_playbook-recording: -------------------------------------------------------------------------------- 1 | {"version": 2, "width": 124, "height": 32, "timestamp": 1529932666, "env": {"SHELL": "/bin/bash", "TERM": "rxvt-unicode"}} 2 | [1.105326, "o", "[user@examples ~]$ cat /etc/redhat-release\r\n"] 3 | [1.109722, "o", "CentOS Linux release 7.5.1804 (Core) \r\n"] 4 | [2.114748, "o", "[user@examples ~]$ ansible --version\r\n"] 5 | [4.740177, "o", "ansible 2.4.2.0\r\n config file = /etc/ansible/ansible.cfg\r\n configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n ansible python module location = /usr/lib/python2.7/site-packages/ansible\r\n executable location = /usr/bin/ansible\r\n python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\r\n"] 6 | [5.803477, "o", "[user@examples ~]$ cat our_environment\r\n"] 7 | [5.811975, "o", "============================================================ \r\nKVM running 2 VMs with following configuration. \r\nKey for fence_xvm is located at /etc/cluster/fence_xvm.key \r\non machine from which we run ansible. \r\nVM-1: \r\n IP address: 192.168.34.41 \r\n VM name: fastvm-centos-7.5-41 (as seen by hypervisor) \r\n VM hostname: fastvm-centos-7-5-41 \r\nVM-2: "] 8 | [5.812307, "o", "\r\n IP address: 192.168.34.42 \r\n VM name: fastvm-centos-7.5-42 (as seen by hypervisor) \r\n VM hostname: fastvm-centos-7-5-42 \r\n============================================================ \r\n"] 9 | [9.819228, "o", "[user@examples ~]$ ls -l /etc/cluster/fence_xvm.key\r\n"] 10 | [9.833173, "o", "-rw-r--r--. 1 root root 4096 Jun 25 15:12 /etc/cluster/fence_xvm.key\r\n"] 11 | [11.842688, "o", "[user@examples ~]$ ansible-galaxy install OndrejHome.ha-cluster-pacemaker -p roles\r\n"] 12 | [12.667232, "o", "- downloading role 'ha-cluster-pacemaker', owned by OndrejHome\r\n"] 13 | [13.807189, "o", "- downloading role from https://github.com/OndrejHome/ansible.ha-cluster-pacemaker/archive/v15.tar.gz\r\n"] 14 | [14.468009, "o", "- extracting OndrejHome.ha-cluster-pacemaker to /home/user/roles/OndrejHome.ha-cluster-pacemaker\r\n"] 15 | [14.492373, "o", "- OndrejHome.ha-cluster-pacemaker (v15) was installed successfully\r\n"] 16 | [14.493324, "o", "- adding dependency: OndrejHome.pcs-modules-2\r\n"] 17 | [15.420988, "o", "- downloading role 'pcs-modules-2', owned by OndrejHome\r\n"] 18 | [16.377292, "o", "- downloading role from https://github.com/OndrejHome/ansible.pcs-modules-2/archive/v13.tar.gz\r\n"] 19 | [18.945433, "o", "- extracting OndrejHome.pcs-modules-2 to /home/user/roles/OndrejHome.pcs-modules-2\r\n"] 20 | [18.972915, "o", "- OndrejHome.pcs-modules-2 (v13) was installed successfully\r\n"] 21 | [19.055642, "o", "[user@examples ~]$ cat hosts-default\r\n"] 22 | [19.063637, "o", "[servers] \r\n192.168.34.41 vm_name=fastvm-centos-7.5-41 \r\n192.168.34.42 vm_name=fastvm-centos-7.5-42 \r\n"] 23 | [20.07059, "o", "[user@examples ~]$ cat playbook-default.yml\r\n"] 24 | [20.076604, "o", "--- \r\n- hosts: servers \r\n remote_user: root \r\n roles: \r\n - { role: OndrejHome.ha-cluster-pacemaker } \r\n"] 25 | [22.084328, "o", "[user@examples ~]$ ansible-playbook -i hosts-default playbook-default.yml\r\n"] 26 | [25.793896, "o", "\r\nPLAY [servers] *****************************************************************\r\n"] 27 | [25.844199, "o", "\r\nTASK [Gathering Facts] *********************************************************\r\n"] 28 | [26.306189, "o", "ok: [192.168.34.42]\r\n"] 29 | [26.345404, "o", "ok: [192.168.34.41]\r\n"] 30 | [26.372405, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Check if cluster consist of at least 2 nodes] ***\r\n"] 31 | [26.424292, "o", "skipping: [192.168.34.41]\r\n"] 32 | [26.454945, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Include distribution version specific variables] ***\r\n"] 33 | [26.582341, "o", "ok: [192.168.34.41]\r\n"] 34 | [26.623717, "o", "ok: [192.168.34.42]\r\n"] 35 | [26.653601, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : (RHEL only) enable repositories] *******\r\n"] 36 | [26.705898, "o", "skipping: [192.168.34.41]\r\n"] 37 | [26.743818, "o", "skipping: [192.168.34.42]\r\n"] 38 | [26.76875, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install packages from local media] *****\r\n"] 39 | [26.819851, "o", "skipping: [192.168.34.41]\r\n"] 40 | [26.861897, "o", "skipping: [192.168.34.42]\r\n"] 41 | [26.882735, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install packages from system defined repositories] ***\r\n"] 42 | [27.061837, "o", "included: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/install_normal.yml for 192.168.34.41, 192.168.34.42\r\n"] 43 | [27.115846, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install libselinux-python to work with SELinux setting] ***\r\n"] 44 | [29.599684, "o", "ok: [192.168.34.42]\r\n"] 45 | [29.615329, "o", "ok: [192.168.34.41]\r\n"] 46 | [29.647613, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install Pacemaker cluster packages to all nodes] ***\r\n"] 47 | [32.787408, "o", "changed: [192.168.34.42] => (item=[u'fence-agents', u'pcs', u'pacemaker'])\r\n"] 48 | [32.872187, "o", "changed: [192.168.34.41] => (item=[u'fence-agents', u'pcs', u'pacemaker'])\r\n"] 49 | [32.919688, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Add hosts to /etc/hosts] ***************\r\n"] 50 | [34.767164, "o", "changed: [192.168.34.41] => (item=192.168.34.41)\r\n"] 51 | [34.854613, "o", "changed: [192.168.34.42] => (item=192.168.34.41)\r\n"] 52 | [35.829659, "o", "changed: [192.168.34.41] => (item=192.168.34.42)\r\n"] 53 | [35.96175, "o", "changed: [192.168.34.42] => (item=192.168.34.42)\r\n"] 54 | [36.001123, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create cluster system group] ***********\r\n"] 55 | [37.631369, "o", "ok: [192.168.34.42]\r\n"] 56 | [37.649758, "o", "ok: [192.168.34.41]\r\n"] 57 | [37.674777, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create cluster system user] ************\r\n"] 58 | [40.972162, "o", "changed: [192.168.34.42]\r\n"] 59 | [40.987723, "o", "changed: [192.168.34.41]\r\n"] 60 | [41.01193, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable/Disable PCSD web GUI] ***********\r\n"] 61 | [41.072726, "o", "skipping: [192.168.34.41]\r\n"] 62 | [41.104392, "o", "skipping: [192.168.34.42]\r\n"] 63 | [41.135607, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable and start PCSD service] *********\r\n"] 64 | [42.088722, "o", "changed: [192.168.34.41]\r\n"] 65 | [42.160596, "o", "changed: [192.168.34.42]\r\n"] 66 | [42.189084, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup firewall for RHEL/CentOS systems] ***\r\n"] 67 | [42.368096, "o", "included: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/firewall-el7.yml for 192.168.34.41, 192.168.34.42\r\n"] 68 | [42.44184, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable 'high-availability' firewalld service] ***\r\n"] 69 | [43.892457, "o", "changed: [192.168.34.42]\r\n"] 70 | [43.968069, "o", "changed: [192.168.34.41]\r\n"] 71 | [43.994732, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Authorize cluster nodes] ***************\r\n"] 72 | [44.078502, "o", "changed: [192.168.34.42] => (item=192.168.34.41)\r\n"] 73 | [46.712956, "o", "changed: [192.168.34.41] => (item=192.168.34.41)\r\n"] 74 | [47.255245, "o", "changed: [192.168.34.42] => (item=192.168.34.42)\r\n"] 75 | [48.092286, "o", "changed: [192.168.34.41] => (item=192.168.34.42)\r\n"] 76 | [48.119942, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup cluster] *************************\r\n"] 77 | [49.334504, "o", "changed: [192.168.34.41]\r\n"] 78 | [49.36293, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Start cluster services on all nodes] ***\r\n"] 79 | [51.605305, "o", "changed: [192.168.34.41] => (item=pacemaker)\r\n"] 80 | [51.787314, "o", "changed: [192.168.34.42] => (item=pacemaker)\r\n"] 81 | [52.999219, "o", "ok: [192.168.34.41] => (item=corosync)\r\n"] 82 | [53.17053, "o", "ok: [192.168.34.42] => (item=corosync)\r\n"] 83 | [53.225845, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable cluster services on boot] *******\r\n"] 84 | [54.741592, "o", "changed: [192.168.34.41] => (item=pacemaker)\r\n"] 85 | [54.817495, "o", "changed: [192.168.34.42] => (item=pacemaker)\r\n"] 86 | [56.066146, "o", "changed: [192.168.34.41] => (item=corosync)\r\n"] 87 | [56.123481, "o", "changed: [192.168.34.42] => (item=corosync)\r\n"] 88 | [56.164719, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup automatic fence_xvm] *************\r\n"] 89 | [56.379247, "o", "included: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/fence_xvm.yml for 192.168.34.41, 192.168.34.42\r\n"] 90 | [56.461188, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Check if 'vm_name' variable is defined for each node] ***\r\n"] 91 | [56.520234, "o", "skipping: [192.168.34.41]\r\n"] 92 | [56.554136, "o", "skipping: [192.168.34.42]\r\n"] 93 | [56.588094, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create /etc/cluster directory] *********\r\n"] 94 | [58.268148, "o", "changed: [192.168.34.41]\r\n"] 95 | [58.286002, "o", "changed: [192.168.34.42]\r\n"] 96 | [58.312188, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Copy fence_xvm key to all cluster nodes] ***\r\n"] 97 | [59.396255, "o", "changed: [192.168.34.42]\r\n"] 98 | [59.427118, "o", "changed: [192.168.34.41]\r\n"] 99 | [59.448677, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable fence_xvm port(1229/tcp) in firewalld] ***\r\n"] 100 | [60.19059, "o", "changed: [192.168.34.41]\r\n"] 101 | [60.269638, "o", "changed: [192.168.34.42]\r\n"] 102 | [60.29501, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : create fence_xvm STONITH devices] ******\r\n"] 103 | [61.427358, "o", "changed: [192.168.34.41] => (item=192.168.34.41)\r\n"] 104 | [62.922061, "o", "changed: [192.168.34.41] => (item=192.168.34.42)\r\n"] 105 | [62.961179, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : create fence constraints] **************\r\n"] 106 | [65.979618, "o", "changed: [192.168.34.41] => (item=192.168.34.41)\r\n"] 107 | [68.352157, "o", "changed: [192.168.34.41] => (item=192.168.34.42)\r\n"] 108 | [68.385759, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup fence_kdump] *********************\r\n"] 109 | [68.444663, "o", "skipping: [192.168.34.41]\r\n"] 110 | [68.482063, "o", "skipping: [192.168.34.42]\r\n"] 111 | [68.511057, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup custom fence devices] ************\r\n"] 112 | [68.671236, "o", "included: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/fence_custom.yml for 192.168.34.41, 192.168.34.42\r\n"] 113 | [68.868536, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create custom fence device] ************\r\n"] 114 | [68.92482, "o", "\r\nPLAY RECAP *********************************************************************\r\n192.168.34.41 : ok=22 changed=14 unreachable=0 failed=0 \r\n192.168.34.42 : ok=19 changed=11 unreachable=0 failed=0 \r\n\r\n"] 115 | -------------------------------------------------------------------------------- /videos/default_playbook-fedora29-recording: -------------------------------------------------------------------------------- 1 | {"version": 2, "width": 159, "height": 55, "timestamp": 1549792597, "env": {"SHELL": "/bin/bash", "TERM": "rxvt-unicode"}} 2 | [0.507828, "o", "[user@examples ~]$ cat /etc/redhat-release\r\n"] 3 | [0.509057, "o", "Fedora release 29 (Twenty Nine)\r\n"] 4 | [1.514645, "o", "[user@examples ~]$ ansible --version\r\n"] 5 | [1.900964, "o", "ansible 2.7.5\r\n config file = /etc/ansible/ansible.cfg\r\n configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n ansible python module location = /usr/lib/python3.7/site-packages/ansible\r\n executable location = /usr/bin/ansible\r\n python version = 3.7.2 (default, Jan 16 2019, 19:49:22) [GCC 8.2.1 20181215 (Red Hat 8.2.1-6)]\r\n"] 6 | [2.942172, "o", "[user@examples ~]$ cat our_environment\r\n"] 7 | [2.944023, "o", "============================================================\r\nKVM running 2 VMs with following configuration.\r\nKey for fence_xvm is located at /etc/cluster/fence_xvm.key\r\non machine from which we run ansible.\r\nVM-1:\r\n IP address: 192.168.22.43\r\n VM name: fastvm-fedora29-41 (as seen by hypervisor)\r\n VM hostname: fastvm-fedora29-41\r\nVM-2:\r\n IP address: 192.168.22.44\r\n VM name: fastvm-fedora29-42 (as seen by hypervisor)\r\n VM hostname: fastvm-fedora29-42\r\n============================================================\r\n"] 8 | [4.948177, "o", "[user@examples ~]$ ls -l /etc/cluster/fence_xvm.key\r\n"] 9 | [4.956546, "o", "-rw-r--r--. 1 root root 4096 Feb 10 18:42 /etc/cluster/fence_xvm.key\r\n"] 10 | [6.959685, "o", "[user@examples ~]$ ansible-galaxy install OndrejHome.ha-cluster-pacemaker,19.0.0 OndrejHome.pcs-modules-2,19.0.0 -p roles\r\n"] 11 | [7.377249, "o", "- downloading role 'ha-cluster-pacemaker', owned by OndrejHome\r\n"] 12 | [8.214776, "o", "- downloading role from https://github.com/OndrejHome/ansible.ha-cluster-pacemaker/archive/19.0.0.tar.gz\r\n"] 13 | [8.400568, "o", "- extracting OndrejHome.ha-cluster-pacemaker to /home/user/roles/OndrejHome.ha-cluster-pacemaker\r\n"] 14 | [8.413634, "o", "- OndrejHome.ha-cluster-pacemaker (19.0.0) was installed successfully\r\n"] 15 | [8.414482, "o", "- dependency OndrejHome.pcs-modules-2 already pending installation.\r\n"] 16 | [8.538856, "o", "- downloading role 'pcs-modules-2', owned by OndrejHome\r\n"] 17 | [8.683374, "o", "- downloading role from https://github.com/OndrejHome/ansible.pcs-modules-2/archive/19.0.0.tar.gz\r\n"] 18 | [9.070245, "o", "- extracting OndrejHome.pcs-modules-2 to /home/user/roles/OndrejHome.pcs-modules-2\r\n"] 19 | [9.084854, "o", "- OndrejHome.pcs-modules-2 (19.0.0) was installed successfully\r\n"] 20 | [11.175339, "o", "[user@examples ~]$ cat hosts-default\r\n"] 21 | [11.177217, "o", "[servers]\r\n192.168.22.43 vm_name=fastvm-fedora29-43 ansible_python_interpreter=/usr/bin/python3\r\n192.168.22.44 vm_name=fastvm-fedora29-44 ansible_python_interpreter=/usr/bin/python3\r\n"] 22 | [13.180909, "o", "[user@examples ~]$ cat playbook-default.yml\r\n"] 23 | [13.182766, "o", "---\r\n- hosts: servers\r\n remote_user: root\r\n roles:\r\n - { role: OndrejHome.ha-cluster-pacemaker }\r\n"] 24 | [14.186611, "o", "[user@examples ~]$ ansible-playbook -i hosts-default playbook-default.yml\r\n"] 25 | [14.799263, "o", "\r\nPLAY [servers] *****************************************************************\r\n"] 26 | [14.807087, "o", "\r\nTASK [Gathering Facts] *********************************************************\r\n"] 27 | [15.112072, "o", "\u001b[0;32mok: [192.168.22.44]\u001b[0m\r\n"] 28 | [15.123449, "o", "\u001b[0;32mok: [192.168.22.43]\u001b[0m\r\n"] 29 | [15.155427, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Check if cluster consist of at least 2 nodes] ***\r\n"] 30 | [15.197645, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 31 | [15.226847, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Include distribution version specific variables - RHEL/CentOS] ***\r\n"] 32 | [15.262404, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 33 | [15.281739, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 34 | [15.299163, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Include distribution version specific variables - Fedora] ***\r\n"] 35 | [15.349371, "o", "\u001b[0;32mok: [192.168.22.43]\u001b[0m\r\n"] 36 | [15.362003, "o", "\u001b[0;32mok: [192.168.22.44]\u001b[0m\r\n"] 37 | [15.370332, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : (RHEL only) enable repositories] *******\r\n"] 38 | [15.385355, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 39 | [15.39586, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 40 | [15.406178, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install packages from local media] *****\r\n"] 41 | [15.423355, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 42 | [15.435292, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 43 | [15.445638, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install packages from system defined repositories] ***\r\n"] 44 | [15.496148, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/install_normal.yml for 192.168.22.43, 192.168.22.44\u001b[0m\r\n"] 45 | [15.509822, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install libselinux-python to work with SELinux setting] ***\r\n"] 46 | [16.572214, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 47 | [17.114215, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 48 | [17.132154, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install Pacemaker cluster packages to all nodes] ***\r\n"] 49 | [18.215214, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 50 | [18.607093, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 51 | [18.621416, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install python3 package for manipulating firewalld] ***\r\n"] 52 | [19.32573, "o", "\u001b[0;32mok: [192.168.22.43]\u001b[0m\r\n"] 53 | [19.362235, "o", "\u001b[0;32mok: [192.168.22.44]\u001b[0m\r\n"] 54 | [19.37146, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install package(s) for fence_xvm] ******\r\n"] 55 | [22.124713, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 56 | [22.274657, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 57 | [22.281892, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install package(s) for fence_kdump] ****\r\n"] 58 | [22.299862, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 59 | [22.328204, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 60 | [22.363534, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Add hosts to /etc/hosts] ***************\r\n"] 61 | [22.917964, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=192.168.22.43)\u001b[0m\r\n"] 62 | [22.92043, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.43)\u001b[0m\r\n"] 63 | [23.536014, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.44)\u001b[0m\r\n"] 64 | [23.537749, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=192.168.22.44)\u001b[0m\r\n"] 65 | [23.544683, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create cluster system group] ***********\r\n"] 66 | [24.061206, "o", "\u001b[0;32mok: [192.168.22.43]\u001b[0m\r\n"] 67 | [24.062201, "o", "\u001b[0;32mok: [192.168.22.44]\u001b[0m\r\n"] 68 | [24.069681, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create cluster system user] ************\r\n"] 69 | [25.287422, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 70 | [25.296023, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 71 | [25.326682, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable/Disable PCSD web GUI] ***********\r\n"] 72 | [25.371168, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 73 | [25.388952, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 74 | [25.403671, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable and start PCSD service] *********\r\n"] 75 | [26.624005, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 76 | [26.880439, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 77 | [26.893156, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup firewall for RHEL/CentOS systems] ***\r\n"] 78 | [26.910735, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 79 | [26.91995, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 80 | [26.927988, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup firewall for Fedora systems] *****\r\n"] 81 | [26.966985, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/firewall-fedora29.yml for 192.168.22.43, 192.168.22.44\u001b[0m\r\n"] 82 | [26.97998, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable 'high-availability' firewalld service] ***\r\n"] 83 | [27.757411, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 84 | [27.77529, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 85 | [27.804743, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Authorize cluster nodes] ***************\r\n"] 86 | [28.917274, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=192.168.22.43)\u001b[0m\r\n"] 87 | [28.927603, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.43)\u001b[0m\r\n"] 88 | [28.210143, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.44)\u001b[0m\r\n"] 89 | [28.218007, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=192.168.22.44)\u001b[0m\r\n"] 90 | [28.248916, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup cluster] *************************\r\n"] 91 | [29.607879, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 92 | [29.638944, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Start cluster services on all nodes] ***\r\n"] 93 | [30.819036, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=pacemaker)\u001b[0m\r\n"] 94 | [30.92838, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=pacemaker)\u001b[0m\r\n"] 95 | [31.681836, "o", "\u001b[0;32mok: [192.168.22.43] => (item=corosync)\u001b[0m\r\n"] 96 | [31.690233, "o", "\u001b[0;32mok: [192.168.22.44] => (item=corosync)\u001b[0m\r\n"] 97 | [31.722333, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable cluster services on boot] *******\r\n"] 98 | [32.74809, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=pacemaker)\u001b[0m\r\n"] 99 | [32.824864, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=pacemaker)\u001b[0m\r\n"] 100 | [33.609879, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=corosync)\u001b[0m\r\n"] 101 | [33.647294, "o", "\u001b[0;33mchanged: [192.168.22.44] => (item=corosync)\u001b[0m\r\n"] 102 | [33.654636, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup automatic fence_xvm] *************\r\n"] 103 | [33.708001, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/fence_xvm.yml for 192.168.22.43, 192.168.22.44\u001b[0m\r\n"] 104 | [33.755391, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Check if 'vm_name' variable is defined for each node] ***\r\n"] 105 | [33.781442, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 106 | [33.794245, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 107 | [33.80566, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create /etc/cluster directory] *********\r\n"] 108 | [34.306961, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 109 | [34.30736, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 110 | [34.315303, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Copy fence_xvm key to all cluster nodes] ***\r\n"] 111 | [35.442986, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m\r\n"] 112 | [35.445727, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 113 | [35.452736, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable fence_xvm port(1229/tcp) in firewalld] ***\r\n"] 114 | [36.562695, "o", "\u001b[0;33mchanged: [192.168.22.43]\u001b[0m"] 115 | [36.563185, "o", "\r\n"] 116 | [36.586405, "o", "\u001b[0;33mchanged: [192.168.22.44]\u001b[0m\r\n"] 117 | [36.610963, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : create fence_xvm STONITH devices] ******\r\n"] 118 | [37.915309, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.43)\u001b[0m\r\n"] 119 | [38.385593, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.44)\u001b[0m\r\n"] 120 | [38.408255, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : create fence constraints] **************\r\n"] 121 | [39.654073, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.43)\u001b[0m\r\n"] 122 | [39.900648, "o", "\u001b[0;33mchanged: [192.168.22.43] => (item=192.168.22.44)\u001b[0m\r\n"] 123 | [39.90821, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup fence_kdump] *********************\r\n"] 124 | [39.925393, "o", "\u001b[0;36mskipping: [192.168.22.43]\u001b[0m\r\n"] 125 | [39.935861, "o", "\u001b[0;36mskipping: [192.168.22.44]\u001b[0m\r\n"] 126 | [39.94622, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup custom fence devices] ************\r\n"] 127 | [39.999589, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/fence_custom.yml for 192.168.22.43, 192.168.22.44\u001b[0m\r\n"] 128 | [40.041042, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create custom fence device] ************\r\n"] 129 | [40.064409, "o", "\r\nPLAY RECAP *********************************************************************\r\n"] 130 | [40.064777, "o", "\u001b[0;33m192.168.22.43\u001b[0m : \u001b[0;32mok=24 \u001b[0m \u001b[0;33mchanged=16 \u001b[0m unreachable=0 failed=0 \r\n\u001b[0;33m192.168.22.44\u001b[0m : \u001b[0;32mok=21 \u001b[0m \u001b[0;33mchanged=13 \u001b[0m unreachable=0 failed=0 \r\n\r\n"] 131 | -------------------------------------------------------------------------------- /videos/default_playbook-centos-7.6-recording: -------------------------------------------------------------------------------- 1 | {"version": 2, "width": 159, "height": 42, "timestamp": 1549794669, "env": {"SHELL": "/bin/bash", "TERM": "rxvt-unicode"}} 2 | [0.973624, "o", "!! python-jinja2 package in CentOS/RHEL is very old and has some incopatibilities.\r\nNewer version is required when running plaubook from CentOS/RHEL machine !!\r\nYou can use steps below as root to get newer version of python-jinja2 package.\r\n\r\n[root@examples ~]# curl https://copr.fedorainfracloud.org/coprs/ondrejhome/ansible-deps-el7/repo/epel-7/ondrejhome-ansible-deps-el7-epel-7.repo > /etc/yum.repos.d/ondrejhome-ansible-deps-el7-epel-7.repo\r\n[root@examples ~]# yum update python-jinja2 python-markupsafe\r\n\r\n"] 3 | [10.976819, "o", "[user@examples ~]$ cat /etc/redhat-release\r\n"] 4 | [10.979846, "o", "CentOS Linux release 7.6.1810 (Core) \r\n"] 5 | [11.983761, "o", "[user@examples ~]$ ansible --version\r\n"] 6 | [12.505277, "o", "ansible 2.4.2.0\r\n config file = /etc/ansible/ansible.cfg\r\n configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n ansible python module location = /usr/lib/python2.7/site-packages/ansible\r\n executable location = /usr/bin/ansible\r\n python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]\r\n"] 7 | [13.523101, "o", "[user@examples ~]$ cat our_environment\r\n"] 8 | [13.524704, "o", "============================================================\r\nKVM running 2 VMs with following configuration.\r\nKey for fence_xvm is located at /etc/cluster/fence_xvm.key\r\non machine from which we run ansible.\r\nVM-1:\r\n IP address: 192.168.34.41\r\n VM name: fastvm-centos-7.6-41 (as seen by hypervisor)\r\n VM hostname: fastvm-centos-7-6-41\r\nVM-2:\r\n IP address: 192.168.34.42\r\n VM name: fastvm-centos-7.6-42 (as seen by hypervisor)\r\n VM hostname: fastvm-centos-7-6-42\r\n============================================================\r\n"] 9 | [17.528478, "o", "[user@examples ~]$ ls -l /etc/cluster/fence_xvm.key\r\n"] 10 | [17.536275, "o", "-rw-r--r--. 1 root root 4096 Feb 10 11:29 /etc/cluster/fence_xvm.key\r\n"] 11 | [19.539866, "o", "[user@examples ~]$ ansible-galaxy install OndrejHome.ha-cluster-pacemaker,19.0.0 OndrejHome.pcs-modules-2,19.0.0 -p roles\r\n"] 12 | [20.069672, "o", "- downloading role 'ha-cluster-pacemaker', owned by OndrejHome\r\n"] 13 | [20.70266, "o", "- downloading role from https://github.com/OndrejHome/ansible.ha-cluster-pacemaker/archive/19.0.0.tar.gz\r\n"] 14 | [21.516866, "o", "- extracting OndrejHome.ha-cluster-pacemaker to /home/user/roles/OndrejHome.ha-cluster-pacemaker\r\n"] 15 | [21.541769, "o", "- OndrejHome.ha-cluster-pacemaker (19.0.0) was installed successfully\r\n"] 16 | [21.542829, "o", "- dependency OndrejHome.pcs-modules-2 already pending installation.\r\n"] 17 | [21.640853, "o", "- downloading role 'pcs-modules-2', owned by OndrejHome\r\n"] 18 | [21.966692, "o", "- downloading role from https://github.com/OndrejHome/ansible.pcs-modules-2/archive/19.0.0.tar.gz\r\n"] 19 | [22.780968, "o", "- extracting OndrejHome.pcs-modules-2 to /home/user/roles/OndrejHome.pcs-modules-2\r\n"] 20 | [22.796889, "o", "- OndrejHome.pcs-modules-2 (19.0.0) was installed successfully\r\n"] 21 | [24.862036, "o", "[user@examples ~]$ cat hosts-default\r\n"] 22 | [24.864301, "o", "[servers]\r\n192.168.22.41 vm_name=fastvm-centos-7.6-41\r\n192.168.22.42 vm_name=fastvm-centos-7.6-42\r\n"] 23 | [27.868254, "o", "[user@examples ~]$ cat playbook-default.yml\r\n"] 24 | [27.870809, "o", "---\r\n- hosts: servers\r\n remote_user: root\r\n roles:\r\n - { role: OndrejHome.ha-cluster-pacemaker }\r\n"] 25 | [29.874274, "o", "[user@examples ~]$ ansible-playbook -i hosts-default playbook-default.yml\r\n"] 26 | [30.632701, "o", "\r\nPLAY [servers] *****************************************************************\r\n"] 27 | [30.64064, "o", "\r\nTASK [Gathering Facts] *********************************************************\r\n"] 28 | [31.280295, "o", "\u001b[0;32mok: [192.168.22.42]\u001b[0m\r\n"] 29 | [31.303001, "o", "\u001b[0;32mok: [192.168.22.41]\u001b[0m\r\n"] 30 | [31.321764, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Check if cluster consist of at least 2 nodes] ***\r\n"] 31 | [31.352372, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 32 | [31.370057, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Include distribution version specific variables - RHEL/CentOS] ***\r\n"] 33 | [31.43933, "o", "\u001b[0;32mok: [192.168.22.41]\u001b[0m\r\n"] 34 | [31.450399, "o", "\u001b[0;32mok: [192.168.22.42]\u001b[0m\r\n"] 35 | [31.454894, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Include distribution version specific variables - Fedora] ***\r\n"] 36 | [31.465348, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 37 | [31.470657, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 38 | [31.474167, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : (RHEL only) enable repositories] *******\r\n"] 39 | [31.485354, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 40 | [31.490651, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 41 | [31.494115, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install packages from local media] *****\r\n"] 42 | [31.50433, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 43 | [31.513699, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 44 | [31.514222, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install packages from system defined repositories] ***\r\n"] 45 | [31.547657, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/install_normal.yml for 192.168.22.41, 192.168.22.42\u001b[0m\r\n"] 46 | [31.559779, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install libselinux-python to work with SELinux setting] ***\r\n"] 47 | [32.766614, "o", "\u001b[0;32mok: [192.168.22.42]\u001b[0m\r\n"] 48 | [32.774609, "o", "\u001b[0;32mok: [192.168.22.41]\u001b[0m\r\n"] 49 | [32.7881, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install Pacemaker cluster packages to all nodes] ***\r\n"] 50 | [33.42589, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 51 | [33.510193, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 52 | [33.515479, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install python3 package for manipulating firewalld] ***\r\n"] 53 | [33.542822, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 54 | [33.57674, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 55 | [33.591818, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install package(s) for fence_xvm] ******\r\n"] 56 | [33.785177, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 57 | [33.7982, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 58 | [33.802836, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Install package(s) for fence_kdump] ****\r\n"] 59 | [33.818479, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 60 | [33.843595, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 61 | [33.869408, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Add hosts to /etc/hosts] ***************\r\n"] 62 | [34.473123, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.41)\u001b[0m\r\n"] 63 | [34.505253, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=192.168.22.41)\u001b[0m\r\n"] 64 | [35.001569, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.42)\u001b[0m\r\n"] 65 | [35.005762, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=192.168.22.42)\u001b[0m\r\n"] 66 | [35.009472, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create cluster system group] ***********\r\n"] 67 | [35.640322, "o", "\u001b[0;32mok: [192.168.22.42]\u001b[0m\r\n"] 68 | [35.645518, "o", "\u001b[0;32mok: [192.168.22.41]\u001b[0m\r\n"] 69 | [35.64982, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create cluster system user] ************\r\n"] 70 | [35.683929, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 71 | [35.699936, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 72 | [35.713962, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable/Disable PCSD web GUI] ***********\r\n"] 73 | [35.752657, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 74 | [35.772362, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 75 | [35.784344, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable and start PCSD service] *********\r\n"] 76 | [35.974605, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 77 | [36.08402, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 78 | [36.088811, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup firewall for RHEL/CentOS systems] ***\r\n"] 79 | [36.121219, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/firewall-el7.yml for 192.168.22.41, 192.168.22.42\u001b[0m\r\n"] 80 | [36.13422, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable 'high-availability' firewalld service] ***\r\n"] 81 | [37.070919, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 82 | [37.079458, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 83 | [37.092901, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup firewall for Fedora systems] *****\r\n"] 84 | [37.139673, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 85 | [37.160922, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 86 | [37.172027, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Authorize cluster nodes] ***************\r\n"] 87 | [37.44716, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.41)\u001b[0m\r\n"] 88 | [38.371675, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=192.168.22.41)\u001b[0m\r\n"] 89 | [39.23326, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.42)\u001b[0m\r\n"] 90 | [39.686752, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=192.168.22.42)\u001b[0m\r\n"] 91 | [39.701464, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup cluster] *************************\r\n"] 92 | [40.594196, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 93 | [40.599468, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Start cluster services on all nodes] ***\r\n"] 94 | [40.74894, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=pacemaker)\u001b[0m\r\n"] 95 | [40.86142, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=pacemaker)\u001b[0m\r\n"] 96 | [41.143607, "o", "\u001b[0;32mok: [192.168.22.42] => (item=corosync)\u001b[0m\r\n"] 97 | [41.157418, "o", "\u001b[0;32mok: [192.168.22.41] => (item=corosync)\u001b[0m\r\n"] 98 | [41.163487, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable cluster services on boot] *******\r\n"] 99 | [41.756013, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=pacemaker)\u001b[0m\r\n"] 100 | [41.829834, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=pacemaker)\u001b[0m\r\n"] 101 | [42.18265, "o", "\u001b[0;33mchanged: [192.168.22.42] => (item=corosync)\u001b[0m\r\n"] 102 | [42.189736, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=corosync)\u001b[0m\r\n"] 103 | [42.19758, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup automatic fence_xvm] *************\r\n"] 104 | [42.238574, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/fence_xvm.yml for 192.168.22.41, 192.168.22.42\u001b[0m\r\n"] 105 | [42.262581, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Check if 'vm_name' variable is defined for each node] ***\r\n"] 106 | [42.276207, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 107 | [42.288609, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 108 | [42.293528, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create /etc/cluster directory] *********\r\n"] 109 | [42.826874, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 110 | [42.831561, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 111 | [42.835568, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Copy fence_xvm key to all cluster nodes] ***\r\n"] 112 | [43.761762, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 113 | [43.771589, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n\r\nTASK [OndrejHome.ha-cluster-pacemaker : Enable fence_xvm port(1229/tcp) in firewalld] ***\r\n"] 114 | [44.447294, "o", "\u001b[0;33mchanged: [192.168.22.41]\u001b[0m\r\n"] 115 | [44.451609, "o", "\u001b[0;33mchanged: [192.168.22.42]\u001b[0m\r\n"] 116 | [44.460623, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : create fence_xvm STONITH devices] ******\r\n"] 117 | [45.417523, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.41)\u001b[0m\r\n"] 118 | [45.472594, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.42)\u001b[0m\r\n"] 119 | [45.478626, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : create fence constraints] **************\r\n"] 120 | [46.384446, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.41)\u001b[0m\r\n"] 121 | [47.302091, "o", "\u001b[0;33mchanged: [192.168.22.41] => (item=192.168.22.42)\u001b[0m\r\n"] 122 | [47.306628, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup fence_kdump] *********************\r\n"] 123 | [47.317155, "o", "\u001b[0;36mskipping: [192.168.22.41]\u001b[0m\r\n"] 124 | [47.33279, "o", "\u001b[0;36mskipping: [192.168.22.42]\u001b[0m\r\n"] 125 | [47.338678, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Setup custom fence devices] ************\r\n"] 126 | [47.397991, "o", "\u001b[0;36mincluded: /home/user/roles/OndrejHome.ha-cluster-pacemaker/tasks/fence_custom.yml for 192.168.22.41, 192.168.22.42\u001b[0m\r\n"] 127 | [47.473671, "o", "\r\nTASK [OndrejHome.ha-cluster-pacemaker : Create custom fence device] ************\r\n"] 128 | [47.483648, "o", "\r\nPLAY RECAP *********************************************************************\r\n\u001b[0;33m192.168.22.41\u001b[0m : \u001b[0;32mok=23 \u001b[0m \u001b[0;33mchanged=15 \u001b[0m unreachable=0 failed=0 \r\n\u001b[0;33m192.168.22.42\u001b[0m : \u001b[0;32mok=20 \u001b[0m \u001b[0;33mchanged=12 \u001b[0m unreachable=0 failed=0 \r\n\r\n"] 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ha-cluster-pacemaker 2 | ========= 3 | 4 | Role for configuring and expanding basic pacemaker cluster on CentOS/RHEL 6/7/8/9/10, AlmaLinux 8/9, Rocky Linux 8/9, Fedora 31/32/33/34/35/36/37/38/39/40/41/42/43 and CentOS 8/9 Stream systems. Initial support for CentOS 10 Stream and AlmaLinux 10 Beta. 5 | 6 | This role can configure following aspects of pacemaker cluster: 7 | - enable needed system repositories 8 | - install needed packages 9 | - create and configure users and groups for running pacemaker cluster 10 | - configure firewall 11 | - generate items in `/etc/hosts` 12 | - authorize cluster nodes 13 | - create cluster or expand cluster (check `allow_cluster_expansion`) 14 | - "2 or more" node cluster 15 | - single heartbeat, rrp or knet with up to 8 links 16 | - remote nodes 17 | - use autodetected or custom selected interfaces/IPs for heartbeat 18 | - start and enable cluster on boot 19 | - configure stonith devices 20 | - by default install and configure `fence_xvm` stonith devices 21 | - optionally configure `fence_kdump` 22 | - optionally configure `fence_vmware` (SOAP/REST) or any other `fence_*` stonith devices 23 | - optionally configure `fence_aws` 24 | 25 | Role fully supports `--check` mode for default configuration and partially supports it for most of other options. 26 | 27 | When reporting issue please provide following information (if possible): 28 | - used ansible version 29 | - OS from which ansible was run 30 | - playbook and invetory file that produced error (remove sensitive information where appropriate) 31 | - error message or description of missbehaviour that you have encountered 32 | 33 | Requirements 34 | ------------ 35 | 36 | This role depend on role [ondrejhome.pcs-modules-2](https://github.com/OndrejHome/ansible.pcs-modules-2). 37 | 38 | **Ansible 2.8** or later. (NOTE: it might be possible to use earlier versions, in case of issues please try updating Ansible to 2.8+) 39 | 40 | **RHEL 6/7/8:** It is expected that machines will already be registered. Role will by default enable access to 'High Availability' or 'Resilient storage' channel. If this is not desired check the `enable_repos` variable. 41 | 42 | **RHEL/CentOS 7:** This role requires at least version `2.9` of `python-jinja2` library. If not present you may encounter error described in Issue #6. To get the updated version of `python-jinja2` and its dependencies you can use following RPM repository - https://copr.fedorainfracloud.org/coprs/ondrejhome/ansible-deps-el7/ for both CentOS 7 and RHEL 7. 43 | 44 | **CentOS 8 Stream** Tested with version 20240129 minimal recommended ansible version is **2.11.0** which starts to identify system as 'CentOS' instead of 'RedHat' (unline CentOS Linux). The older CentOS 8 Stream versions 20201211 minimal usable ansible version is **2.9.16/2.10.4**. Version **2.8.18** was **not** working at time of testing. This is related to [Service is in unknown state #71528](https://github.com/ansible/ansible/issues/71528). 45 | 46 | **CentOS 9 Stream** Tested with version 20240129 minimal recommended ansible is **2.11.0**. 47 | 48 | **Debian Buster** Tested with version 20210310 with ansible version **2.10** and **Debian Bullseye** Tested with version 20220326 with ansible version **2.12**. Debian part of this role does not include the stonith configuration and the firewall configuration. **Note:** This role went only through limited testing on Debian - not all features of this role were tested. 49 | 50 | **Debian Bookworm** Tested with ansible version **2.14** and **Debian Bookwork**. Debian part of this role does not include the stonith configuration and the firewall configuration. **Note:** This role went only through limited testing on Debian - not all features of this role were tested. 51 | 52 | **Debian Trixie** Tested with ansible version **2.16**. Debian part of this role does not include the stonith configuration and the firewall configuration. **Note:** This role went only through limited testing on Debian - not all features of this role were tested. Due to large size of dependencies for pacemaker packages in Debian Trixie the role automatically sets `install_recommends: false` for `apt` module. 53 | 54 | Ansible version **2.9.10** and **2.9.11** will fail with error `"'hostvars' is undefined"` when trying to configure remote nodes. This applies only when there is at least one node with `cluster_node_is_remote=True`. **Avoid these Ansible versions** if you plan to configure remote nodes with this role. 55 | 56 | On **CentOS Linux 8** you have to ensure that BaseOS and Appstream repositories are working properly. As the CentOS Linux 8 is in the End-Of-Life phase, this role will configure HA repository to point to vault.centos.org if repository configuration (`enable_repos: true`) is requested (it is by default). 57 | 58 | When using **Fedora 41/42/43** with minimal installation then this role will automatically install `python3-libdnf5` package to allow regular ansible yum module to function. 59 | 60 | **pcs-0.11** version distributions (AlmaLinux 9, Rocky Linux 9, RHEL 9, Fedora 36/37/38) are supported only with ondrejhome.pcs-modules-2 version 27.0.0 or higher. 61 | 62 | **pcs-0.12** version distributions (AlmaLinux 10, CentOS Stream 10, Fedora 42/43, RHEL 10) are supported only with ondrejhome.pcs-modules-2 version 31.0.0 or higher. 63 | 64 | Role Variables 65 | -------------- 66 | 67 | - user used for authorizing cluster nodes 68 | 69 | ``` 70 | cluster_user: 'hacluster' 71 | ``` 72 | 73 | - password for user used for authorizing cluster nodes 74 | 75 | ``` 76 | cluster_user_pass: 'testtest' 77 | ``` 78 | 79 | - group to which cluster user belongs (should be 'haclient') 80 | 81 | ``` 82 | cluster_group: 'haclient' 83 | ``` 84 | 85 | - name of the cluster 86 | 87 | ``` 88 | cluster_name: 'pacemaker' 89 | ``` 90 | 91 | - configuration of firewall for clustering, NOTE in RHEL/Centos 6 this replaces iptables configuration file! 92 | 93 | ``` 94 | cluster_firewall: true 95 | ``` 96 | 97 | - enable cluster on boot on normal (not pacemaker_remote) nodes 98 | 99 | ``` 100 | cluster_enable_service: true 101 | ``` 102 | 103 | - configure cluster with fence_xvm fencing device ? 104 | This will copy /etc/cluster/fence_xvm.key to nodes and add fencing devices to cluster 105 | NOTE: you need to define 'vm_name' in the inventory for each cluster node 106 | 107 | ``` 108 | cluster_configure_fence_xvm: true 109 | ``` 110 | 111 | - configure cluster with fence_vmware_soap/fence_vmware_rest fencing device ? 112 | This will install fence_vmware_soap/fence_vmware_rest fencing agent and configure it. When this is enabled you 113 | have to specify 3 additional variables with information on accessing the vCenter. 114 | NOTE: You also need to define 'vm_name' in the inventory for each cluster node specifying the name or UUID of VM 115 | as seen on the hypervisor or in the output of `fence_vmware_soap -o list`/`fence_vmware_rest` command. 116 | ``` 117 | cluster_configure_fence_vmware_soap: false 118 | cluster_configure_fence_vmware_rest: false 119 | fence_vmware_ipaddr: '' 120 | fence_vmware_login: '' 121 | fence_vmware_passwd: '' 122 | ``` 123 | You can optionally change the additional attributes passed to fence_vmware_soap/fence_vmware_rest using the variable `fence_vmware_options`. 124 | By default this variable enables encryption but disables validation of certificates. 125 | ``` 126 | fence_vmware_options: 'ssl="1" ssl_insecure="1"' 127 | ``` 128 | NOTE: Only one of fence_vmware_soap/fence_vmware_rest can be configured as stonith devices share same name. 129 | 130 | - configure cluster with fence_kdump fencing device ? 131 | This starts kdump service and defines the fence_kdump stonith devices. 132 | NOTE: if the kdump service is not started this won't work properly or at all 133 | 134 | ``` 135 | cluster_configure_fence_kdump: false 136 | ``` 137 | 138 | - configure cluster with fence_aws fencing device? 139 | You must provide instance id/region of AWS and Instance Profile that is able to start/stop instances for this cluster. 140 | When this is enabled you have to specify `fence_aws_region` variable with information on AWS region. 141 | NOTE: If you don't set up instance profile, it won't work properly or at all 142 | 143 | ``` 144 | cluster_configure_fence_aws: false 145 | fence_aws_region: '' 146 | ``` 147 | NOTE: You also need to define `instance_id` in the inventory for each cluster node by specifying the instance id 148 | as seen in the AWS web console or in the output of `fence_aws -o list` command. ([man fence_aws](https://www.mankier.com/8/fence_aws)) 149 | 150 | You can optionally change the additional attributes passed to fence_aws using the `fence_aws_options` variable. 151 | ``` 152 | fence_aws_options: '' 153 | ``` 154 | NOTE: Examples of proper options for some specific use cases can be found in documents below. 155 | [https://access.redhat.com/articles/4175371#create-stonith](https://access.redhat.com/articles/4175371#create-stonith) 156 | [https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-resources-1.html](https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-resources-1.html) 157 | 158 | - How to map fence devices to cluster nodes? 159 | By default for every cluster node a separate stonith devices is created ('one-device-per-node'). 160 | Some fence agents can fence multiple nodes using same stonith device ('one-device-per-cluster') 161 | and can have trouble when using multiple devices due to same user login count limits. 162 | Available options: 163 | - `one-device-per-node` - (default) - one stonith device per cluster node is created 164 | - `one-device-per-cluster` - (on supported fence agents) - only one cluster-wide stonith device is created for all nodes, supported fence agents: `fence_vmware_rest`, `fence_vmware_soap`, `fence_xvm`, `fence_kdump` 165 | ``` 166 | cluster_configure_stonith_style: 'one-device-per-node' 167 | ``` 168 | 169 | - (RHEL/CentOS/AlmaLinux/Rocky) enable the repositories containing needed packages 170 | ``` 171 | enable_repos: true 172 | ``` 173 | 174 | - (RHEL only) enable the extended update (EUS) repositories containint packages needed 175 | ``` 176 | enable_eus_repos: false 177 | ``` 178 | 179 | - (RHEL only) enable the SAP Solutions update service (E4S) repositories containint packages needed 180 | ``` 181 | enable_e4s_repos: false 182 | ``` 183 | 184 | - (RHEL only) enable Beta repositories containint packages needed 185 | ``` 186 | enable_beta_repos: false 187 | ``` 188 | 189 | - (RHEL only) type of enable repositories, note that E4S repos have only 'ha' type available 190 | - ha - High-Availability 191 | - rs - Resilient Storage 192 | ``` 193 | repos_type: 'ha' 194 | ``` 195 | 196 | - (RHEL only) custom_repository allows enabling an arbitrarily named repository to be enabled. 197 | RHEL8 repo names can be found at http://downloads.redhat.com/redhat/rhel/rhel-8-beta/rhel-8-beta.repo 198 | ``` 199 | custom_repository: '' 200 | 201 | ``` 202 | 203 | - (CentOS only) install the needed packages from the CD-ROM media available at /dev/cdrom 204 | ``` 205 | use_local_media: false 206 | ``` 207 | 208 | - Enable or disable PCSD web GUI. By default the role keeps the default of installation means that 209 | PCSD web GUI is disabled on CentOS/RHEL 6.X and enabled on CentOS/RHEL 7.X. `true` or `false` can 210 | be passed to this variable to make sure that PCSD web GUI is enabled or disabled. 211 | ``` 212 | enable_pcsd_gui: 'nochange' 213 | ``` 214 | 215 | - Cluster transport protocol. By default this role will use what is default for give OS. 216 | For CentOS/RHEL 6.X this means 'udp' (UDP multicast) and for CentOS/RHEL 7.X this means 'udpu' 217 | (UDP unicast). This variable accepts following options: `default`, `udp` and `udpu`. 218 | ``` 219 | cluster_transport: 'default' 220 | ``` 221 | 222 | - Allow adding nodes to existing cluster when used with ondrejhome.pcs-modules-2 v16 or newer. 223 | ``` 224 | allow_cluster_expansion: false 225 | ``` 226 | 227 | - Cluster network interface. If specified the role will map hosts to primary IPv4 address from this interface. 228 | By default the IPv4 address from `ansible_default_ipv4` or first IPv4 from `ansible_all_ipv4_addresses`is used. 229 | For exmaple to use primary IPv4 address from interface `ens8` use `cluster_net_iface: 'ens8'`. 230 | Interface must exists on all cluster nodes. 231 | ``` 232 | cluster_net_iface: '' 233 | ``` 234 | 235 | - Redundant network interface. If specified the role will setup a corosync redundant ring using the default IPv4 from this interface. 236 | Interface must exist on all cluster nodes. 237 | ``` 238 | rrp_interface: '' 239 | ``` 240 | NOTE: you can define this variable either in defaults/main.yml, in this case the same rrp_interface name is used for all hosts in the hosts file. 241 | Either you specify an interface for each host present in the hosts file: this allows to use a specific interface name for each host (in the case they dont have the same interface name). Also note that instead of defining rrp_interface for a host, you can define rrp_ip: in this case this alternate ip is used to configure corosync RRP (this IP must be different than the host' default IPv4 address). This allows to use an alternate ip belonging to the same primary interface. 242 | 243 | 244 | - Whether to add hosts to /etc/hosts. By default an entry for the hostname 245 | given by `cluster_hostname_fact` is added for each host to `/etc/hosts`. 246 | This can be disabled by setting `cluster_etc_hosts` to `false`. 247 | 248 | ``` 249 | cluster_etc_hosts: true 250 | ``` 251 | 252 | - Which Ansible fact to use as the hostname of cluster nodes. By default this 253 | role uses the `ansible_hostname` fact as the hostname for each host. In 254 | some environments it may be useful to use the Fully Qualified Domain Name 255 | (FQDN) `ansible_fqdn` or node name `ansible_nodename`. 256 | 257 | ``` 258 | cluster_hostname_fact: "ansible_hostname" 259 | ``` 260 | 261 | - Whether the node should be setup as a remote pacemaker node. By default 262 | this is `false`, and the node will be a full member of the Pacemaker 263 | cluster. Pacemaker remote nodes are not full members of the cluster, and 264 | allow exceeding the maximum cluster size of 32 full members. Note that 265 | remote nodes are supported by this role only on EL7 and EL8. 266 | 267 | ``` 268 | cluster_node_is_remote: false 269 | ``` 270 | 271 | - Ordered list of variables for detecting primary cluster IP (ring0). First matched IPv4 is used and rest 272 | of detected IPv4s are skipped. In majority cases this should not require change, in some special cases 273 | such as when there is no default GW or non-primary IPv4 from given interface should be used this can be adjusted. 274 | ``` 275 | ring0_ip_ordered_detection_list: 276 | - "{{ hostvars[inventory_hostname]['ansible_'+cluster_net_iface].ipv4.address|default('') }}" 277 | - "{{ ansible_default_ipv4.address|default('') }}" 278 | - "{{ ansible_all_ipv4_addresses[0]|default('') }}" 279 | 280 | ``` 281 | 282 | - Configure cluster properties (Not mandatory) 283 | 284 | ``` 285 | cluster_property: 286 | - name: required 287 | node: optional 288 | value: optional 289 | ``` 290 | 291 | - Configure cluster resource defaults (Not mandatory) 292 | 293 | ``` 294 | cluster_resource_defaults: 295 | - name: required 296 | defaults_type: optional 297 | value: optional 298 | ``` 299 | 300 | - Configure cluster resources (Not mandatory) 301 | 302 | ``` 303 | cluster_resource: 304 | - name: required 305 | resource_class: optional 306 | resource_type: optional 307 | options: optional 308 | force_resource_update: optional 309 | ignored_meta_attributes: optional 310 | child_name: optional 311 | ``` 312 | 313 | - Configure cluster order constraints (Not mandatory) 314 | 315 | ``` 316 | cluster_constraint_order: 317 | - resource1: required 318 | resource1_action: optional 319 | resource2: required 320 | resource2_action: optional 321 | kind: optional 322 | symmetrical: optional 323 | ``` 324 | - Configure cluster colocation constraints (Not mandatory) 325 | 326 | ``` 327 | cluster_constraint_colocation: 328 | - resource1: required 329 | resource1_role: optional 330 | resource2: required 331 | resource2_role: optional 332 | score: optional 333 | influence: optional 334 | ``` 335 | 336 | - Configure cluster location constraints (Not mandatory) 337 | 338 | **node based** 339 | 340 | ``` 341 | cluster_constraint_location: 342 | - resource: required 343 | node_name: required 344 | score: optional 345 | ``` 346 | 347 | **rule based** (_needs ondrejhome.pcs-modules-2 version 30.0.0 or newer_) 348 | 349 | ``` 350 | cluster_constraint_location: 351 | - resource: required 352 | constraint_id: required 353 | rule: required 354 | score: optional 355 | ``` 356 | 357 | Security considerations 358 | ----------------------- 359 | 360 | Please consider updating the default value for `cluster_user_pass`. 361 | 362 | To protect the sensitive values in variables passed to this role you can use `ansible-vault` to encrypt them. The recommended approach is to create a separate file with desired variables and their values, encrypt the whole file with `ansible-vault encrypt` and then include this file in `pre_tasks:` section so it is loaded before the role is executed. Example below illustrates this whole process. 363 | 364 | **Creating encrypted_vars.yaml file** 365 | 366 | - 1. Create plain text `encrypted_vars.yaml` file with your desired secret values 367 | ``` 368 | # cat encrypted_vars.yaml 369 | --- 370 | cluster_user_pass: 'cluster-user-pass' 371 | fence_vmware_login: 'vcenter-user' 372 | fence_vmware_passwd: 'vcenter-pass' 373 | ``` 374 | 375 | - 2. Encrypt file suing `ansible-vault` 376 | ``` 377 | # ansible-vault encrypt encrypted_vars.yaml 378 | ``` 379 | 380 | - 3. Verify the new content of `encrypted_vars.yaml` 381 | ``` 382 | # cat encrypted_vars.yaml 383 | $ANSIBLE_VAULT;1.1;AES256 384 | 31306461386430... 385 | ``` 386 | 387 | **Example playbook that is using values from `encrypted_vars.yaml`** 388 | 389 | - hosts: cluster 390 | pre_tasks: 391 | - include_vars: encrypted_vars.yaml 392 | roles: 393 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'test-cluster' } 394 | 395 | **NOTE:** Encrypting only the variable's value and putting it into `vars:` is discouraged as it could results in errors like `argument 1 must be str, not AnsibleVaultEncryptedUnicode`. Approach that encrypts whole file seems to be not affected by this issue. 396 | 397 | Ansible module_defaults 398 | ----------------------- 399 | 400 | While this role does not expose all configuration options through variables, one can use the [`module_defaults`](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_module_defaults.html#module-defaults) to change the default values of parameters that this role does not use. Below is non-exhaustive list of examples where this may become useful. 401 | 402 | **Example module_default A** for setting the totem token to 15 seconds 403 | 404 | - hosts: cluster 405 | module_defaults: 406 | pcs_cluster: 407 | token: 15000 # default is 'null' - depends on OS default value 408 | 409 | **Example module_default B** for disabling installation of weak dependencies on EL8+/Fedora systems 410 | 411 | - hosts: cluster 412 | module_defaults: 413 | yum: 414 | install_weak_deps: false # default is 'true' 415 | 416 | **Example module_default C** for disabling installation of package recommends on Debian systems 417 | 418 | - hosts: cluster 419 | modules_defaults: 420 | apt: 421 | install_recommends: false # default is 'null' - depends on OS configuration 422 | 423 | NOTE: The `module_defaults` only applies to options that are not specified in task - you cannot override value that is set by task in this role, only the value of options that are not used can be changed. 424 | 425 | Example Playbook 426 | ---------------- 427 | 428 | **Example playbook A** for creating cluster named 'test-cluster' enabled on boot, with `fence_xvm` and firewall settings. NOTE: `cluster_name` is optional and defaults to `pacemaker`. 429 | 430 | - hosts: cluster 431 | roles: 432 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'test-cluster' } 433 | 434 | **Example playbook B** for creating cluster named 'test-cluster' without configuring firewall and without `fence_xvm`. 435 | For cluster to get properly authorized it is expected that firewall is already configured or disabled. 436 | 437 | - hosts: cluster 438 | roles: 439 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'test-cluster', cluster_firewall: false, cluster_configure_fence_xvm: false } 440 | 441 | **Example playbook C** for creating cluster named `vmware-cluster` with `fence_vmware_soap` fencing device. 442 | 443 | - hosts: cluster 444 | vars: 445 | fence_vmware_ipaddr: 'vcenter-hostname-or-ip' 446 | fence_vmware_login: 'vcenter-username' 447 | fence_vmware_passwd: 'vcenter-password-for-username' 448 | roles: 449 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'vmware-cluster', cluster_configure_fence_xvm: false, cluster_configure_fence_vmware_soap: true } 450 | 451 | **Example playbook D** for creating cluster named `test-cluster` where `/etc/hosts` is not modified: 452 | 453 | - hosts: cluster 454 | roles: 455 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'test-cluster', cluster_etc_hosts: false } 456 | 457 | **Example playbook E** for creating cluster named `vmware-cluster` with single `fence_vmware_rest` fencing device for all cluster nodes. 458 | 459 | - hosts: cluster 460 | vars: 461 | fence_vmware_ipaddr: 'vcenter-hostname-or-ip' 462 | fence_vmware_login: 'vcenter-username' 463 | fence_vmware_passwd: 'vcenter-password-for-username' 464 | roles: 465 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'vmware-cluster', cluster_configure_fence_xvm: false, cluster_configure_fence_vmware_rest: true, cluster_configure_stonith_style: 'one-device-per-cluster' } 466 | 467 | **Example playbook F** for creating cluster named `aws-cluster` with single `fence_aws` fencing device for all cluster nodes. 468 | 469 | - hosts: cluster 470 | roles: 471 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'aws-cluster', cluster_configure_fence_xvm: false, cluster_configure_fence_aws: true, cluster_configure_stonith_style: 'one-device-per-cluster', enable_repos: false, fence_aws_region: 'aws-region' } 472 | 473 | **Example playbook Resources configuration** . 474 | 475 | - hosts: cluster 476 | vars: 477 | cluster_property: 478 | - name: 'maintenance-mode' 479 | value: 'true' 480 | cluster_resource: 481 | - name: 'apache2' 482 | resource_type: 'systemd:apache2' 483 | options: 'meta migration-threshold=2 op monitor interval=20s timeout=10s' 484 | - name: 'cluster_vip' 485 | resource_type: 'ocf:heartbeat:IPaddr2' 486 | options: 'ip=192.168.1.150 cidr_netmask=24 meta migration-threshold=2 op monitor interval=20' 487 | cluster_constraint_colocation: 488 | - resource1: 'cluster_vip' 489 | resource2: 'apache2' 490 | score: 'INFINITY' 491 | cluster_resource_defaults: 492 | - name: 'failure-timeout' 493 | value: '30' 494 | roles: 495 | - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'apache-cluster'} 496 | 497 | Inventory file example for CentOS/RHEL/Fedora systems createing basic clusters. 498 | 499 | [cluster-centos7] 500 | 192.168.22.21 vm_name=fastvm-centos-7.8-21 501 | 192.168.22.22 vm_name=fastvm-centos-7.8-22 502 | [cluster-fedora32] 503 | 192.168.22.23 vm_name=fastvm-fedora32-23 504 | 192.168.22.24 vm_name=fastvm-fedora32-24 505 | [cluster-rhel8] 506 | 192.168.22.25 vm_name=fastvm-rhel-8.0-25 507 | 192.168.22.26 vm_name=fastvm-rhel-8.0-26 508 | 509 | Inventory file example for cluster using RRP interconnnect on custom interface and/or using custom IP for RRP 510 | 511 | [cluster-centos7-rrp] 512 | 192.168.22.27 vm_name=fastvm-centos-7.6-21 rrp_interface=ens6 513 | 192.168.22.28 vm_name=fastvm-centos-7.6-22 rrp_ip=192.168.22.29 514 | 515 | Inventory file example with two full members and two remote nodes: 516 | 517 | [cluster] 518 | 192.168.22.21 vm_name=fastvm-centos-7.6-21 519 | 192.168.22.22 vm_name=fastvm-centos-7.6-22 520 | 192.168.22.23 vm_name=fastvm-centos-7.6-23 cluster_node_is_remote=True 521 | 192.168.22.24 vm_name=fastvm-centos-7.6-24 cluster_node_is_remote=True 522 | 523 | Inventory file example with fence_aws: 524 | 525 | [cluster] 526 | 172.31.0.1 instance_id="i-acbdefg1234567890" 527 | 172.31.0.2 instance_id="i-acbdefg0987654321" 528 | 529 | Old video examples of running role with defaults for: 530 | - CentOS 7.6 installing CentOS 7.6 two node cluster: https://asciinema.org/a/226466 531 | - Fedora 29 installing Fedora 29 two node cluster: https://asciinema.org/a/226467 532 | 533 | License 534 | ------- 535 | 536 | GPLv3 537 | 538 | Author Information 539 | ------------------ 540 | 541 | To get in touch with author you can use email ondrej-xa2iel8u@famera.cz or create a issue on github when requesting some feature. 542 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------