Skip to content

Commit 5bb9807

Browse files
authored
Merge pull request #2 from NREL/vtest-v1.157-cleanup
Removed duplicated config from vtest + fixed state directory being defined for all nodes
2 parents aa807b1 + 48c82cd commit 5bb9807

File tree

16 files changed

+104
-562
lines changed

16 files changed

+104
-562
lines changed

environments/devel/terraform/inventory.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ansible_ssh_common_args='-o ProxyCommand="ssh rocky@${proxy_fip} -W %h:%p"'
66
[control]
77
${control.name} ansible_host=${[for n in control.network: n.fixed_ip_v4 if n.access_network][0]} server_networks='${jsonencode({for net in control.network: net.name => [ net.fixed_ip_v4 ] })}'
88

9+
[control:vars]
10+
appliances_state_dir=/var/lib/state
11+
912
[admin]
1013
${cluster_name}-devadmin
1114

environments/lab/terraform/inventory.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ansible_ssh_common_args='-o ProxyCommand="ssh rocky@${proxy_fip} -W %h:%p"'
66
[control]
77
${control.name} ansible_host=${[for n in control.network: n.fixed_ip_v4 if n.access_network][0]} server_networks='${jsonencode({for net in control.network: net.name => [ net.fixed_ip_v4 ] })}'
88

9+
[control:vars]
10+
appliances_state_dir=/var/lib/state
11+
912
[login]
1013
%{ for login in logins ~}
1114
${login.name} ansible_host=${[for n in login.network: n.fixed_ip_v4 if n.access_network][0]} server_networks='${jsonencode({for net in login.network: net.name => [ net.fixed_ip_v4 ] })}'

environments/nrel/hooks/pre.yml

Lines changed: 88 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,88 @@
11
---
22

3+
- name: "Add a stack admin user"
4+
hosts: all
5+
# tags: pre_tasks_all
6+
become: true
7+
gather_facts: true
8+
tasks:
9+
- name: Does localhome/stack dir exist
10+
ansible.builtin.stat:
11+
path: /localhome/stack
12+
register: localstack
13+
14+
# - name: Does localhome/rocky dir exist
15+
# ansible.builtin.stat:
16+
# path: /localhome/rocky
17+
# register: localrockyuserdir
18+
19+
- name: Add stack user
20+
ansible.builtin.include_role:
21+
name: vs.core.stack_user
22+
when: not localstack.stat.exists
23+
24+
# - name: Add rocky user role
25+
# ansible.builtin.include_role:
26+
# name: vshpc.rocky_user
27+
# when: not localrockyuserdir.stat.exists
28+
# tags:
29+
# - add_stack_user
30+
tags:
31+
- add_stack_user
32+
33+
- name: A cp user home to /var/lib/USER
34+
hosts: all
35+
# tags: pre_tasks_all
36+
become: true
37+
gather_facts: false
38+
39+
# tasks:
40+
# - name: Does home/USER dir exist
41+
# ansible.builtin.stat:
42+
# path: "/home/{{ appliances_local_users_ansible_user_name }}"
43+
# register: homerocky
44+
45+
# - name: Does var/lib/rocky dir exist
46+
# ansible.builtin.stat:
47+
# path: "/var/lib/{{ appliances_local_users_ansible_user_name }}"
48+
# register: varlibrocky
49+
50+
# - name: Cp homerocky to var/lib/ dir
51+
# ansible.builtin.command: cp -a /home/{{ appliances_local_users_ansible_user_name }} /var/lib/{{ appliances_local_users_ansible_user_name }}
52+
# when:
53+
# - homerocky.stat.exists
54+
# register: cph
55+
# changed_when: cph.rc != 0
56+
57+
# # - name: cp auth_keys
58+
# # shell: |
59+
# # cp -a /home/rocky/.ssh /var/lib/rocky/.ssh
60+
# # when:
61+
# # - varlibrocky.stat.exists
62+
# # - homerocky.stat.exists
63+
64+
# - name: Hack passwd file for localhome/rocky
65+
# ansible.builtin.lineinfile:
66+
# path: /etc/passwd
67+
# regexp: '^rocky.*1000.*'
68+
# line: "rocky:x:1000:1000:vsRockyUser:/var/lib/{{ appliances_local_users_ansible_user_name }}:/bin/bash"
69+
# tags:
70+
# - rocky_localhome
71+
372
- name: "Do the preliminary node setups"
473
hosts: all
574
# tags: pre_tasks_all
675
become: true
776
tasks:
8-
- include_role:
77+
- name: Does vs_pre_complete.txt exist
78+
ansible.builtin.stat:
79+
path: /root/vs_pre_complete.txt
80+
register: vs_pre_complete
81+
82+
- name: Pre tasks now
83+
ansible.builtin.include_role:
984
name: vshpc.prov.pre-tasks
85+
when: not vs_pre_complete.stat.exists
1086

1187
# TODO: KBENDL - check compatibility with new playbook
1288
- name: "NREL pre - Mount cephfs volumes"
@@ -16,80 +92,17 @@
1692
- aco.core.cephfs
1793
become: true
1894
tasks:
19-
- include_role:
95+
- name: Does ceph exist?
96+
ansible.builtin.stat:
97+
path: /etc/ceph
98+
register: vs_does_cephdir
99+
- name: CephFS now
100+
ansible.builtin.include_role:
20101
name: aco.core.cephfs
21102
tags:
22103
- aco.core.cephfs
23-
24-
# - name: Set timezone to Americas/Denver
25-
# timezone:
26-
# name: America/Denver
27-
# tags:
28-
# - pre_set_time_on_servers
29-
30-
# - include_role:
31-
# name: aco.core.ntp
32-
# tags:
33-
# - pre_set_time_on_servers
34-
35-
# - name: "NREL PRE - dnf packages"
36-
# hosts: all
37-
# tags: dnf_initial_update
38-
# become: true
39-
# tasks:
40-
# - lineinfile:
41-
# path: /etc/yum.repos.d/cuda-rhel8.repo
42-
# regexp: '^enabled'
43-
# line: enabled=0
44-
45-
# - name: dnf fix challenging dependency issues
46-
# dnf:
47-
# name: "*"
48-
# nobest: true
49-
# allowerasing: true
50-
# skip_broken: true
51-
52-
# - name: "NREL pre - set cluster root password"
53-
# hosts: all
54-
# tags: root_pass_cli
55-
# become: true
56-
# tasks:
57-
# - name: include root if called
58-
# include_role:
59-
# name: root_pass_cli
60-
# when: new_root_pass is defined
61-
62-
# - name: "NREL pre - set admin hostnames to hpc.nrel.gov domain"
63-
# hosts: control,login
64-
# tags: set_hpc_hostname
65-
# become: true
66-
# tasks:
67-
# - shell: "hostnamectl set-hostname {{ ansible_hostname }}.hpc.nrel.gov"
68-
69-
# This may be fixed now
70-
# # ref: Error: cannot setup namespace using "/usr/bin/newuidmap": should have setuid or have filecaps setuid:
71-
# - name: "podman uid-gid workaround"
72-
# hosts:
73-
# - cluster
74-
# become: true
75-
# tags:
76-
# - vs_pre
77-
# - uid_gid_hack
78-
# tasks:
79-
# - name: "set newuidmap/newgidmap perms so containers will start"
80-
# file:
81-
# path: "{{ item }}"
82-
# mode: '4755'
83-
# loop:
84-
# - /usr/bin/newgidmap
85-
# - /usr/bin/newuidmap
86-
87-
# TODO - get latest playbook
88-
# - name: Ensure yum repos are local
89-
# hosts: all
90-
# tags: ansible_yum_config
91-
# become: true
92-
# tasks:
93-
# - include_role:
94-
# name: ansible_yum_config
95-
# [email protected]:acoinf/vshpc.prov.pre-tasks.git
104+
when: not vs_does_cephdir.stat.exists
105+
- name: Tmp umount /home
106+
ansible.builtin.shell: systemctl stop home.mount
107+
when: not vs_does_cephdir.stat.exists
108+
become: true

environments/nrel/inventory/group_vars/all/defaults.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

environments/vtest/inventory/group_vars/openhpc/overrides.yml renamed to environments/nrel/inventory/group_vars/all/openhpc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ openhpc_generic_packages:
4444
- munge
4545
- mariadb-connector-c # only actually needed on slurmdbd
4646
- hwloc-libs # only actuall needed on slurmd
47-
4847
# below added here to get pingpong and pingmatrix hpctests working:
4948
- mpitests-openmpi
5049

environments/nrel/inventory/group_vars/all/secrets_ceph.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

environments/nrel/inventory/group_vars/hpctests/overrides.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

environments/nrel/inventory/group_vars/openhpc/overrides.yml

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)