Adds image creation and publishing

This commit is contained in:
Emil
2024-03-07 02:36:34 +01:00
parent 2b1923e40a
commit da93d7f4b4
13 changed files with 156 additions and 9 deletions

View File

@@ -3,11 +3,15 @@
ansible.builtin.command: incus ls {{ lte_container_name }}
register: container_state
changed_when: false
- name: stop and remove running container
ansible.builtin.shell:
cmd: |
incus stop {{ lte_container_name }} && \
incus rm {{ lte_container_name }}
- name: Stop running container
ansible.builtin.command: incus stop {{ lte_container_name }}
when: >
lte_container_state in ['absent', 'stopped'] and
'results' in container_state and
container_state.results[0].rc == 0 and
'RUNNING' in container_state.results[0].stdout
- name: Remove stopped container
ansible.builtin.command: incus rm {{ lte_container_name }}
when: >
lte_container_state == 'absent' and
'results' in container_state and
@@ -25,7 +29,7 @@
'RUNNING' not in container_state.stdout
- name: update apt cache and upgrade system packages
ansible.builtin.shell:
cmd: |-
cmd: |
incus exec {{ lte_container_name }} -- \
bash -c \
'/usr/bin/apt update && /usr/bin/apt upgrade -y'