From 29906fc4621aa4250b1beabdee0a2fbed628293d Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Sun, 10 Sep 2023 23:42:26 +0100 Subject: [PATCH] no handlers --- infra/joplin/0000_proxmox_playbook.yaml | 34 ++++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/infra/joplin/0000_proxmox_playbook.yaml b/infra/joplin/0000_proxmox_playbook.yaml index 80ee4a8..f74b982 100644 --- a/infra/joplin/0000_proxmox_playbook.yaml +++ b/infra/joplin/0000_proxmox_playbook.yaml @@ -36,8 +36,22 @@ clone: "{{ node }}-debian-12" storage: nvme register: create - notify: - - Initial boot + - name: Initial boot + when: create.changed is true + 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 - name: Debug ansible.builtin.debug: var: create @@ -84,19 +98,3 @@ - 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