Skip to content

Commit 54b4585

Browse files
committed
sorry for anyone using this branch, probably going to break it 4u
1 parent 9a8d952 commit 54b4585

File tree

3 files changed

+60
-21
lines changed

3 files changed

+60
-21
lines changed

openshift/cnv/provision_rhel.yml

+7
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,10 @@
8888
rh_subscription:
8989
activation-key: "{{ rh_subscription_key }}"
9090
org: "{{ rh_subscription_org }}"
91+
92+
# Normally we could wait for SSH to be up and running, however,
93+
# we don't know the IP address (or have name resolution) of the VM
94+
# until after the inventory sync occurs
95+
- name: Wait 5 seconds to install because anything else is hard
96+
ansible.builtin.pause:
97+
seconds: 5

openshift/cnv/wait.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
# vars:
3+
# wait_hosts:
4+
#
5+
- name: Wait for VMs to start and become ready
6+
host: "{{ _hosts }}"
7+
tasks:
8+
- name: Wait for
9+
ansible.builtin.wait_for:
10+
port: 22
11+
host: "{{ (ansible_ssh_host|default(ansible_host))|default(inventory_hostname) }}"
12+
search_regex: OpenSSH
13+
delay: 10
14+
vars:
15+
ansible_connection: local

openshift/setup.yml

+38-21
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ controller_credential_types:
1818
kind: cloud
1919
inputs:
2020
fields:
21-
- id: auth_host
21+
- id: host
2222
type: string
23-
label: auth_host
23+
label: OpenShift or Kubernetes API Endpoint
2424
secret: false
25-
- id: auth_api_key
25+
- id: bearer_token
2626
type: string
27-
label: auth_api_key
27+
label: API authentication bearer token
2828
secret: true
29-
- id: auth_verify_ssl
29+
- id: verify_ssl
3030
type: boolean
31-
label: auth_verify_ssl
31+
label: Verify SSL
3232
injectors:
3333
env:
34-
K8S_AUTH_HOST: "{% raw %}{ { auth_host }}{% endraw %}"
35-
K8S_AUTH_API_KEY: "{% raw %}{ { auth_api_key }}{% endraw %}"
36-
K8S_AUTH_VERIFY_SSL: "{% raw %}{ { auth_verify_ssl }}{% endraw %}"
34+
K8S_AUTH_HOST: "{% raw %}{ { host }}{% endraw %}"
35+
K8S_AUTH_API_KEY: "{% raw %}{ { bearer_token }}{% endraw %}"
36+
K8S_AUTH_VERIFY_SSL: "{% raw %}{ { verify_ssl }}{% endraw %}"
3737

3838
controller_credentials:
3939
- name: OpenShift Credential
@@ -50,17 +50,9 @@ controller_credentials:
5050
credential_type: OCPV inventory credential
5151
state: exists
5252
inputs:
53-
auth_host: CHANGEME
54-
auth_api_key: CHANGEME
55-
auth_verify_ssl: false
56-
57-
- name: OpenShift CNV Machine Credential
58-
organization: Default
59-
credential_type: Machine
60-
state: exists
61-
inputs:
62-
username: CHANGEME
63-
password: CHANGEME
53+
host: CHANGEME
54+
bearer_token: CHANGEME
55+
verify_ssl: false
6456

6557
controller_inventory_sources:
6658
- name: OpenShift CNV Inventory
@@ -95,6 +87,7 @@ controller_templates:
9587
notification_templates_success: Telemetry
9688
notification_templates_error: Telemetry
9789
survey_enabled: true
90+
allow_simultaneous: true
9891
survey:
9992
name: ''
10093
description: ''
@@ -168,7 +161,7 @@ controller_templates:
168161
ask_job_type_on_launch: true
169162
credentials:
170163
- "OpenShift Credential"
171-
- "OpenShift CNV Machine Credential"
164+
- "Demo Credential"
172165
survey_enabled: true
173166
survey:
174167
name: ''
@@ -180,6 +173,24 @@ controller_templates:
180173
default: "openshift-cnv-rhel*"
181174
required: true
182175

176+
- name: OpenShift / CNV / Wait Hosts
177+
inventory: "Demo Inventory"
178+
project: "Ansible official demo project"
179+
playbook: "openshift/cnv/wait.yml"
180+
notification_templates_started: Telemetry
181+
notification_templates_success: Telemetry
182+
notification_templates_error: Telemetry
183+
survey_enabled: true
184+
survey:
185+
name: ''
186+
description: ''
187+
spec:
188+
- question_name: Wait hosts
189+
type: text
190+
variable: _hosts
191+
default: "openshift-cnv-rhel*"
192+
required: true
193+
183194
- name: OpenShift / Dev Spaces
184195
job_type: run
185196
inventory: "Demo Inventory"
@@ -247,6 +258,12 @@ controller_workflows:
247258
- Ticket - Instance Failed
248259
- identifier: Update Inventory
249260
unified_job_template: OpenShift CNV Inventory
261+
failure_nodes:
262+
- wait_hosts
263+
- identifier: wait_hosts
264+
unified_job_template: OpenShift / CNV / Wait Hosts
265+
failure_nodes:
266+
- Update Inventory
250267
- identifier: Ticket - Instance Failed
251268
unified_job_template: 'SUBMIT FEEDBACK'
252269
extra_data:

0 commit comments

Comments
 (0)