-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconverge.yml
69 lines (65 loc) · 2.01 KB
/
converge.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
---
- name: Converge slurm rpm host
hosts: builder
tasks:
# replace these tasks with whatever you find suitable to test
- name: Copy something to test use of synchronize module
ansible.builtin.copy:
src: /etc/hosts
dest: /tmp/hosts-from-controller
mode: "0644"
- name: "Include aaltoscicomp.ansible_role_slurm"
ansible.builtin.include_role:
name: "aaltoscicomp.ansible_role_slurm"
- name: Converge all other hosts
hosts: all,!builder
tasks:
# replace these tasks with whatever you find suitable to test
- name: Copy something to test use of synchronize module
ansible.builtin.copy:
src: /etc/hosts
dest: /tmp/hosts-from-controller
mode: "0644"
- name: "Include aaltoscicomp.ansible_role_slurm"
ansible.builtin.include_role:
name: "aaltoscicomp.ansible_role_slurm"
- name: Create test user
hosts: all
tasks:
- name: Add testuser group
ansible.builtin.group:
name: testuser
gid: 2000
state: present
- name: Create test user
ansible.builtin.user:
name: testuser
uid: 2000
group: testuser
create_home: true
- name: Add test user to slurm
hosts: controller
tasks:
- name: Add test slurm account
ansible.builtin.command:
cmd: sacctmgr -i create account name=test
register: test_account_cmd
changed_when: test_account_cmd.rc == 0
failed_when:
- test_account_cmd.rc != 0
- "'Already existing account' not in test_account_cmd.stdout"
- name: Add testuser to test slurm account
ansible.builtin.command:
cmd: sacctmgr -i create user name=testuser account=test
register: test_add_cmd
changed_when: test_add_cmd.rc == 0
failed_when:
- test_add_cmd.rc != 0
- "'Nothing added' not in test_add_cmd.stdout"
- name: Install sudo on submit node
hosts: submit
tasks:
- name: Install sudo
ansible.builtin.package:
name: sudo
state: present