i-1 Introduces an Ansible playbook for linux-container with SSH access #2

Merged
emil merged 24 commits from i-1-test-linux-container into main 2024-01-07 00:48:19 +00:00
2 changed files with 13 additions and 11 deletions
Showing only changes of commit 1e21b446be - Show all commits

View File

@ -0,0 +1,12 @@
---
- name: find current container state
ansible.builtin.command: lxc ls {{ lte_container_name }}
register: container_state
changed_when: false
- name: launch debian bookworm linux container
ansible.builtin.shell:
cmd: |
lxc launch \
images:debian/{{ lte_debian_version }}/cloud \
{{ lte_container_name }}
when: (container_state.rc == 1) or ("RUNNING" not in container_state.stdout)

View File

@ -1,12 +1,2 @@
---
- name: find current container state
ansible.builtin.command: lxc ls {{ lte_container_name }}
register: container_state
changed_when: false
- name: launch debian bookworm linux container
ansible.builtin.shell:
cmd: |
lxc launch \
images:debian/{{ lte_debian_version }}/cloud \
{{ lte_container_name }}
when: (container_state.rc == 1) or ("RUNNING" not in container_state.stdout)
- include_tasks: container.yml