Skip to content

Commit

Permalink
[ocp-on-ocp config] Add support to install workloads to configure vmw…
Browse files Browse the repository at this point in the history
…are provider (mtv) (#9043)

* Update post_software.yml

* Update destroy_env.yml

* Update post_software.yml

* Update post_software.yml

* Update post_software.yml

* Update post_software.yml

* Update post_software.yml

* Update post_software.yml

* Update post_software.yml

* Update post_software.yml
  • Loading branch information
agonzalezrh authored Feb 17, 2025
1 parent 4f7087a commit 05fbf69
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
13 changes: 13 additions & 0 deletions ansible/configs/osp-on-ocp/destroy_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@
ACTION: "destroy"
ansible.builtin.include_role:
name: ocp4_workload_showroom
- name: Remove ocp workloads
when: remove_workloads | default("") | length > 0
block:
- name: Invoke roles to remove ocp workloads
ansible.builtin.include_role:
name: "{{ workload_loop_var }}"
vars:
ocp_username: "system:admin"
ACTION: "remove"
silent: false
loop: "{{ remove_workloads }}"
loop_control:
loop_var: workload_loop_var
30 changes: 20 additions & 10 deletions ansible/configs/osp-on-ocp/post_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
- /usr/bin/oc adm policy add-cluster-role-to-user cluster-admin admin
- /usr/bin/oc delete secrets kubeadmin -n kube-system

#- name: Pre-install operators
# script: files/configure_operators.sh

# - name: Run configure_ssl.sh
# script: files/configure_ssl.sh

- name: Setting up OCS Storage
include_role:
name: ocp4_aio_role_ocs
Expand Down Expand Up @@ -204,14 +198,30 @@
- "You should then automatically have oc/kubectl access to the cluster. Check out ~/ocp-install/auth/."

- name: PostSoftware flight-check
hosts: localhost
connection: local
hosts: bastion-vm
gather_facts: false
become: false
become: true
tags:
- post_flight_check
tasks:

- name: Install aiohttp sdk python library
ansible.builtin.pip:
name: "aiohttp"
- name: Install vsphere sdk
ansible.builtin.command: pip install git+https://github.com/vmware/vsphere-automation-sdk-python.git
- name: Apply infra workloads roles on nodes
when:
- infra_workloads | default("") | length > 0
block:
- name: Apply role "{{ workload_loop_var }}" on nodes
ansible.builtin.include_role:
name: "{{ workload_loop_var }}"
vars:
ACTION: "provision"
loop: "{{ infra_workloads }}"
loop_control:
loop_var: workload_loop_var

- name: Deploy Showroom on shared cluster
when: showroom_deploy_shared_cluster_enable | default(false) | bool
include_role:
Expand Down

0 comments on commit 05fbf69

Please sign in to comment.