Skip to content

Commit

Permalink
Update RAD VM (#8735)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Oh <doh@redhat.com>
  • Loading branch information
bbethell-1 and danieloh30 authored Oct 31, 2024
1 parent a00f9e0 commit 57487b2
Show file tree
Hide file tree
Showing 30 changed files with 845 additions and 376 deletions.
41 changes: 41 additions & 0 deletions ansible/configs/rad-roadshow-binder/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
== Overview

== Supported Cloud Providers

No cloud providers have been configured because this env_type is not meant to deploy resources, only interact with already available resources.

== Review the Env_Type variable file

For further information on customizing images consult the link:../../../docs/Creating_a_config.adoc[Creating a Config Guide]

== Review the `sample_vars.yml` variable file

----
---
guid: test-config-00
env_type: roadshow-virt-binder
cloud_provider: none
...
----

== Developing with `vmware-roadshow`

. Examine the defaults in `configs/vmware-roadshow/sample_vars.yml`

. Set the number of users you'd like.

. Make sure you use the binder to actually configure MTV.
The OpenShift cluster is not available from this config.

== Deploying the `vmware-roadshow`

You can deploy this config by running the following command from the `ansible`
directory.

`ansible-playbook main.yml -e @my_sample_vars.yaml -e @configs/vmware-roadshow/sample_vars.yml`

=== To Delete an environment

`ansible-playbook destroy.yml -e @configs/vmware-roadshow/sample_vars.yml`
1 change: 1 addition & 0 deletions ansible/configs/rad-roadshow-binder/default_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
37 changes: 37 additions & 0 deletions ansible/configs/rad-roadshow-binder/destroy_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- name: Destroy playbook
hosts: localhost
connection: local
gather_facts: false
become: false
tasks:
- name: Entering the rad-roadshow-binder destroy.yml
debug:
msg:
- Entering the rad-roadshow-binder destroy.yml

- 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

- name: Remove OpenShift Shared Showroom
when: showroom_deploy_shared_cluster_enable | default(false) | bool
vars:
ACTION: "destroy"
ansible.builtin.include_role:
name: ocp4_workload_showroom

- name: Exiting the rad-roadshow-binder destroy.yml
debug:
msg:
- Exiting the rad-roadshow-binder destroy.yml
19 changes: 19 additions & 0 deletions ansible/configs/rad-roadshow-binder/infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Step 001 infra
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step001
- infrastructure
tasks:
- name: Entering the rad-roadshow-binder infra.yml
debug:
msg:
- Entering the rad-roadshow-binder infra.yml

- name: Exiting the rad-roadshow-binder infra.yml
debug:
msg:
- Exiting the rad-roadshow-binder infra.yml
19 changes: 19 additions & 0 deletions ansible/configs/rad-roadshow-binder/post_infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Step 002 Post Infrastructure
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step002
- post_infrastructure
tasks:
- name: Entering the rad-roadshow-binder post_infra.yml
ansible.builtin.debug:
msg:
- Entering the rad-roadshow-binder post_infra.yml

- name: Exiting the rad-roadshow-binder post_infra.yml
ansible.builtin.debug:
msg:
- Exiting the rad-roadshow-binder post_infra.yml
71 changes: 71 additions & 0 deletions ansible/configs/rad-roadshow-binder/post_software.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# vim: set ft=yaml.ansible
---
- name: Step 005 Post Software
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step005
- post_software
tasks:
- name: Entering the rad-roadshow-binder post_software
ansible.builtin.debug:
msg:
- Entering the rad-roadshow-binder post_software

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

# - name: Add bastion private keys to output_dir
# ansible.builtin.copy:
# content: "{{ cnv_prov_data.ssh_provision_key }}\n"
# dest: "{{ output_dir }}/roadshow_cluster_sshkey.pem"
# mode: '0400'

# - name: Add Clusters to run time inventory - add bastions to hosts
# ansible.builtin.add_host:
# name: "{{ cnv_prov_data.bastion_public_hostname }}:{{ cnv_prov_data.bastion_ssh_port }}"
# groups: "bastions"
# ansible_ssh_private_key_file: "{{ output_dir }}/roadshow_cluster_sshkey.pem"
# ansible_user: lab-user
# remote_user: lab-user
# ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"

# - name: Run Workloads
# hosts: bastions
# gather_facts: false
# tasks:
# - name: Set Ansible Python interpreter to virtualenv
# ansible.builtin.set_fact:
# ansible_python_interpreter: "/opt/virtualenvs/k8s/bin/python"

# - name: Install ocp-infra-workloads
# when: infra_workloads | default("") | length > 0
# block:

# - name: Deploy ocp-infra workloads
# ansible.builtin.include_role:
# name: "{{ workload_loop_var }}"
# tasks_from: "{{ run_tasks_from }}"
# vars:
# run_tasks_from: >-
# {{ (workload_loop_var == "ocp4_workload_virt_roadshow_vmware") | ternary("mtv", "main") }}
# ocp_username: "system:admin"
# loop: "{{ infra_workloads }}"
# loop_control:
# loop_var: workload_loop_var

- name: Exiting the rad-roadshow-binder post_software.yml
hosts: localhost
connection: local
become: false
gather_facts: false
tasks:
- name: Exiting the rad-roadshow-binder post_software.yml
ansible.builtin.debug:
msg:
- Exiting the rad-roadshow-binder post_software.yml

21 changes: 21 additions & 0 deletions ansible/configs/rad-roadshow-binder/pre_infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Step 000 Pre Infrastructure
hosts: localhost
connection: local
become: false
gather_facts: false

tags:
- step001
- pre_infrastructure

tasks:
- name: Entering the rad-roadshow-binder pre_infra.yml
debug:
msg:
- Entering the rad-roadshow-binder pre_infra.yml

- name: Exiting the rad-roadshow-binder pre_infra.yml
debug:
msg:
- Exiting the rad-roadshow-binder pre_infra.yml
21 changes: 21 additions & 0 deletions ansible/configs/rad-roadshow-binder/pre_software.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Step 003 Pre Software
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step003
- pre_software
tasks:
- name: Entering the rad-roadshow-binder pre_software.yml
debug:
msg:
- Entering the rad-roadshow-binder pre_software.yml

- name: Exiting the rad-roadshow-binder pre_software.yml
debug:
msg:
- Exiting the rad-roadshow-binder pre_software.yml
- debug:
msg: Pre-Software checks completed successfully
6 changes: 6 additions & 0 deletions ansible/configs/rad-roadshow-binder/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
- name: community.general
version: 4.6.1
- name: ansible.posix
version: 1.3.0
4 changes: 4 additions & 0 deletions ansible/configs/rad-roadshow-binder/sample_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
guid: test-config-00
env_type: rad-roadshow-binder
cloud_provider: none
19 changes: 19 additions & 0 deletions ansible/configs/rad-roadshow-binder/software.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Step 004 Software
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step004
- deploy_software
tasks:
- name: Entering the rad-roadshow-binder software.yml
ansible.builtin.debug:
msg:
- Entering the rad-roadshow-binder software.yml

- name: Exiting the rad-roadshow-binder software.yml
ansible.builtin.debug:
msg:
- Exiting the rad-roadshow-binder software.yml
16 changes: 16 additions & 0 deletions ansible/configs/rad-roadshow-binder/stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Stop rad-roadshow-binder
hosts: localhost
connection: local
become: false
gather_facts: false
tasks:
- name: Entering the rad-roadshow-binder stop.yml
debug:
msg:
- Entering the rad-roadshow-binder stop.yml

- name: Exiting the rad-roadshow-binder stop.yml
debug:
msg:
- Exiting the rad-roadshow-binder stop.yml
16 changes: 16 additions & 0 deletions ansible/configs/rad-roadshow-binder/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Update rad-roadshow-binder
hosts: localhost
connection: local
become: false
gather_facts: false
tasks:
- name: Entering the rad-roadshow-binder update.yml
debug:
msg:
- Entering the rad-roadshow-binder update.yml

- name: Exiting the rad-roadshow-binder update.yml
debug:
msg:
- Exiting the rad-roadshow-binder update.yml
37 changes: 37 additions & 0 deletions ansible/configs/rad-roadshow-binder/workloads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# vim: set ft=yaml.ansible
---
# Workloads are being run on bastion.
# This enables using the k8s module in the workload.
# openshift python module is installed for Python3
- name: Install workloads
hosts: bastions
gather_facts: false
run_once: true
become: false
tasks:

- name: Set Ansible Python interpreter to k8s virtualenv
ansible.builtin.set_fact:
ansible_python_interpreter: /opt/virtualenvs/k8s/bin/python

- name: Install ocp-infra workloads
when: infra_workloads | default("") | length > 0
tags:
infra_workloads
block:
- name: Install ocp-infra-workloads
when: infra_workloads | default("") | length > 0
block:

- name: Deploy ocp-infra workloads
ansible.builtin.include_role:
name: "{{ workload_loop_var }}"
tasks_from: "{{ run_tasks_from }}"
vars:
run_tasks_from: >-
{{ ( workload_loop_var == "ocp4_workload_virt_roadshow_vmware" ) | ternary("mtv", "main") }}
ocp_username: "system:admin"
ACTION: "provision"
loop: "{{ infra_workloads }}"
loop_control:
loop_var: workload_loop_var
35 changes: 0 additions & 35 deletions ansible/roles/ai_setup_ilab_rad/defaults/main.yml

This file was deleted.

Loading

0 comments on commit 57487b2

Please sign in to comment.