-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaos_cluster.yml
76 lines (62 loc) · 1.9 KB
/
daos_cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
# playbook: daos_cluster.yml
# playbook_fqn: daos_stack.daos.daos_cluster
- name: Wait for hosts
hosts: all
gather_facts: false
become: false
any_errors_fatal: true
tasks:
- name: Wait for hosts to become ready
block:
- name: Wait for port to be available
ansible.builtin.wait_for:
port: "{{ ansible_port | default('22') }}"
timeout: 600
become: false
changed_when: false
when: ansible_connection is defined
- name: Test connection
ansible.builtin.wait_for_connection:
timeout: 300
changed_when: false
- name: Test sudo
ansible.builtin.command:
cmd: sudo --version
changed_when: false
rescue:
- name: Unable to continue
ansible.builtin.debug:
msg: "One or more hosts are not available. Cannot continue."
- meta: end_play
- name: DAOS cluster prep
hosts: all
gather_facts: true
become: true
roles:
- role: daos_stack.daos.epel
- role: daos_stack.daos.packages
- role: daos_stack.daos.tune
- role: daos_stack.daos.reboot
when: inventory_hostname not in groups['daos_admins']
- name: DAOS cluster installation and configuration
hosts: all
gather_facts: true
become: true
pre_tasks:
- name: Create access_points group
ansible.builtin.add_host:
name: "{{ item }}"
groups: access_points
when: hostvars[item].is_access_point | default(false) | bool
with_items: "{{ groups['daos_servers'] }}"
changed_when: false
tags: always
- name: Create daos_access_points IP list
ansible.builtin.set_fact:
daos_access_points: "{{ groups.access_points |
map('extract', hostvars, 'ansible_default_ipv4') |
map(attribute='address') | list }}"
tags: always
roles:
- role: daos_stack.daos.daos