mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 09:47:21 +00:00
End task if VM have already been created
This commit is contained in:
1 parent
fa8520a079
commit
01e963d277
1 file changed
+18
-1
@@ -1,9 +1,16 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
vars:
|
||||
vm_status: "{{ lookup('file', '/deployments/{{ os_project }}-{{ win_project }}/VM_STATUS') }}"
|
||||
vars_files:
|
||||
- ../vars/common.yml
|
||||
- ../vars/{{ project_zone }}.yml
|
||||
tasks:
|
||||
- name: End early if VM already created
|
||||
block:
|
||||
- meta: end_play
|
||||
when: vm_status == 'created'
|
||||
|
||||
- name: Create workbench VMs (ASYNCHRONUS)
|
||||
tags: teardown
|
||||
os_server:
|
||||
@@ -298,4 +305,14 @@
|
||||
type: server
|
||||
variant: web_proxy
|
||||
os: linux
|
||||
when: project_zone == 'protected'
|
||||
when: project_zone == 'protected'
|
||||
|
||||
- name: Set VM Status
|
||||
vars:
|
||||
ansible_connection: local
|
||||
replace:
|
||||
path: /deployments/{{ os_project }}-{{ win_project }}/VM_STATUS
|
||||
regexp: '^pending$'
|
||||
replace: 'created'
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
Reference in new issue
Block a user