File tree Expand file tree Collapse file tree 6 files changed +123
-2
lines changed Expand file tree Collapse file tree 6 files changed +123
-2
lines changed Original file line number Diff line number Diff line change @@ -58,4 +58,6 @@ roles/*
58
58
! roles /squid /**
59
59
! roles /tuned /
60
60
! roles /tuned /**
61
+ ! roles /compute_init /
62
+ ! roles /compute_init /**
61
63
Original file line number Diff line number Diff line change 36
36
tasks :
37
37
- import_role :
38
38
name : persist_hostkeys
39
+
40
+ - name : Inject ansible-init compute script
41
+ hosts : compute_init
42
+ tags : compute_init
43
+ become : yes
44
+ tasks :
45
+ - import_role :
46
+ name : compute_init
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Compute node initialisation
4
+ hosts : localhost
5
+ become : yes
6
+ vars :
7
+ control_node_ip : " 172.16.1.228"
8
+ nfs_export : " /exports/hosts"
9
+ resolv_conf_nameservers : []
10
+
11
+ tasks :
12
+ - name : Configure resolve.conf
13
+ block :
14
+ - name : Set nameservers in /etc/resolv.conf
15
+ ansible.builtin.template :
16
+ src : /etc/ansible-init/templates/resolv.conf.j2
17
+ dest : /etc/resolv.conf
18
+ owner : root
19
+ group : root
20
+ mode : u=rw,og=r
21
+
22
+ - name : Disable NetworkManager control of resolv.conf
23
+ ansible.builtin.copy :
24
+ src : /etc/ansible-init/files/NetworkManager-dns-none.conf
25
+ dest : /etc/NetworkManager/conf.d/90-dns-none.conf
26
+ owner : root
27
+ group : root
28
+ mode : u=rw,og=r
29
+ register : _copy_nm_config
30
+
31
+ - name : Reload NetworkManager
32
+ ansible.builtin.systemd :
33
+ name : NetworkManager
34
+ state : reloaded
35
+ when : _copy_nm_config.changed | default(false)
36
+
37
+ - name : Mount /etc/hosts on compute nodes
38
+ block :
39
+ - name : Ensure the mount directory exists
40
+ file :
41
+ path : /mnt/hosts
42
+ state : directory
43
+ mode : 0755
44
+
45
+ - name : Mount NFS export
46
+ mount :
47
+ path : /mnt/hosts
48
+ src : " {{ vars.control_node_ip }}:{{ nfs_export }}"
49
+ fstype : nfs
50
+ opts : rw,sync
51
+ state : mounted
52
+
53
+ - name : Copy /exports/hosts contents to /etc/hosts
54
+ copy :
55
+ src : /mnt/hosts/hosts
56
+ dest : /etc/hosts
57
+ owner : root
58
+ group : root
59
+ mode : 0644
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Ensure templates directory exists
4
+ file :
5
+ path : /etc/ansible-init/templates
6
+ state : directory
7
+ owner : root
8
+ group : root
9
+ mode : 0644
10
+
11
+ - name : Inject templates
12
+ copy :
13
+ src : ' {{ item }}'
14
+ dest : ' /etc/ansible-init/templates/{{ item | basename }}'
15
+ owner : root
16
+ group : root
17
+ mode : 0644
18
+ loop :
19
+ - ../../resolv_conf/templates/resolv.conf.j2
20
+
21
+ - name : Ensure files directory exists
22
+ file :
23
+ path : /etc/ansible-init/files
24
+ state : directory
25
+ owner : root
26
+ group : root
27
+ mode : 0644
28
+
29
+ - name : Inject files
30
+ copy :
31
+ src : ' {{ item }}'
32
+ dest : ' /etc/ansible-init/files/{{ item | basename }}'
33
+ owner : root
34
+ group : root
35
+ mode : 0644
36
+ loop :
37
+ - ../../resolv_conf/files/NetworkManager-dns-none.conf
38
+
39
+ - name : Inject compute initialisation playbook
40
+ copy :
41
+ src : compute-init.yml
42
+ dest : /etc/ansible-init/playbooks/compute-init.yml
43
+ owner : root
44
+ group : root
45
+ mode : 0644
Original file line number Diff line number Diff line change @@ -134,4 +134,7 @@ freeipa_client
134
134
# Hosts to run TuneD configuration
135
135
136
136
[ansible_init]
137
- # Hosts to run linux-anisble-init
137
+ # Hosts to run linux-anisble-init
138
+
139
+ [compute_init]
140
+ # Hosts to deploy compute initialisation ansible-init script to.
Original file line number Diff line number Diff line change @@ -80,4 +80,8 @@ openhpc
80
80
81
81
[ansible_init:children]
82
82
# Hosts to run ansible-init
83
- cluster
83
+ cluster
84
+
85
+ [compute_init:children]
86
+ # Hosts to deploy compute initialisation ansible-init script to.
87
+ compute
You can’t perform that action at this time.
0 commit comments