Introduces LTE_IMAGE_NAME variable.

This commit is contained in:
Emil
2024-03-06 01:48:51 +01:00
parent c8878ad28b
commit 4dcdf45a12
6 changed files with 26 additions and 20 deletions

View File

@@ -7,6 +7,6 @@
theliberatededge.test_linux_containers.image_published_locally.yml
vars:
lte_debian_version: bookworm
lte_container_name: '{{ molecule_yml.platforms[0].name }}'
lte_image_name: '{{ molecule_yml.platforms[0].name }}'
lte_container_root_pwd: |-
'{{ lookup("ansible.builtin.env", "LTE_CONTAINER_ROOT_PWD") }}'

View File

@@ -5,14 +5,14 @@
gather_facts: false
tasks:
- name: find current container state
ansible.builtin.command: incus ls {{ item.name }}
ansible.builtin.command: incus ls "{{ item.name }}-container"
register: state
changed_when: false
with_items: '{{ molecule_yml.platforms }}'
- name: stop and remove running containers
ansible.builtin.shell:
cmd: |
incus stop {{ item.name }} && \
incus rm {{ item.name }}
incus stop "{{ item.name }}-container" && \
incus rm "{{ item.name }}-container"
when: state.results[0].rc == 0 and "RUNNING" in state.results[0].stdout
with_items: '{{ molecule_yml.platforms }}'

View File

@@ -2,7 +2,7 @@
dependency:
name: galaxy
platforms:
- name: ${LTE_CONTAINER_NAME}
- name: ${LTE_IMAGE_NAME}
provisioner:
name: ansible
playbooks: