Skip to content

Commit

Permalink
Wildcard routes for hcp hosted clusters (#8848)
Browse files Browse the repository at this point in the history
* allow ingresscontroller updates for wildcards

line too long

add api_version to ingresscontroller update

* Add_extra_config_option_to_kubevirt (#8847)

* Rework install_operator role. Document extra config options for subscriptions

* Rework kubevirt role a bit. Add support for nested KVM virtualization

---------

Co-authored-by: Wolfgang Kulhanek <[email protected]>

* fix indentation

---------

Co-authored-by: Wolfgang Kulhanek <[email protected]>
Co-authored-by: Wolfgang Kulhanek <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent ae908d2 commit 82957e0
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions ansible/roles_ocp_workloads/ocp4_workload_rhacm/tasks/workload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
- name: Update Router for Wildcards for HCP Hosted Clusters
when: ocp4_workload_rhacm_enable_wildcards | bool
kubernetes.core.k8s_json_patch:
api_version: operator.openshift.io/v1
kind: IngressController
namespace: openshift-ingress-operator
name: default
patch:
- op: add
path: /spec/routeAdmission
value:
wildcardPolicy: WildcardsAllowed
- op: add
path: '/spec/routeAdmission'
value:
wildcardPolicy: WildcardsAllowed

- name: Install RHACM operator
ansible.builtin.include_role:
Expand All @@ -37,7 +38,7 @@
install_operator_catalogsource_image: "{{ ocp4_workload_rhacm_catalog_source_image | default('') }}"
install_operator_catalogsource_image_tag: "{{ ocp4_workload_rhacm_catalog_source_tag | default('') }}"
install_operator_manage_namespaces:
- open-cluster-management
- open-cluster-management

- name: Ensure RHACM MultiClusterHub is present
kubernetes.core.k8s:
Expand All @@ -58,12 +59,12 @@
retries: 120
delay: 10
until:
- rhacm_multiclusterhub is defined
- rhacm_multiclusterhub.resources is defined
- rhacm_multiclusterhub.resources | length > 0
- rhacm_multiclusterhub.resources[0].status is defined
- rhacm_multiclusterhub.resources[0].status.phase is defined
- rhacm_multiclusterhub.resources[0].status.phase == "Running"
- rhacm_multiclusterhub is defined
- rhacm_multiclusterhub.resources is defined
- rhacm_multiclusterhub.resources | length > 0
- rhacm_multiclusterhub.resources[0].status is defined
- rhacm_multiclusterhub.resources[0].status.phase is defined
- rhacm_multiclusterhub.resources[0].status.phase == "Running"

# RHACM Console route only exists for RHACM 2.6 and earlier
- name: Get the RHACM console route
Expand Down Expand Up @@ -92,24 +93,24 @@
- name: For RHACM 2.6 and earlier save route to RHACM Console
when: r_acm_console_route.resources | length > 0
block:
- name: Set fact for RHACM route
ansible.builtin.set_fact:
acm_route: "{{ r_acm_console_route | json_query(route_query) }}"
vars:
- route_query: resources[].spec.host|[0]
- name: Set fact for RHACM route
ansible.builtin.set_fact:
acm_route: "{{ r_acm_console_route | json_query(route_query) }}"
vars:
- route_query: resources[].spec.host|[0]

- name: Print user info
agnosticd_user_info:
msg: "{{ item }}"
loop:
- ""
- "Your RHACM console is available at:"
- " https://{{ acm_route }}"
- name: Print user info
agnosticd_user_info:
msg: "{{ item }}"
loop:
- ""
- "Your RHACM console is available at:"
- " https://{{ acm_route }}"

- name: Save user data (RHACM Console)
agnosticd_user_info:
data:
acm_route: "https://{{ r_acm_console_route.resources[0].spec.host }}"
- name: Save user data (RHACM Console)
agnosticd_user_info:
data:
acm_route: "https://{{ r_acm_console_route.resources[0].spec.host }}"

- name: Save user data
agnosticd_user_info:
Expand All @@ -119,9 +120,9 @@

- name: Write out AWS credentials if deployed to EC2 sandbox
when:
- cloud_provider == 'ec2'
- hostvars.localhost.cloudformation_out_final.stack_outputs.StudentUserAccessKey is defined
- hostvars.localhost.cloudformation_out_final.stack_outputs.StudentUserSecretAccessKey is defined
- cloud_provider == 'ec2'
- hostvars.localhost.cloudformation_out_final.stack_outputs.StudentUserAccessKey is defined
- hostvars.localhost.cloudformation_out_final.stack_outputs.StudentUserSecretAccessKey is defined
ansible.builtin.include_tasks: aws_credentials.yml

# Leave this as the last task in the playbook.
Expand Down

0 comments on commit 82957e0

Please sign in to comment.