-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecteam_users.yaml
66 lines (58 loc) · 1.78 KB
/
secteam_users.yaml
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
---
- hosts: cvm-siem
become: true
become_method: sudo
remote_user: alf
gather_facts: false
vars:
# Define your username and password here that you want to create on target hosts.
iusername: ivar
iuserpass: MP3qfpIEzjL
gusername: geir
guserpass: AZU5lP0jQU2
kusername: kjartan
kuserpass: hwxit1hwuBN
super_group: sudo
tasks:
- name: Create User Ivar
ansible.builtin.user:
name: "{{ iusername }}"
state: present
shell: /bin/bash
password: "{{ iuserpass | password_hash('sha512') }}"
update_password: on_create
groups: "{{ super_group }}"
append: yes
- name: Deploy SSH Public Key
ansible.posix.authorized_key:
user: "{{ iusername }}"
state: present
key: "{{ lookup('file', '/home/alf/ivar_id_rsa.pub') }}"
- name: Create User Geir
ansible.builtin.user:
name: "{{ gusername }}"
state: present
shell: /bin/bash
password: "{{ guserpass | password_hash('sha512') }}"
update_password: on_create
groups: "{{ super_group }}"
append: yes
- name: Deploy SSH Public Key
ansible.posix.authorized_key:
user: "{{ gusername }}"
state: present
key: "{{ lookup('file', '/home/alf/geir_id_rsa.pub') }}"
- name: Create User Kjartan
ansible.builtin.user:
name: "{{ kusername }}"
state: present
shell: /bin/bash
password: "{{ kuserpass | password_hash('sha512') }}"
update_password: on_create
groups: "{{ super_group }}"
append: yes
- name: Deploy SSH Public Key
ansible.posix.authorized_key:
user: "{{ kusername }}"
state: present
key: "{{ lookup('file', '/home/alf/kjartan_id_rsa.pub') }}"