Fix ci (#269)
This commit is contained in:
committed by
GitHub
parent
a0fd566f2a
commit
cc1fa209e2
@@ -17,14 +17,14 @@
|
||||
kind: Route
|
||||
name: "{{ eda_controller_project_app_name }}"
|
||||
namespace: "{{ eda_controller_project }}"
|
||||
register: r_eda_route
|
||||
until: r_eda_route.resources[0].spec.host is defined
|
||||
register: eda_controller_r_eda_route
|
||||
until: eda_controller_r_eda_route.resources[0].spec.host is defined
|
||||
retries: 30
|
||||
delay: 45
|
||||
|
||||
- name: Get eda-controller route hostname
|
||||
ansible.builtin.set_fact:
|
||||
eda_controller_hostname: "{{ r_eda_route.resources[0].spec.host }}"
|
||||
eda_controller_hostname: "{{ eda_controller_r_eda_route.resources[0].spec.host }}"
|
||||
|
||||
- name: Wait for eda_controller to be running
|
||||
ansible.builtin.uri:
|
||||
@@ -36,8 +36,8 @@
|
||||
validate_certs: false
|
||||
body_format: json
|
||||
status_code: 200
|
||||
register: r_result
|
||||
until: not r_result.failed
|
||||
register: eda_controller_r_result
|
||||
until: not eda_controller_r_result.failed
|
||||
retries: 60
|
||||
delay: 45
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
redhat.openshift_virtualization.kubevirt_vm_info:
|
||||
name: "{{ item }}"
|
||||
namespace: "{{ vm_namespace }}"
|
||||
register: state
|
||||
register: snapshot_state
|
||||
|
||||
- name: Stop VirtualMachine
|
||||
redhat.openshift_virtualization.kubevirt_vm:
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace: "{{ vm_namespace }}"
|
||||
running: false
|
||||
wait: true
|
||||
when: state.resources.0.spec.running
|
||||
when: snapshot_state.resources.0.spec.running
|
||||
|
||||
- name: Create a VirtualMachineSnapshot
|
||||
kubernetes.core.k8s:
|
||||
@@ -29,7 +29,7 @@
|
||||
wait: true
|
||||
wait_condition:
|
||||
type: Ready
|
||||
register: snapshot
|
||||
register: snapshot_snapshot
|
||||
|
||||
- name: Start VirtualMachine
|
||||
redhat.openshift_virtualization.kubevirt_vm:
|
||||
@@ -37,13 +37,13 @@
|
||||
namespace: "{{ vm_namespace }}"
|
||||
running: true
|
||||
wait: true
|
||||
when: state.resources.0.spec.running
|
||||
when: snapshot_state.resources.0.spec.running
|
||||
|
||||
- name: Export snapshot name
|
||||
ansible.builtin.set_stats:
|
||||
data:
|
||||
restore_snapshot_name: "{{ snapshot.result.metadata.name }}"
|
||||
restore_snapshot_name: "{{ snapshot_snapshot.result.metadata.name }}"
|
||||
|
||||
- name: Output snapshot name
|
||||
ansible.builtin.debug:
|
||||
msg: "Successfully created snapshot {{ snapshot.result.metadata.name }}"
|
||||
msg: "Successfully created snapshot {{ snapshot_snapshot.result.metadata.name }}"
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
redhat.openshift_virtualization.kubevirt_vm_info:
|
||||
name: "{{ item }}"
|
||||
namespace: "{{ vm_namespace }}"
|
||||
register: state
|
||||
register: snapshot_state
|
||||
|
||||
- name: List snapshots
|
||||
kubernetes.core.k8s_info:
|
||||
api_version: snapshot.kubevirt.io/v1alpha1
|
||||
kind: VirtualMachineSnapshot
|
||||
namespace: "{{ vm_namespace }}"
|
||||
register: snapshot
|
||||
register: snapshot_snapshot
|
||||
|
||||
- name: Set snapshot name for {{ item }}
|
||||
ansible.builtin.set_fact:
|
||||
latest_snapshot: "{{ snapshot.resources | selectattr('spec.source.name', 'equalto', item) | sort(attribute='metadata.creationTimestamp') | first }}"
|
||||
snapshot_latest_snapshot: "{{ snapshot_snapshot.resources | selectattr('spec.source.name', 'equalto', item) | sort(attribute='metadata.creationTimestamp') | first }}"
|
||||
|
||||
- name: Stop VirtualMachine
|
||||
redhat.openshift_virtualization.kubevirt_vm:
|
||||
@@ -22,7 +22,7 @@
|
||||
namespace: "{{ vm_namespace }}"
|
||||
running: false
|
||||
wait: true
|
||||
when: state.resources.0.spec.running
|
||||
when: snapshot_state.resources.0.spec.running
|
||||
|
||||
- name: Restore a VirtualMachineSnapshot
|
||||
kubernetes.core.k8s:
|
||||
@@ -30,14 +30,14 @@
|
||||
apiVersion: snapshot.kubevirt.io/v1alpha1
|
||||
kind: VirtualMachineRestore
|
||||
metadata:
|
||||
generateName: "{{ latest_snapshot.metadata.generateName }}"
|
||||
generateName: "{{ snapshot_latest_snapshot.metadata.generateName }}"
|
||||
namespace: "{{ vm_namespace }}"
|
||||
spec:
|
||||
target:
|
||||
apiGroup: kubevirt.io
|
||||
kind: VirtualMachine
|
||||
name: "{{ item }}"
|
||||
virtualMachineSnapshotName: "{{ latest_snapshot.metadata.name }}"
|
||||
virtualMachineSnapshotName: "{{ snapshot_latest_snapshot.metadata.name }}"
|
||||
wait: true
|
||||
wait_condition:
|
||||
type: Ready
|
||||
@@ -48,4 +48,4 @@
|
||||
namespace: "{{ vm_namespace }}"
|
||||
running: true
|
||||
wait: true
|
||||
when: state.resources.0.spec.running
|
||||
when: snapshot_state.resources.0.spec.running
|
||||
|
||||
Reference in New Issue
Block a user