scripts: Add autocluster-test-ctdb script
[autocluster.git] / ansible / node / roles / nas / tasks / generic / ctdb-with-samba-nfs.yml
1 ---
2 # Should be running already but this won't hurt
3 - import_tasks: ctdb-start.yml
4
5 - name: join active directory domain
6   shell: |
7     net ads testjoin </dev/null || \
8       timeout 10 net ads join -U "administrator%{{ ad.admin_password }}"
9   register: result
10   until: result.rc == 0
11   retries: 5
12   delay: 1
13   run_once: true
14   when: auth_method == 'winbind'
15
16 # FIXME: This will be useful to allow version checking to enable
17 # services/event scripts in different ways
18
19 # New in Ansible 2.5
20 #- name: get package facts
21 #  package_facts:
22 #    manager: "auto"
23
24 #- name: show them
25 #  debug: var=ansible_facts.packages
26
27 - import_tasks: ctdb-stop.yml
28
29 - name: configure CTDB to manage smbd and NFS
30   command: ctdb event script enable legacy {{ s }}
31   with_list:
32     - 50.samba
33     - 60.nfs
34   loop_control:
35     loop_var: s
36
37 - name: configure CTDB to manage winbindd
38   command: ctdb event script enable legacy 49.winbind
39   when: auth_method == 'winbind'
40
41 - import_tasks: ctdb-start.yml