Skip to content

Commit

Permalink
Change vms from running to run_strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaaano committed Jan 29, 2025
1 parent 1bca727 commit 1a31993
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions content/modules/ROOT/pages/03-vm-management.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ image::new_file.png[title='New File Creation', link=self, window=blank]
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ vm_name }}"
namespace: "{{ vm_namespace }}"
running: false
run_strategy: Halted
wait: true
----
+
Explanation of the Task:
+
* The `kubevirt_vm` module that is part of the `redhat.openshift_virtualization` collection is used to modify a VM
* The `name` parameter uses a user defined variable named `vm_name` to specify which VM to stop
* The `running: false` ensures the VM is not running
* The `run_strategy: Halted` ensures the VM is not running
* The `wait: true` ensures the next Ansible task isn't triggered until the stop is complete
+
. After making and saving the changes, ensure you commit and push them to your Gitea repository. For detailed instructions, refer to xref:appendix-vscode-commit-push.adoc[].
Expand Down Expand Up @@ -161,7 +161,7 @@ to identify key fields required to create dynamic Ansible tasks.
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ item.metadata.name }}"
namespace: "{{ item.metadata.namespace }}"
running: false
run_strategy: Halted
wait: true
loop: "{{ vm_info.resources }}"
loop_control:
Expand Down Expand Up @@ -244,7 +244,7 @@ The following steps will guide you in creating the `start_vm.yml` file.
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ item.metadata.name }}"
namespace: "{{ item.metadata.namespace }}"
running: true
run_strategy: Always
wait: true
loop: "{{ vm_info.resources }}"
loop_control:
Expand Down Expand Up @@ -303,7 +303,7 @@ The following steps will guide you in creating the `restart_vm.yml` file.
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ item.metadata.name }}"
namespace: "{{ item.metadata.namespace }}"
running: false
run_strategy: Halted
wait: true
loop: "{{ vm_info.resources }}"
loop_control:
Expand All @@ -319,7 +319,7 @@ The following steps will guide you in creating the `restart_vm.yml` file.
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ item.metadata.name }}"
namespace: "{{ item.metadata.namespace }}"
running: true
run_strategy: Always
wait: true
loop: "{{ updated_vm_info.resources }}"
loop_control:
Expand Down
4 changes: 2 additions & 2 deletions content/modules/ROOT/pages/06-vm-backup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ image::new_file.png[title='New File Creation', link=self, window=blank]
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ vm_snapshot_instance.resources[0].metadata.ownerReferences[0].name }}"
namespace: "{{ vm_snapshot_instance.resources[0].metadata.namespace }}"
running: false
run_strategy: Halted
wait: true
- name: Create Restore
Expand Down Expand Up @@ -313,7 +313,7 @@ image::new_file.png[title='New File Creation', link=self, window=blank]
redhat.openshift_virtualization.kubevirt_vm:
name: "{{ vm_snapshot_instance.resources[0].metadata.ownerReferences[0].name }}"
namespace: "{{ vm_snapshot_instance.resources[0].metadata.namespace }}"
running: true
run_strategy: Always
wait: true
when: "'resources' in vm_snapshot_instance and vm_snapshot_instance.resources | length == 1"
----
Expand Down

0 comments on commit 1a31993

Please sign in to comment.