File tree Expand file tree Collapse file tree 8 files changed +43
-1
lines changed
generate-ocp-admin-credentials
translate-engagement-data Expand file tree Collapse file tree 8 files changed +43
-1
lines changed Original file line number Diff line number Diff line change
1
+ # generate-ocp-admin-credentials
2
+
3
+ An Ansible playbook for generating the ` ocp-admin-credentials.json ` file for OCP resources to be consumed by other operators & tools.
Original file line number Diff line number Diff line change
1
+ ---
Original file line number Diff line number Diff line change
1
+ ansible_connection : local
Original file line number Diff line number Diff line change
1
+ [local]
2
+ localhost
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Generate admin password for OCP
3
+ hosts : local
4
+ gather_facts : false
5
+ tasks :
6
+ - name : Set credentials file
7
+ set_fact :
8
+ ocp_credentials_file : " {{ directory }}/ocp-admin-credentials.json"
9
+ - name : Check if credentials file already exist
10
+ stat :
11
+ path : " {{ ocp_credentials_file }}"
12
+ register : r_ocp_credentials_file
13
+ - name : Read Engagement Data
14
+ include_vars :
15
+ file : " {{ directory }}/engagement.json"
16
+ - name : Only if credentials haven't already been created
17
+ block :
18
+ - name : Create OCP password
19
+ set_fact :
20
+ ocp_password : " {{ lookup('password', '/dev/null length=32') }}"
21
+ - name : Create OCP credentials file
22
+ copy :
23
+ dest : " {{ ocp_credentials_file }}"
24
+ content : " {{ {'ocp_admin_username':'admin','ocp_admin_password':ocp_password } | to_nice_json }}"
25
+ when :
26
+ - r_ocp_credentials_file.stat.exists == False
27
+ - ocp_version is defined
Original file line number Diff line number Diff line change 20
20
governor: labs.ocp4.na
21
21
vars:
22
22
job_vars:
23
+ admin_user: {{ .Values.ocp.admin_username }}
24
+ admin_password: {{ .Values.ocp.admin_password }}
23
25
aws_region: {{ .Values.ocp.cloud_region }}
24
26
ocp4_installer_version: {{ .Values.ocp.version }}
25
27
ocp_subdomain: {{ .Values.ocp.sub_domain }}
Original file line number Diff line number Diff line change 1
1
email: {{ engagement_lead_email }}
2
2
ocp:
3
+ admin_username: {{ ocp_admin_username }}
4
+ admin_password: {{ ocp_admin_password }}
3
5
cloud_provider: {{ ocp_cloud_provider_name }}
4
6
cloud_region: {{ ocp_cloud_provider_region }}
5
7
cluster_size: {{ ocp_cluster_size }}
Original file line number Diff line number Diff line change 6
6
- name : Read Engagement Data
7
7
include_vars :
8
8
file : " {{ directory }}/engagement.json"
9
+ - name : Read OCP credentials
10
+ include_vars :
11
+ file : " {{ directory }}/ocp-admin-credentials.json"
12
+ when : ocp_version is defined
9
13
- name : Create OCP Chart directory if not exists
10
14
file :
11
15
path : " {{ directory }}/ocp-init"
25
29
src : " {{ item }}"
26
30
dest : " {{ directory }}/ocp-init/templates/{{ item | basename | regex_replace('\\ .j2$', '.yaml') }}"
27
31
with_fileglob :
28
- - ocp-init/templates/*.j2
32
+ - ocp-init/templates/*.j2
You can’t perform that action at this time.
0 commit comments