5041db46f39c992e7d4c7a7601f91d76a294b945
[autocluster.git] / ansible / node / roles / nas / tasks / generic / ctdb.yml
1 ---
2 - name: generate CTDB configuration file
3   template:
4     src: ctdb_conf.j2
5     dest: /etc/ctdb/ctdb.conf
6
7 - name: generate CTDB public addresses file
8   template:
9     src: ctdb_public_addresses.j2
10     dest: /etc/ctdb/public_addresses
11
12 - name: create directory for CTDB recovery lock
13   file:
14     path: "{{ clusterfs.mountpoint }}/.ctdb"
15     state: directory
16
17 - import_tasks: ctdb-once.yml
18   run_once: true
19
20 - name: ensure CTDB is enabled
21   service:
22     name: ctdb
23     enabled: yes
24
25 # This stops things failing if the domain has not been joined or similar
26 - name: ensure that CTDB is not managing smbd, winbind and NFS
27   command: ctdb event script disable legacy {{ s }}
28   with_list:
29     - 49.winbind
30     - 50.samba
31     - 60.nfs
32   loop_control:
33     loop_var: s
34
35 # Restart just in case ctdbd was running but unhealthy
36 - import_tasks: ctdb-stop.yml
37 - import_tasks: ctdb-start.yml