Josh Disraeli
2020-03-06 8a518d953d2ebd796c69714538e5059cbdaa1db7
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
75
76
77
78
79
---
# Implement your Post Workload deployment tasks here
- name: Delete the remote files used in this role
  file:
    path: /tmp/{{guid}}
    state: absent
 
- name: Print no SSH
  debug:
    msg: "user.info: {{ item }}"
  with_items:
    - ""
    - '**********'
    - 'IMPORTANT: You cannot SSH into the shared cluster.'
    - Please refer to the demo or lab instructions in order
    - to get the steps on how to access the environment properly.
    - '**********'
    - ""
 
- name: Get console route
  command: oc get route -n openshift-console console -o json
  register: routeconsole
  ignore_errors: yes
 
- name: Set webconsole address
  when: routeconsole is succeeded
  set_fact:
    webconsole: "http://{{ routeconsole.stdout | from_json | json_query('spec.host') }}"
 
- name: Print Overview
  when: routeconsole is succeeded
  debug:
    msg: "{{ item }}"
  with_items:
    - "user.info: Openshift Master Console: {{ webconsole }}"
 
- name: Get API for command line
  command: oc whoami --show-server
  register: showserver
  ignore_errors: yes
 
- name: Print Overview
  when: showserver is succeeded
  debug:
    msg: "user.info: {{ item }}"
  with_items:
    - "Openshift API for command line 'oc' client: {{ showserver.stdout | trim }}"
 
- name: Print Overview
  when: showserver is succeeded
  debug:
    msg: "user.info: {{ item }}"
  with_items:
    - "Openshift API for command line 'oc' client: {{ showserver.stdout | trim }}"
 
- name: Print Overview
  when: showserver is succeeded
  debug:
    msg: "user.info: {{ item }}"
  with_items:
    - "Openshift API for command line 'oc' client: {{ showserver.stdout | trim }}"
#
# Leave this as the last task in the playbook.
# For deployment onto a dedicated cluster (as part of the
# cluster deployment) set workload_shared_deployment to False
# This is the default so it does not have to be set explicitely
- name: pre_workload tasks complete
  debug:
    msg: "Pre-Workload tasks completed successfully."
  when:
  - not silent|bool
  - not workload_shared_deployment|d(True)
 
- name: post_workload tasks completed
  debug:
    msg: "Post-Workload tasks completed successfully."
  when:
  - not silent|bool
  - not workload_shared_deployment|d(True)