-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelcompute.yml
65 lines (64 loc) · 1.65 KB
/
elcompute.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
- hosts: elcapitan_compute
order: sorted
strategy: free
vars:
users:
- name: 'glogashenko'
uid: 1011
groups : "wheel"
- name: "mlen2"
uid: 623
groups: 'wheel'
- name: "aparopkari"
groups: "wheel"
uid: 1005
tasks:
- name: Disable SELinux
selinux:
policy: targeted
state: disabled
- name: Create the slurm conf directory
file:
path: /etc/slurm
owner: root
group: root
mode: o=rx
state: directory
mode: o=rx
- name: copy slurm conf
copy:
src: etc/slurm/slurm.conf
dest: /etc/slurm/slurm.conf
owner: root
group: root
- name: Make sure munge is started for slurm authentication
systemd:
state: started
enabled: yes
name: munge
- name: Make sure slurmd is started for job submission
systemd:
state: restarted
enabled : yes
name: slurmd
- name: Add Matthias account as a sudoers.
user:
update_password: on_create
name: mbussonnier
comment: Matthias Bussonnier
uid: 1001
password: $6$c6QlFGDbfQoQ/WPm$WmBLKGSZ4poAwJQQqyyNMTO0tiTaFzprgLQouPUq2yVe6V27XItZLnvv9qd1FJ7/EHm4cPCqzwyP3qLothao90
groups: wheel
- name: Set authorized key for user ubuntu copying it from current user
authorized_key:
user: mbussonnier
state: present
key: "{{ lookup('file', '/home/mbussonnier/.ssh/id_rsa.pub') }}"
- name: Create users accounts.
user:
update_password: on_create
name: "{{item['name']}}"
comment: "The comments"
uid: "{{item['uid']}}"
groups: "{{item['groups']}}"
loop: "{{users}}"