From 15b2079d5add11abf21e19203b53289b3f4e1a2f Mon Sep 17 00:00:00 2001 From: Tiago Carrondo Date: Wed, 3 Aug 2022 12:49:34 +0100 Subject: [PATCH 1/3] add per instance containers state --- 02_lxc_containers.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/02_lxc_containers.yaml b/02_lxc_containers.yaml index 62e8378..96960d0 100644 --- a/02_lxc_containers.yaml +++ b/02_lxc_containers.yaml @@ -5,8 +5,8 @@ tasks: - name: Create lxd containers community.general.lxd_container: - name: '{{ item }}' - state: started + name: '{{ item.name }}' + state: '{{ item.state }}' source: type: image mode: pull @@ -17,10 +17,10 @@ wait_for_ipv4_addresses: true timeout: 600 with_items: - - haproxy - - gitea - - freescout - - pretalx + - { name: haproxy, state: started } + - { name: gitea, state: started } + - { name: freescout, state: started } + - { name: pretalx, state: stopped } - name: Create haproxy port forwards community.general.lxd_container: name: haproxy From 5992957204e7151d2f041442717bfc9362aa510e Mon Sep 17 00:00:00 2001 From: Tiago Carrondo Date: Wed, 3 Aug 2022 12:49:56 +0100 Subject: [PATCH 2/3] fix hosts --- 03_container_haproxy.yaml | 2 +- 04_container_gitea.yaml | 2 +- hosts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/03_container_haproxy.yaml b/03_container_haproxy.yaml index 12c3452..58bd6ce 100644 --- a/03_container_haproxy.yaml +++ b/03_container_haproxy.yaml @@ -1,6 +1,6 @@ --- - name: HAPROXY -- install - hosts: haproxy@git.ansol.org + hosts: haproxy@lxd.ansol.org become: true tasks: - name: HAPROXY -- install needed packages diff --git a/04_container_gitea.yaml b/04_container_gitea.yaml index 715be3b..1bfa1f8 100644 --- a/04_container_gitea.yaml +++ b/04_container_gitea.yaml @@ -1,6 +1,6 @@ --- - name: GITEA -- install - hosts: gitea@git.ansol.org + hosts: gitea@lxd.ansol.org roles: - { role: do1jlr.gitea, tags: gitea } vars: diff --git a/hosts b/hosts index 3c0ef69..037fadd 100644 --- a/hosts +++ b/hosts @@ -1,6 +1,6 @@ [lxd_hosts] -git.ansol.org +lxd.ansol.org [containers] -haproxy@git.ansol.org ansible_connection=sshlxd -gitea@git.ansol.org ansible_connection=sshlxd +haproxy@lxd.ansol.org ansible_connection=sshlxd +gitea@lxd.ansol.org ansible_connection=sshlxd From 16159e52f4315d3f03817411f17da6ad76e53c4c Mon Sep 17 00:00:00 2001 From: Tiago Carrondo Date: Wed, 3 Aug 2022 13:37:50 +0100 Subject: [PATCH 3/3] extra fix: check mode --- 01_prep_lxd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/01_prep_lxd.yaml b/01_prep_lxd.yaml index 7173478..96db1c6 100644 --- a/01_prep_lxd.yaml +++ b/01_prep_lxd.yaml @@ -6,6 +6,7 @@ - name: PREP LXD -- Check if ubuntu minimal repo already added. shell: lxc remote list | grep ubuntu-minimal | wc -l register: ubuntu_minimal_repo + check_mode: no - name: PREP LXD -- Add ubuntu minimal repo command: lxc remote add --protocol simplestreams ubuntu-minimal https://cloud-images.ubuntu.com/minimal/releases/ when: ubuntu_minimal_repo.stdout != "1"