don't error when no client VMs exist

This commit is contained in:
abrown38 committed 2024-09-25 15:21:46 +01:00
1 parent 53d43256bd
commit a198d507cf
3 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -21,7 +21,7 @@
url: "{{ wazuh_url }}/{{ wazuh_msi }}" url: "{{ wazuh_url }}/{{ wazuh_msi }}"
dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}" dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}"
when: | when: |
inventory_hostname not in groups['meta-type_client'] or inventory_hostname not in groups['meta-type_client']|default([]) or
project_zone == 'standard' project_zone == 'standard'
- name: Download agent using proxy - name: Download agent using proxy
@@ -31,7 +31,7 @@
url: "{{ wazuh_url }}/{{ wazuh_msi }}" url: "{{ wazuh_url }}/{{ wazuh_msi }}"
dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}" dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}"
when: | when: |
inventory_hostname in groups['meta-type_client'] and inventory_hostname in groups['meta-type_client']|default([]) and
project_zone == 'protected' project_zone == 'protected'
- name: Install agent - name: Install agent
@@ -51,7 +51,7 @@
- name: Wazuh Groups - name: Wazuh Groups
hosts: eidf-wazuh01 hosts: eidf-wazuh01
gather_facts: no gather_facts: false
vars_files: vars_files:
- ../vars/common.yml - ../vars/common.yml
tasks: tasks:
@@ -38,7 +38,7 @@
bypass: bypass:
- <local> - <local>
when: | when: |
inventory_hostname in groups['meta-type_client'] and inventory_hostname in groups['meta-type_client']|default([]) and
project_zone == 'protected' project_zone == 'protected'
- name: Install Chocolatey GUI - name: Install Chocolatey GUI
@@ -40,4 +40,4 @@
state: "domain" state: "domain"
domain_ou_path: ou=Workbench,dc={{ win_project }},dc=loc domain_ou_path: ou=Workbench,dc={{ win_project }},dc=loc
reboot: true reboot: true
when: "inventory_hostname in groups['meta-type_client']" when: "inventory_hostname in groups['meta-type_client']|default([])"