forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post_infra.yml
48 lines (45 loc) · 1.55 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
- name: Step 002 Post Infrastructure
hosts: localhost
connection: local
become: 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: Azure Post Infrastructure
when: cloud_provider is match("azure")
block:
- 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
debug:
msg: "{{ item }}"
with_items:
- "user.info: Remote User: {{ remote_user }}"
- "user.info: RHEL Bastion Host: {{ rhel_remote_host }}"
- "user.info: Windows Host(s): {{ windows_remote_hosts }}"
- "user.info: Windows Password: {{ windows_password }}"