-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.yaml
97 lines (70 loc) · 3.16 KB
/
test.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
- name: test
hosts: localhost
become: false
gather_facts: false
vars:
ansible_connection: local
nfc_pb_keycloak_auth_keycloak_url: https://keycloak.local
nfc_pb_keycloak_auth_realm: master
nfc_pb_keycloak_auth_username: admin
nfc_pb_keycloak_auth_password: admin
nfc_pb_keycloak_validate_certs: false
# nfc_pb_awx_controller_host: https://awx.local
# nfc_pb_awx_controller_username: admin
# nfc_pb_awx_controller_password: OlHYvV5nYCkDPqgtLUsKCps5wlW7cqHv
tasks:
# - name: Tester
# community.general.keycloak_clientsecret_info:
# auth_keycloak_url: "{{ nfc_pb_keycloak_auth_keycloak_url }}"
# auth_realm: "{{ nfc_pb_keycloak_auth_realm }}"
# auth_username: "{{ nfc_pb_keycloak_auth_username }}"
# auth_password: "{{ nfc_pb_keycloak_auth_password }}"
# validate_certs: "{{ nfc_pb_keycloak_validate_certs | default(true) }}"
# client_id: 'https://cloud.nofusscomputing.com/apps/user_saml/saml/metadata'
# realm: nofusscomputing
############################ worflow import-export tests
# - name: test export
# awx.awx.export:
# controller_host: "{{ nfc_pb_awx_controller_host | default(omit) }}"
# controller_oauthtoken: "{{ nfc_pb_awx_controller_oauthtoken | default(omit) }}"
# controller_username: "{{ nfc_pb_awx_controller_username | default(omit) }}"
# controller_password: "{{ nfc_pb_awx_controller_password | default(omit) }}"
# validate_certs: "{{ validate_certs | default(true) }}"
# workflow_job_templates:
# - 20
# # - 21
# # - 15
# # - 39
# register: exported_item
# - name: Output
# ansible.builtin.debug:
# msg: "{{ exported_item.assets.workflow_job_templates[0] | from_yaml | to_nice_yaml }}"
# # - name: Create fact from Playbook
# # ansible.builtin.set_fact:
# # workflow_job_template: "{{ lookup('file', '/etc/ansible/playbooks/workflows/backup-daily.yaml') | from_yaml }}"
# # failed_when: false
# # ignore_errors: true
# # - name: Add Workflow templates
# # ansible.builtin.include_tasks:
# # file: tasks/awx/workflow_template.yaml
######################################## keycloak tests
- name: Fetch SAML Public Certificate
ansible.builtin.uri:
url: "https://keycloak.local/realms/nofusscomputing/protocol/saml/descriptor"
return_content: true
validate_certs: false
register: nfc_pb_keycloak_saml_certificate
- ansible.builtin.set_fact:
nfc_pb_keycloak_saml_certificate: "{{ nfc_pb_keycloak_saml_certificate.content | ansible.utils.from_xml('xmltodict') }}"
- name: Create Certificate Fact
ansible.builtin.set_fact:
nfc_pb_keycloak_saml_certificate: "{{
nfc_pb_keycloak_saml_certificate['md:EntityDescriptor']['md:IDPSSODescriptor']
['md:KeyDescriptor']['ds:KeyInfo']['ds:X509Data']['ds:X509Certificate'] }}"
- name: Set artifact
ansible.builtin.set_stats:
data:
nfc_pb_keycloak_saml_certificate: "{{ nfc_pb_keycloak_saml_certificate }}"
per_host: false
aggregate: true