Migrate code base from lxd to incus

This commit is contained in:
emo
2024-01-19 00:27:49 +01:00
parent 07bbef3c81
commit 74f955cc3d
5 changed files with 16 additions and 16 deletions

View File

@@ -1,19 +1,19 @@
---
- name: find current container state
ansible.builtin.command: lxc ls {{ lte_container_name }}
ansible.builtin.command: incus ls {{ lte_container_name }}
register: container_state
changed_when: false
- name: launch debian bookworm linux container
ansible.builtin.shell:
cmd: |
lxc launch \
incus launch \
images:debian/{{ lte_debian_version }}/cloud \
{{ lte_container_name }}
when: (container_state.rc == 1) or ("RUNNING" not in container_state.stdout)
- name: update apt cache and upgrade system packages
ansible.builtin.shell:
cmd: |-
lxc exec {{ lte_container_name }} -- \
incus exec {{ lte_container_name }} -- \
bash -c \
'/usr/bin/apt update && /usr/bin/apt upgrade -y'
changed_when: false