|
@@ -1,4 +1,4 @@
|
|
|
- Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
|
|
|
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
|
|
|
#
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
# you may not use this file except in compliance with the License.
|
|
@@ -34,83 +34,85 @@
|
|
|
- name: Assert slurmctld status
|
|
|
fail:
|
|
|
msg: "{{ slurmctld_status_fail_msg }}"
|
|
|
- when: not slurm_service
|
|
|
+ when: not hostvars[groups['manager'][0]]['slurm_service']
|
|
|
|
|
|
- name: Prepare input config file
|
|
|
block:
|
|
|
- name: Get service tag
|
|
|
- shell: >
|
|
|
+ shell: >
|
|
|
set -o pipefail && \
|
|
|
dmidecode -t 1 | grep Serial
|
|
|
- changed_when: false
|
|
|
- register: service_tag_details
|
|
|
-
|
|
|
- - name: Set fact service tag
|
|
|
- set_fact:
|
|
|
- service_tag: "{{ service_tag_details.stdout.split(':')[1].strip() }}"
|
|
|
-
|
|
|
- - name: Get the hostname
|
|
|
- command: hostname
|
|
|
- register: machine_hostname
|
|
|
- changed_when: false
|
|
|
-
|
|
|
- - name: Update Head Node IP
|
|
|
- replace:
|
|
|
- path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
- regexp: ' ip:.*'
|
|
|
- replace: " ip: {{ groups['manager'][0] }}"
|
|
|
- delegate_to: localhost
|
|
|
-
|
|
|
- - name: Update Head Node hostname
|
|
|
- replace:
|
|
|
- path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
- regexp: ' headnode:.*'
|
|
|
- replace: " headnode: {{ hostvars[groups['manager'][0]]['machine_hostname'].stdout }}"
|
|
|
- delegate_to: localhost
|
|
|
-
|
|
|
- - name: Update nodes hostnames
|
|
|
- lineinfile:
|
|
|
- path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
- line: " {{ machine_hostname.stdout }}: {{ inventory_hostname }}"
|
|
|
- insertafter: "hostnames:"
|
|
|
- delegate_to: localhost
|
|
|
-
|
|
|
- - name: Update service tag info
|
|
|
- lineinfile:
|
|
|
- path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
- line: " - Servicetag: {{ service_tag }}\n Os_Ip_Addr: {{ inventory_hostname }}"
|
|
|
- insertafter: "clusternodes:"
|
|
|
- delegate_to: localhost
|
|
|
-
|
|
|
- - name: Copy initialization file
|
|
|
- copy:
|
|
|
- src: "{{ role_path }}/files/init_k8s_pod_local.sh"
|
|
|
- dest: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
- mode: "{{ monster_config_file_mode }}"
|
|
|
-
|
|
|
- - name: Update manager node details in init_k8s_pod.sh
|
|
|
- replace:
|
|
|
- path: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
- regexp: echo 'manager_node_ip manager_node_hostname' >> /etc/hosts
|
|
|
- replace: echo '{{ inventory_hostname }} {{ machine_hostname.stdout }}' >> /etc/hosts
|
|
|
- delegate_to: localhost
|
|
|
- when: manager_group in group_names
|
|
|
-
|
|
|
- - name: Update manager node IP in init_k8s_pod.sh
|
|
|
- replace:
|
|
|
- path: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
- regexp: ssh-keyscan -H manager_node_hostname >> /root/.ssh/known_hosts
|
|
|
- replace: ssh-keyscan -H {{ machine_hostname.stdout }} >> /root/.ssh/known_hosts
|
|
|
- delegate_to: localhost
|
|
|
- when: manager_group in group_names
|
|
|
-
|
|
|
- - name: Update manager node IP in init_k8s_pod.sh
|
|
|
- replace:
|
|
|
- path: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
- regexp: sshpass -p 'os_passwd' ssh-copy-id 'root@manager_node_ip'
|
|
|
- replace: sshpass -p "{{ hostvars['127.0.0.1']['provision_password'] }}" ssh-copy-id 'root@{{ inventory_hostname }}'
|
|
|
- delegate_to: localhost
|
|
|
- when: manager_group in group_names
|
|
|
+ changed_when: false
|
|
|
+ register: service_tag_details
|
|
|
+
|
|
|
+ - name: Set fact service tag
|
|
|
+ set_fact:
|
|
|
+ service_tag: "{{ service_tag_details.stdout.split(':')[1].strip() }}"
|
|
|
+
|
|
|
+ - name: Get the hostname
|
|
|
+ command: hostname
|
|
|
+ register: machine_hostname
|
|
|
+ changed_when: false
|
|
|
+
|
|
|
+ - name: Update Head Node IP
|
|
|
+ replace:
|
|
|
+ path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
+ regexp: ' ip:.*'
|
|
|
+ replace: " ip: {{ groups['manager'][0] }}"
|
|
|
+ delegate_to: localhost
|
|
|
+
|
|
|
+ - name: Update Head Node hostname
|
|
|
+ replace:
|
|
|
+ path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
+ regexp: ' headnode:.*'
|
|
|
+ replace: " headnode: {{ hostvars[groups['manager'][0]]['machine_hostname'].stdout }}"
|
|
|
+ delegate_to: localhost
|
|
|
+
|
|
|
+ - name: Update nodes hostnames
|
|
|
+ lineinfile:
|
|
|
+ path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
+ line: " {{ machine_hostname.stdout }}: {{ inventory_hostname }}"
|
|
|
+ insertafter: "hostnames:"
|
|
|
+ delegate_to: localhost
|
|
|
+
|
|
|
+ - name: Update service tag info
|
|
|
+ lineinfile:
|
|
|
+ path: "{{ role_path }}{{ monster_input_file_path }}"
|
|
|
+ line: " - Servicetag: {{ service_tag }}\n Os_Ip_Addr: {{ inventory_hostname }}"
|
|
|
+ insertafter: "clusternodes:"
|
|
|
+ delegate_to: localhost
|
|
|
+
|
|
|
+ - name: Copy initialization file
|
|
|
+ copy:
|
|
|
+ src: "{{ role_path }}/files/init_k8s_pod_local.sh"
|
|
|
+ dest: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
+ mode: "{{ monster_config_file_mode }}"
|
|
|
+ delegate_to: localhost
|
|
|
+ when: manager_group in group_names
|
|
|
+
|
|
|
+ - name: Update manager node details in init_k8s_pod.sh
|
|
|
+ replace:
|
|
|
+ path: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
+ regexp: echo 'manager_node_ip manager_node_hostname' >> /etc/hosts
|
|
|
+ replace: echo '{{ inventory_hostname }} {{ machine_hostname.stdout }}' >> /etc/hosts
|
|
|
+ delegate_to: localhost
|
|
|
+ when: manager_group in group_names
|
|
|
+
|
|
|
+ - name: Update manager node IP in init_k8s_pod.sh
|
|
|
+ replace:
|
|
|
+ path: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
+ regexp: ssh-keyscan -H manager_node_hostname >> /root/.ssh/known_hosts
|
|
|
+ replace: ssh-keyscan -H {{ machine_hostname.stdout }} >> /root/.ssh/known_hosts
|
|
|
+ delegate_to: localhost
|
|
|
+ when: manager_group in group_names
|
|
|
+
|
|
|
+ - name: Update manager node IP in init_k8s_pod.sh
|
|
|
+ replace:
|
|
|
+ path: "{{ role_path }}/files/init_k8s_pod.sh"
|
|
|
+ regexp: sshpass -p 'os_passwd' ssh-copy-id 'root@manager_node_ip'
|
|
|
+ replace: sshpass -p "{{ hostvars['127.0.0.1']['provision_password'] }}" ssh-copy-id 'root@{{ inventory_hostname }}'
|
|
|
+ delegate_to: localhost
|
|
|
+ when: manager_group in group_names
|
|
|
|
|
|
when: hostvars[groups['manager'][0]]['slurm_service']
|
|
|
- when: slurm_telemetry_support
|
|
|
+ when: hostvars['127.0.0.1']['slurm_telemetry_support']
|