initial commit
This commit is contained in:
16
roles/proxmox-lxc-provision/tasks/stop.yaml
Executable file
16
roles/proxmox-lxc-provision/tasks/stop.yaml
Executable file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: Stop container if it is running
|
||||
community.general.proxmox:
|
||||
api_user: "{{ proxmox_api_user }}"
|
||||
api_token_id: "{{ proxmox_api_token_id }}"
|
||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||
api_host: "{{ proxmox_api_host }}"
|
||||
|
||||
vmid: "{{ container_vmid | default(omit) }}"
|
||||
hostname: "{{ container_hostname | default(omit) }}"
|
||||
state: "stopped"
|
||||
register: stop_result
|
||||
failed_when: |-
|
||||
stop_result.failed and
|
||||
('not running' not in stop_result.msg) and
|
||||
('does not exist' not in stop_result.msg)
|
||||
Reference in New Issue
Block a user