|
1 | 1 | ---
|
2 | 2 |
|
| 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 | + |
3 | 72 | - name: "Do the preliminary node setups"
|
4 | 73 | hosts: all
|
5 | 74 | # tags: pre_tasks_all
|
6 | 75 | become: true
|
7 | 76 | 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: |
9 | 84 | name: vshpc.prov.pre-tasks
|
| 85 | + when: not vs_pre_complete.stat.exists |
10 | 86 |
|
11 | 87 | # TODO: KBENDL - check compatibility with new playbook
|
12 | 88 | - name: "NREL pre - Mount cephfs volumes"
|
|
16 | 92 | - aco.core.cephfs
|
17 | 93 | become: true
|
18 | 94 | 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: |
20 | 101 | name: aco.core.cephfs
|
21 | 102 | tags:
|
22 | 103 | - 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 |
0 commit comments