File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,35 @@ pve_ssl_certificate: "{{ lookup('file', ssl_host_cert_path) }}"
15
15
pve_cluster_enabled: yes
16
16
pve_datacenter_cfg:
17
17
console: xtermjs
18
+ pve_domains_cfg:
19
+ - name: pam
20
+ type: pam
21
+ attributes:
22
+ comment: Linux PAM standard authentication
23
+ - name: pve
24
+ type: pve
25
+ attributes:
26
+ comment: Proxmox VE authentication server
27
+ - name: ad
28
+ type: ad
29
+ attributes:
30
+ comment: Active Directory authentication
31
+ domain: yourdomain.com
32
+ server1: dc01.yourdomain.com
33
+ default: 1
34
+ secure: 1
35
+ server2: dc02.yourdomain.com
36
+ - name: ldap
37
+ type: ldap
38
+ attributes:
39
+ comment: LDAP authentication
40
+ base_dn: CN=Users,dc=yourdomain,dc=com
41
+ bind_dn: "uid=svc-reader,CN=Users,dc=yourdomain,dc=com"
42
+ bind_password: "my-password"
43
+ server1: ldap1.yourdomain.com
44
+ user_attr: uid
45
+ secure: 1
46
+ server2: ldap2.yourdomain.com
18
47
pve_cluster_ha_groups:
19
48
- name: proxmox_5_01
20
49
comment: "Resources on proxmox-5-01"
Original file line number Diff line number Diff line change 16
16
vars :
17
17
query : " ([?type=='cluster'].quorate)[0]"
18
18
19
+ - name : Query PVE realms
20
+ shell : " pvesh get /access/domains --output=json"
21
+ register : _pve_realms
22
+ changed_when : False
23
+
24
+ - name : Construct realm list
25
+ set_fact :
26
+ realm_list : " {{ realm_list | default([]) }} + [ '{{ item.type }}' ]"
27
+ with_items : " {{ pve_domains_cfg }}"
28
+
29
+ - name : Check that PVE realms exist
30
+ assert :
31
+ that : " realm_list is subset(_pve_realms.stdout | from_json | json_query(query))"
32
+ vars :
33
+ query : " [*].type"
34
+ run_once : True
35
+
36
+ - name : Check PVE realms configuration
37
+ assert :
38
+ that :
39
+ - item.type == realm.type
40
+ - item.name == realm.realm
41
+ - item.attributes.comment == realm.comment
42
+ vars :
43
+ realm : ' {{ _pve_realms.stdout | from_json
44
+ | json_query("[?realm=='' " + item.name + "'' ]") | first }}'
45
+ with_items : " {{ pve_domains_cfg }}"
46
+
19
47
- name : Query PVE groups
20
48
shell : " pvesh get /access/groups --output=json"
21
49
register : _pve_groups
You can’t perform that action at this time.
0 commit comments