forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpost_infra.yml
74 lines (69 loc) · 2.53 KB
/
post_infra.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: Step 002 - Post Infrastructure
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step002
- post_infrastructure
tasks:
- name: OpenStack Post Infrastructure
when: cloud_provider is match("osp")
environment:
OS_AUTH_URL: "{{ osp_auth_url }}"
OS_USERNAME: "{{ osp_auth_username }}"
OS_PASSWORD: "{{ osp_auth_password }}"
OS_PROJECT_NAME: "{{ osp_project_name }}"
OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}"
OS_USER_DOMAIN_NAME: "{{ osp_auth_user_domain }}"
block:
- name: OpenShift Floating IPs on OpenStack
include_role:
name: ocp-infra-osp-fip
- name: GCP Post Infrastructure
when: cloud_provider is match("gcp")
block:
- name: Create secret for SSH Key
include_role:
name: infra-gcp-ssh-key
- name: EC2 Post Infrastructure
when: cloud_provider is match("ec2")
block:
- name: get Route53User credentials from stack outputs
set_fact:
route53user: "{{ cloudformation_out_final.stack_outputs.Route53User }}"
route53user_access_key: "{{ cloudformation_out_final.stack_outputs.Route53UserAccessKey }}"
route53user_secret_access_key: "{{ cloudformation_out_final.stack_outputs.Route53UserSecretAccessKey }}"
when:
- cloudformation_out_final is defined
- cloudformation_out_final.stack_outputs.Route53UserAccessKey is defined
- cloudformation_out_final.stack_outputs.Route53UserSecretAccessKey is defined
- name: Azure Post Infrastructure
when: cloud_provider is match("azure")
block:
- name: Store SSH Key in shared keyvault
include_role:
name: infra-azure-ssh-key
- name: Set FQDN for the bastion VM
when: item.name is match('bastion')
set_fact:
rhel_remote_host: "{{item.fqdns|d(item.publicIps)|d('')}}"
with_items: "{{vm_list}}"
- name: Set FQDN for each Windows VM
set_fact:
windows_remote_hosts: ""
- name: Set FQDN for each Windows VM
when: item.name is match ('vmwin*')
set_fact:
windows_remote_hosts: "{{item.fqdns|d(item.publicIps)|d('')}},{{windows_remote_hosts}}"
with_items: "{{vm_list}}"
- name: Print Host Information
agnosticd_user_info:
msg: "{{ item }}"
loop:
- "Remote User: {{ remote_user }}"
- "RHEL Bastion Host: {{ rhel_remote_host }}"
- "Windows Host(s): {{ windows_remote_hosts }}"
- "Windows Password: {{ windows_password }}"
when: ocp4_cluster_show_access_user_info | bool