|
1 | 1 | ---
|
| 2 | + |
2 | 3 | - name: Translate engagement data into Argo-processable resources
|
3 | 4 | hosts: local
|
4 | 5 | gather_facts: false
|
5 | 6 | tasks:
|
6 |
| - - name: Read Engagement Data |
7 |
| - include_vars: |
8 |
| - file: "{{ directory }}/engagement.json" |
9 |
| - - name: Read credentials |
10 |
| - include_vars: |
11 |
| - file: "{{ directory }}/{{ config_dir }}/{{ item }}" |
12 |
| - loop: |
13 |
| - - "ocp-admin-credentials.json" |
14 |
| - - "ocp-ldap-sa-credentials.json" |
15 |
| - when: ocp_version is defined |
16 |
| - - name: Create OCP manifest directory if not present |
17 |
| - file: |
18 |
| - path: "{{ directory }}/ocp-init" |
19 |
| - state: directory |
20 |
| - - name: Assemble Anarchy Governor Name |
21 |
| - set_fact: |
22 |
| - governor_name: "{{ 'labs.ocp4.' + (engagement_region | default('dev-1') | lower) }}" |
23 |
| - - name: Add Claim Content |
24 |
| - set_fact: |
25 |
| - claim_content: |
26 |
| - email: "{{ engagement_lead_email }}" |
27 |
| - admin_user: "{{ ocp_admin_username }}" |
28 |
| - admin_password: "{{ ocp_admin_password }}" |
29 |
| - aws_region: "{{ ocp_cloud_provider_region }}" |
30 |
| - ocp4_installer_version: "{{ ocp_version }}" |
31 |
| - ocp_ldap_sa_user: "{{ ocp_ldap_sa_username }}" |
32 |
| - ocp_ldap_sa_password: "{{ ocp_ldap_sa_password }}" |
33 |
| - ocp_subdomain: "{{ ocp_sub_domain }}" |
34 |
| - - name: Create Resource Claim |
35 |
| - copy: |
36 |
| - content: "{{ lookup('template', inventory_dir + '/../files/templates/resourceclaim.yaml.j2') }}" |
37 |
| - dest: "{{ directory }}/ocp-init/cluster-init.yaml" |
| 7 | + - name: Read Engagement Data |
| 8 | + include_vars: |
| 9 | + file: "{{ directory }}/engagement.json" |
| 10 | + - block: |
| 11 | + - name: Set fact used to check if a hosting environment is needed |
| 12 | + set_fact: |
| 13 | + ocp_cloud_provider_name: "{{ hosting_environments[0].ocp_cloud_provider_name | default('other') }}" |
| 14 | + - block: |
| 15 | + - name: Read credentials |
| 16 | + include_vars: |
| 17 | + file: "{{ directory }}/{{ config_dir }}/{{ item }}" |
| 18 | + loop: |
| 19 | + - "ocp-admin-credentials.json" |
| 20 | + - "ocp-ldap-sa-credentials.json" |
| 21 | + - name: Create OCP manifest directory if not present |
| 22 | + file: |
| 23 | + path: "{{ directory }}/ocp-init" |
| 24 | + state: directory |
| 25 | + - name: Assemble Anarchy Governor Name |
| 26 | + set_fact: |
| 27 | + governor_name: "{{ 'labs.ocp4.' + (engagement_region | default('dev-1') | lower) }}" |
| 28 | + - name: Create Resource Claim |
| 29 | + vars: |
| 30 | + claim_content: |
| 31 | + email: "{{ engagement_lead_email }}" |
| 32 | + admin_user: "{{ ocp_admin_username }}" |
| 33 | + admin_password: "{{ ocp_admin_password }}" |
| 34 | + aws_region: "{{ hosting_environments[0].ocp_cloud_provider_region }}" |
| 35 | + ocp4_installer_version: "{{ hosting_environments[0].ocp_version }}" |
| 36 | + ocp_ldap_sa_user: "{{ ocp_ldap_sa_username }}" |
| 37 | + ocp_ldap_sa_password: "{{ ocp_ldap_sa_password }}" |
| 38 | + ocp_subdomain: "{{ hosting_environments[0].ocp_sub_domain }}" |
| 39 | + copy: |
| 40 | + content: "{{ lookup('template', inventory_dir + '/../files/templates/resourceclaim.yaml.j2') }}" |
| 41 | + dest: "{{ directory }}/ocp-init/cluster-init.yaml" |
| 42 | + when: |
| 43 | + - ocp_cloud_provider_name|trim != 'other' |
| 44 | + when: |
| 45 | + - hosting_environments is defined |
| 46 | + - hosting_environments|length > 0 |
| 47 | + |
0 commit comments