From ed7dadf612ca873df590ad3fa8e77831ef857ae6 Mon Sep 17 00:00:00 2001 From: "Andreas B. Mundt" Date: Sat, 24 Feb 2024 09:30:48 +0100 Subject: [PATCH] Fix ansible run during installation with limitted groups. --- lmn-client.yml | 2 +- roles/lmn_fvs/tasks/main.yml | 2 +- roles/lmn_network/tasks/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lmn-client.yml b/lmn-client.yml index 8e66529..037a403 100644 --- a/lmn-client.yml +++ b/lmn-client.yml @@ -132,7 +132,7 @@ cmd: unzip -d /tmp/cb/ CodeBlocks.zip && dpkg -i cb/*.deb chdir: /tmp/ when: codeblocks_version.stdout is not search('svn13456') - when: inventory_hostname in groups.PCroom + when: groups.PCroom is defined and inventory_hostname in groups.PCroom ## Temporarily fix boot order - name: Check for the buggy kernel diff --git a/roles/lmn_fvs/tasks/main.yml b/roles/lmn_fvs/tasks/main.yml index 27dfd80..1dcfcc6 100644 --- a/roles/lmn_fvs/tasks/main.yml +++ b/roles/lmn_fvs/tasks/main.yml @@ -136,7 +136,7 @@ command: /usr/local/sbin/bootorder.sh register: cmd_result changed_when: cmd_result.stdout is not search('Nothing to do.') - when: inventory_hostname in groups["PCroom"] + when: groups.PCroom is defined and inventory_hostname in groups.PCroom - name: Copy dolphin config scripts ansible.builtin.copy: diff --git a/roles/lmn_network/tasks/main.yml b/roles/lmn_network/tasks/main.yml index 022cc5f..0c7176a 100644 --- a/roles/lmn_network/tasks/main.yml +++ b/roles/lmn_network/tasks/main.yml @@ -26,4 +26,4 @@ deb http://deb.debian.org/debian/ {{ ansible_distribution_release }}-proposed-updates main non-free-firmware state: present - when: inventory_hostname in groups["R202"] + when: groups.R202 is defined and inventory_hostname in groups.R202