Adding multiples ansible roles, playbooks and inventory

This commit is contained in:
2026-02-26 22:06:15 +00:00
parent d0a13e6f62
commit a4ccfe25ae
23 changed files with 1195 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
---
- name: Get VMID
ansible.builtin.shell: >-
pct list | awk '{print $1,$3}' | grep -E '^[0-9]+ {{ proxmox_ct_name }}$'| awk '{print $1}'
args:
executable: /bin/bash
register: vmid
delegate_to: "{{ proxmox_node }}"
- name: Stop container
community.general.proxmox:
vmid: "{{ vmid.stdout }}"
api_user: "{{ proxmox_api_user }}"
api_password: "{{ proxmox_api_password }}"
api_host: "{{ proxmox_api_host }}"
state: stopped
- name: Remove container
community.general.proxmox:
vmid: "{{ vmid.stdout }}"
api_user: "{{ proxmox_api_user }}"
api_password: "{{ proxmox_api_password }}"
api_host: "{{ proxmox_api_host }}"
state: absent