-
Notifications
You must be signed in to change notification settings - Fork 4
/
createuser_module.yml
52 lines (47 loc) · 1.51 KB
/
createuser_module.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
- name: Create ansible user with admin role using hypercore.user module
hosts: edge # use ansible-playbook -l group to limit application to specific groups
connection: local
strategy: free # host_pinned # free #allows each cluster to start next task before all clusters have finished current task
environment: #if set here - hypercore modules will automatically use this for each remote cluster - avoiding need to specify cluster_instance for each test
SC_HOST: "https://{{ inventory_hostname }}"
SC_USERNAME: "{{ scale_admin_user }}"
SC_PASSWORD: "{{ scale_admin_pass }}"
tasks:
- name: Create ansible user account
scale_computing.hypercore.user:
state: present
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
full_name: ansible (complex password)
session_limit: 0
roles:
- Admin
async: 60
poll: 0
changed_when: false #password specified always results in change - this blocks that
- name: Create acronis user account
scale_computing.hypercore.user:
state: present
username: acronis
password: acronis
full_name: acronis
session_limit: 0
roles:
- Read
- Backup
- VM Create/Edit
- VM Power Controls
async: 60
poll: 0
changed_when: false
- name: remove former users
scale_computing.hypercore.user:
state: absent
username: "{{ item }}"
loop:
- bcnu
- badIT
- byebye
async: 60
poll: 0
changed_when: false