--- - name: Run distro specific tasks for ctdb.setup include_tasks: file: "{{ distro.actions_file }}" - name: Check for required variables block: - fail: msg: "Please provide required variable: ctdb_network_private_interfaces" when: ctdb_network_private_interfaces is undefined - fail: msg: "Please provide these required variable: ctdb_network_public_interfaces" when: ctdb_network_public_interfaces is undefined - fail: msg: "Please provide these required variable: ctdb_network_public_interface_subnet_mask" when: ctdb_network_public_interface_subnet_mask is undefined - fail: msg: "Please provide these required variable: ctdb_network_public_interface_name" when: ctdb_network_public_interface_name is undefined - fail: msg: "Please provide these required variable: ctdb_cluster_volume" when: ctdb_cluster_volume is undefined - fail: msg: "Please provide these required variable: ctdb_cluster_replica_count" when: ctdb_cluster_replica_count is undefined - name: Create the ctdb replicated volume gluster_volume: state: present name: "{{ ctdb_cluster_volume }}" bricks: '{{ ctdb_brick_location }}/ctdb' cluster: "{{ cluster_hosts }}" replicas: "{{ ctdb_cluster_replica_count }}" run_once: yes - name: Mount and add CTDB lock volume to fstab mount: path: /gluster/lock/ src: 'localhost:/ctdb' fstype: glusterfs opts: '_netdev,transport=tcp,xlator-option=*client*.ping-timeout=10' state: mounted - name: Add ctdb rules to firewalld firewalld: service: ctdb permanent: yes state: enabled - name: Add recovery lock to ctdb.conf lineinfile: dest: /etc/ctdb/ctdb.conf line: "\trecovery lock = /gluster/lock/recovery.lock" regexp: "recovery lock" insertafter: '\[cluster\]' - name: Enable check consistency of databases during startup command: '/bin/ctdb event script enable legacy 00.ctdb' - name: Enable check consistency of databases during startup command: '/bin/ctdb event script enable legacy 01.reclock' - name: Enable monitor system resources command: '/bin/ctdb event script enable legacy 05.system' - name: Enable network interface management by ctdb command: '/bin/ctdb event script enable legacy 10.interface' - name: Enable samba management by ctdb command: '/bin/ctdb event script enable legacy 50.samba' - include_role: name: gluster.features vars: gluster_features_ctdb_nodes: "{{ ctdb_network_private_interfaces | join(',') }}" gluster_features_ctdb_publicaddr: "{{ ctdb_network_public_interfaces | map('regex_replace','(^.*$)','\\1/' + ctdb_network_public_interface_subnet_mask + ' ' + ctdb_network_public_interface_name) | list |join (',') }}" gluster_features_ctdb_volume: "{{ ctdb_cluster_volume }}" gluster_features_ctdb_enable_hook_scripts: false - name: Restart ctdb service: name=ctdb state=restarted enabled=yes