now with longer names
This commit is contained in:
@@ -10,14 +10,14 @@
|
|||||||
wait: true
|
wait: true
|
||||||
|
|
||||||
- name: AWS | RESTORE VM | get volumes
|
- name: AWS | RESTORE VM | get volumes
|
||||||
register: r_vol_info
|
register: aws_r_vol_info
|
||||||
amazon.aws.ec2_vol_info:
|
amazon.aws.ec2_vol_info:
|
||||||
region: "{{ aws_region }}"
|
region: "{{ aws_region }}"
|
||||||
filters:
|
filters:
|
||||||
attachment.instance-id: "{{ instance_id }}"
|
attachment.instance-id: "{{ instance_id }}"
|
||||||
|
|
||||||
- name: AWS | RESTORE VM | detach volumes
|
- name: AWS | RESTORE VM | detach volumes
|
||||||
loop: "{{ r_vol_info.volumes }}"
|
loop: "{{ aws_r_vol_info.volumes }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: volume
|
loop_var: volume
|
||||||
label: "{{ volume.id }}"
|
label: "{{ volume.id }}"
|
||||||
|
|||||||
@@ -12,14 +12,14 @@
|
|||||||
file: snapshot_vm.yml
|
file: snapshot_vm.yml
|
||||||
|
|
||||||
- name: AWS | SNAPSHOT VM | get volumes
|
- name: AWS | SNAPSHOT VM | get volumes
|
||||||
register: r_vol_info
|
register: aws_r_vol_info
|
||||||
amazon.aws.ec2_vol_info:
|
amazon.aws.ec2_vol_info:
|
||||||
region: "{{ aws_region }}"
|
region: "{{ aws_region }}"
|
||||||
filters:
|
filters:
|
||||||
attachment.instance-id: "{{ instance_id }}"
|
attachment.instance-id: "{{ instance_id }}"
|
||||||
|
|
||||||
- name: AWS | SNAPSHOT VM | take snapshots
|
- name: AWS | SNAPSHOT VM | take snapshots
|
||||||
loop: "{{ r_vol_info.volumes }}"
|
loop: "{{ aws_r_vol_info.volumes }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: volume
|
loop_var: volume
|
||||||
label: "{{ volume.id }}"
|
label: "{{ volume.id }}"
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
|
|
||||||
- name: AWS | SNAPSHOT VM | format snapshot stat
|
- name: AWS | SNAPSHOT VM | format snapshot stat
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
snapshot_stat:
|
aws_snapshot_stat:
|
||||||
- key: "{{ inventory_hostname }}"
|
- key: "{{ inventory_hostname }}"
|
||||||
value: "{{ r_snapshots.results | json_query(aws_ec2_snapshot_query) }}"
|
value: "{{ r_snapshots.results | json_query(aws_ec2_snapshot_query) }}"
|
||||||
|
|
||||||
- name: AWS | SNAPSHOT VM | record snapshot with host key
|
- name: AWS | SNAPSHOT VM | record snapshot with host key
|
||||||
ansible.builtin.set_stats:
|
ansible.builtin.set_stats:
|
||||||
data:
|
data:
|
||||||
aws_snapshots: "{{ snapshot_stat | items2dict }}"
|
aws_snapshots: "{{ aws_snapshot_stat | items2dict }}"
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
kind: Route
|
kind: Route
|
||||||
name: "{{ eda_controller_project_app_name }}"
|
name: "{{ eda_controller_project_app_name }}"
|
||||||
namespace: "{{ eda_controller_project }}"
|
namespace: "{{ eda_controller_project }}"
|
||||||
register: r_eda_route
|
register: eda_controller_r_eda_route
|
||||||
until: r_eda_route.resources[0].spec.host is defined
|
until: eda_controller_r_eda_route.resources[0].spec.host is defined
|
||||||
retries: 30
|
retries: 30
|
||||||
delay: 45
|
delay: 45
|
||||||
|
|
||||||
- name: Get eda-controller route hostname
|
- name: Get eda-controller route hostname
|
||||||
ansible.builtin.set_fact:
|
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
|
- name: Wait for eda_controller to be running
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
validate_certs: false
|
validate_certs: false
|
||||||
body_format: json
|
body_format: json
|
||||||
status_code: 200
|
status_code: 200
|
||||||
register: r_result
|
register: eda_controller_r_result
|
||||||
until: not r_result.failed
|
until: not eda_controller_r_result.failed
|
||||||
retries: 60
|
retries: 60
|
||||||
delay: 45
|
delay: 45
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
redhat.openshift_virtualization.kubevirt_vm_info:
|
redhat.openshift_virtualization.kubevirt_vm_info:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
namespace: "{{ vm_namespace }}"
|
namespace: "{{ vm_namespace }}"
|
||||||
register: state
|
register: snapshot_state
|
||||||
|
|
||||||
- name: Stop VirtualMachine
|
- name: Stop VirtualMachine
|
||||||
redhat.openshift_virtualization.kubevirt_vm:
|
redhat.openshift_virtualization.kubevirt_vm:
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
namespace: "{{ vm_namespace }}"
|
namespace: "{{ vm_namespace }}"
|
||||||
running: false
|
running: false
|
||||||
wait: true
|
wait: true
|
||||||
when: state.resources.0.spec.running
|
when: snapshot_state.resources.0.spec.running
|
||||||
|
|
||||||
- name: Create a VirtualMachineSnapshot
|
- name: Create a VirtualMachineSnapshot
|
||||||
kubernetes.core.k8s:
|
kubernetes.core.k8s:
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
namespace: "{{ vm_namespace }}"
|
namespace: "{{ vm_namespace }}"
|
||||||
running: true
|
running: true
|
||||||
wait: true
|
wait: true
|
||||||
when: state.resources.0.spec.running
|
when: snapshot_state.resources.0.spec.running
|
||||||
|
|
||||||
- name: Export snapshot name
|
- name: Export snapshot name
|
||||||
ansible.builtin.set_stats:
|
ansible.builtin.set_stats:
|
||||||
|
|||||||
Reference in New Issue
Block a user