-
Notifications
You must be signed in to change notification settings - Fork 40
/
main.yaml
41 lines (37 loc) · 1.84 KB
/
main.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
---
- name: Almost there! Add host info to /etc/hosts so you can login to the cluster via web browser. Ansible Controller sudo password required
tags: wait_for_install_complete
become: true
blockinfile:
create: true
backup: true
marker: "# {mark} ANSIBLE MANAGED BLOCK FOR OCP CLUSTER: {{ env.cluster.networking.metadata_name }}"
path: /etc/hosts
block: |
{{ env.bastion.networking.ip }} oauth-openshift.apps.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}
{{ env.bastion.networking.ip }} console-openshift-console.apps.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}
{{ env.bastion.networking.ip }} api.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}
delegate_to: 127.0.0.1
- name: Get OCP URL
tags: wait_for_install_complete
set_fact:
ocp_url: https://console-openshift-console.apps.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}
- name: Get OCP temporary password
tags: wait_for_install_complete
command: "cat /root/ocpinst/auth/kubeadmin-password"
register: ocp_passwd
changed_when: false
- name: "Additional step, if using NAT"
tags: wait_for_install_complete
debug:
msg: "NAT USERS ONLY: Create SSH tunnel to cluster, i.e run command in terminal window from controller: 'sshuttle -r {{ env.bastion.access.user }}@{{ env.bastion.networking.ip }} 192.168.122.0/15 --dns'"
when: ( env.network_mode | upper == "NAT" )
changed_when: false
- name: Congratulations! OpenShift installation complete. Use the information below for first-time login via web browser.
tags: wait_for_install_complete
command: "echo {{ item }}"
loop:
- " URL: {{ ocp_url }} "
- " Username: kubeadmin "
- " Password: {{ ocp_passwd.stdout }} "
changed_when: false