diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 539ae74c28..a1abea1c85 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -16,10 +16,13 @@ runtime_socket: /var/run/docker.sock redhat_username: "{{ lookup('env', 'REDHAT_USERNAME', default='') }}" redhat_password: "{{ lookup('env', 'REDHAT_PASSWORD', default='') }}" -excluded_pairs: - # e.g. - ['ubuntu-1804-lts', 'core_bpf'] - - ['rhel-8.8-05102023', 'ebpf'] - - ['rhel-86-05162022', 'core_bpf'] +excluded_vms: + # Specify, family, image, or platform + # e.g. + # - ubuntu-1804-lts + # - rhel-arm64 + # - rhcos-413-86-202303151429-0-gcp-x86-64 + - virtual_machines: rhel: @@ -49,7 +52,6 @@ virtual_machines: arch: ppc64le ssh_key_file: "~/.ssh/acs-ppc64le-rsa.prv" images: - - rhel-86-05162022 - rhel-8.8-05102023 rhel-sap: diff --git a/ansible/roles/create-vm/tasks/main.yml b/ansible/roles/create-vm/tasks/main.yml index 1a8f6b7e26..599a0ebfeb 100644 --- a/ansible/roles/create-vm/tasks/main.yml +++ b/ansible/roles/create-vm/tasks/main.yml @@ -1,26 +1,17 @@ --- -# -# Exclusion precedence: -# 1. ppc64le is the only platform allowed to run eBPF -# 2. specific exclusions defined group_vars/all.yml -# -# Consider each set_fact to be a rule, and subsequent rules are only -# processed if the previous rules do not exclude this combination of -# vm and collection method. -# -- name: Check eBPF excluded +- name: Check platform excluded set_fact: - excluded: "{{ test_platform != 'rhel-ppc64le' and vm_collection_method == 'ebpf' }}" + excluded: "{{ test_platform in excluded_vms }}" - name: Check family excluded set_fact: - excluded: "{{ [vm_family, vm_collection_method] in excluded_pairs }}" + excluded: "{{ vm_family in excluded_vms }}" when: vm_image is not defined and excluded == false - name: Check image excluded set_fact: - excluded: "{{ [vm_image, vm_collection_method] in excluded_pairs }}" + excluded: "{{ vm_image in excluded_vms }}" when: vm_image is defined and excluded == false - block: