handlers
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 1m21s Details

This commit is contained in:
Gleb Koval 2023-09-10 23:33:43 +01:00
parent fce7d91115
commit ab54c18b1b
Signed by: cyclane
GPG Key ID: 15E168A8B332382C
1 changed files with 22 additions and 11 deletions

View File

@ -36,16 +36,11 @@
clone: "{{ node }}-debian-12"
storage: nvme
register: create
notify:
- Initial boot
- name: Debug
ansible.builtin.debug:
var: create
- name: Wait for VM to exist
community.general.proxmox_kvm:
state: current
register: vm
retries: 30
delay: 10
until: vm.status is defined
- name: Add HOME NIC
community.general.proxmox_nic:
interface: net0
@ -78,14 +73,30 @@
memory: 2048
- name: Retart VM # doesn't start if stopped
when:
- vm.status is defined
- vm.status == "running"
- create.status is defined
- create.status == "running"
community.general.proxmox_kvm:
state: restarted
timeout: 60
- name: Start VM # start if stopped
when:
- vm.status is defined
- vm.status != "running"
- create.status is defined
- create.status != "running"
community.general.proxmox_kvm:
state: started
handlers:
- name: Initial boot
block:
- name: Start
community.general.proxmox_kvm:
state: started
register: start
retries: 30
delay: 10
until: start.status is defined
- name: Wait
ansible.builtin.wait_for:
timeout: 180
- name: Poweroff
community.general.proxmox_kvm:
state: stopped