Skip to content

Commit

Permalink
Fix the Argo issue
Browse files Browse the repository at this point in the history
  • Loading branch information
danieloh30 committed Nov 2, 2023
1 parent ebc509a commit 48fc682
Showing 1 changed file with 66 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,72 @@
# - name: Configure Tomcat VM
# ansible.builtin.include_tasks: vm-tomcat-install-and-configure.yml

- name: Import database image and deploy VM for all users
when: ocp4_workload_mad_roadshow_kubevirt_vm_deploy | bool
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', item ) | from_yaml_all | list }}"
loop:
# Database image
- kubevirt/namespace.yaml.j2
- kubevirt/datavolume.yaml.j2
- kubevirt/clusterrole.yaml.j2
# Single shared legacy VM
- kubevirt/legacy-namespace.yaml.j2
- kubevirt/legacy-application.yaml.j2
# VMs for all users
- kubevirt/applicationset.yaml.j2

- name: Look up Legacy PostgreSQL on CNV with ClusterIP
kubernetes.core.k8s:
api_version: v1
kind: Service
name: postgresql
namespace: "{{ ocp4_workload_mad_roadshow_legacy_namespace }}"
register: r_postgresql_svc
retries: 50
delay: 10
failed_when: >-
r_postgresql_svc | r_postgresql_svc.resources[0].spec.clusterIP | length < 1
until: r_tpostgresql_svc is successful

- name: Save Legacy PostgreSQL VM's ClusterIP
ansible.builtin.set_fact:
_ocp4_workload_mad_roadshow_postgresql_ip: >-
{{ r_postgresql_svc.resources[0].spec.clusterIP }}
- name: Print Legacy PostgreSQL VM properties
ansible.builtin.debug:
msg: |
"Legacy PostgreSQL VM IP Address: {{ _ocp4_workload_mad_roadshow_postgresql_ip }}"
"Legacy PostgreSQL VM user name: {{ ocp4_workload_mad_roadshow_vm_user_name }}"
"Legacy PostgreSQL VM user password: {{ ocp4_workload_mad_roadshow_vm_user_password }}"
- name: Look up Legacy Tomcat on CNV with ClusterIP
kubernetes.core.k8s:
api_version: v1
kind: Service
name: tomcat
namespace: "{{ ocp4_workload_mad_roadshow_legacy_namespace }}"
register: r_tomcat_svc
retries: 50
delay: 10
failed_when: >-
r_tomcat_svc | r_tomcat_svc.resources[0].spec.clusterIP | length < 1
until: r_tomcat_svc is successful

- name: Save Legacy Tomcat VM's ClusterIP
ansible.builtin.set_fact:
_ocp4_workload_mad_roadshow_tomcat_ip: >-
{{ r_tomcat_svc.resources[0].spec.clusterIP }}
- name: Print Legacy Tomcat VM properties
ansible.builtin.debug:
msg: |
"Legacy Tomcat VM IP Address: {{ _ocp4_workload_mad_roadshow_tomcat_ip }}"
"Legacy Tomcat VM user name: {{ ocp4_workload_mad_roadshow_vm_user_name }}"
"Legacy Tomcat VM user password: {{ ocp4_workload_mad_roadshow_vm_user_password }}"
- name: Set up GitOps environment
when: ocp4_workload_mad_roadshow_gitops_setup | bool
block:
Expand Down Expand Up @@ -251,22 +317,6 @@
loop_var: n
label: "{{ ocp4_workload_mad_roadshow_gitea_user_prefix }}{{ n }}"

- name: Import database image and deploy VM for all users
when: ocp4_workload_mad_roadshow_kubevirt_vm_deploy | bool
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', item ) | from_yaml_all | list }}"
loop:
# Database image
- kubevirt/namespace.yaml.j2
- kubevirt/datavolume.yaml.j2
- kubevirt/clusterrole.yaml.j2
# Single shared legacy VM
- kubevirt/legacy-namespace.yaml.j2
- kubevirt/legacy-application.yaml.j2
# VMs for all users
- kubevirt/applicationset.yaml.j2

# - name: Save Save AgnosticD information (RHV)
# when: ocp4_workload_mad_roadshow_rhv_user_setup | bool
# agnosticd_user_info:
Expand All @@ -278,56 +328,6 @@
# rhv_mtv_user: "{{ ocp4_workload_mad_roadshow_rhv_user_name }}@{{ ocp4_workload_mad_roadshow_rhv_user_postfix }}"
# rhv_password: "{{ ocp4_workload_mad_roadshow_rhv_user_password }}"

- name: Look up Legacy PostgreSQL on CNV with ClusterIP
kubernetes.core.k8s:
api_version: v1
kind: Service
name: postgresql
namespace: "{{ ocp4_workload_mad_roadshow_legacy_namespace }}"
register: r_postgresql_svc
retries: 50
delay: 10
failed_when: >-
r_postgresql_svc | r_postgresql_svc.resources[0].spec.clusterIP | length < 1
until: r_tpostgresql_svc is successful

- name: Save Legacy PostgreSQL VM's ClusterIP
ansible.builtin.set_fact:
_ocp4_workload_mad_roadshow_postgresql_ip: >-
{{ r_postgresql_svc.resources[0].spec.clusterIP }}
- name: Print Legacy PostgreSQL VM properties
ansible.builtin.debug:
msg: |
"Legacy PostgreSQL VM IP Address: {{ _ocp4_workload_mad_roadshow_postgresql_ip }}"
"Legacy PostgreSQL VM user name: {{ ocp4_workload_mad_roadshow_vm_user_name }}"
"Legacy PostgreSQL VM user password: {{ ocp4_workload_mad_roadshow_vm_user_password }}"
- name: Look up Legacy Tomcat on CNV with ClusterIP
kubernetes.core.k8s:
api_version: v1
kind: Service
name: tomcat
namespace: "{{ ocp4_workload_mad_roadshow_legacy_namespace }}"
register: r_tomcat_svc
retries: 50
delay: 10
failed_when: >-
r_tomcat_svc | r_tomcat_svc.resources[0].spec.clusterIP | length < 1
until: r_tomcat_svc is successful

- name: Save Legacy Tomcat VM's ClusterIP
ansible.builtin.set_fact:
_ocp4_workload_mad_roadshow_tomcat_ip: >-
{{ r_tomcat_svc.resources[0].spec.clusterIP }}
- name: Print Legacy Tomcat VM properties
ansible.builtin.debug:
msg: |
"Legacy Tomcat VM IP Address: {{ _ocp4_workload_mad_roadshow_tomcat_ip }}"
"Legacy Tomcat VM user name: {{ ocp4_workload_mad_roadshow_vm_user_name }}"
"Legacy Tomcat VM user password: {{ ocp4_workload_mad_roadshow_vm_user_password }}"
# - name: Access Legacy Tomcat VM
# delegate_to: "{{ _ocp4_workload_mad_roadshow_tomcat_ip }}"
# become: true
Expand Down

0 comments on commit 48fc682

Please sign in to comment.