chore: rename .yaml extensions to .yml for consistency
This commit is contained in:
29
roles/proxmox-lxc-provision/tasks/clone.yml
Executable file
29
roles/proxmox-lxc-provision/tasks/clone.yml
Executable file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Create a full clone of the container
|
||||
community.general.proxmox:
|
||||
<<: "{{ proxmox_api_connection }}"
|
||||
vmid: "{{ lxc_vmid | default(0) }}"
|
||||
clone: "{{ lxc_clone_from }}"
|
||||
clone_type: "{{ lxc_clone_type }}"
|
||||
hostname: "{{ lxc_hostname }}"
|
||||
storage: "{{ lxc_storage }}"
|
||||
register: clone_result
|
||||
|
||||
- name: Add bind mounts via pct
|
||||
become: yes
|
||||
ansible.builtin.shell: |
|
||||
pct set {{ clone_result.vmid | default(lxc_vmid) }} {% for key, value in lxc_mounts.items() %}-{{ key }} {{ value }} {% endfor %}
|
||||
delegate_to: "{{ proxmox_api_host }}"
|
||||
when: lxc_mounts is defined
|
||||
|
||||
- name: Resize rootfs after clone
|
||||
ansible.builtin.command:
|
||||
cmd: "pct resize {{ clone_result.vmid }} rootfs {{ lxc_size }}G"
|
||||
delegate_to: "{{ proxmox_api_host }}"
|
||||
become: yes
|
||||
register: resize_result
|
||||
changed_when: resize_result.rc == 0 and 'already at specified size' not in resize_result.stderr
|
||||
failed_when:
|
||||
- resize_result.rc != 0
|
||||
- "'already at specified size' not in resize_result.stderr"
|
||||
when: lxc_size is defined
|
||||
Reference in New Issue
Block a user