Refactor inventory_gce tests to make the linter happy

This commit is contained in:
Chris Hawk 2025-06-20 15:28:16 -07:00
commit 5cd81072c4
7 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@
connection: local connection: local
gather_facts: false gather_facts: false
vars_files: vars_files:
- vars.yml - ../vars.yml
tasks: tasks:
- name: SETUP | Create network - name: SETUP | Create network
google.cloud.gcp_compute_network: google.cloud.gcp_compute_network:

View file

@ -4,7 +4,7 @@
connection: local connection: local
gather_facts: false gather_facts: false
vars_files: vars_files:
- vars.yml - ../vars.yml
tasks: tasks:
- name: TEARDOWN | Delete instance # noqa: ignore-errors - name: TEARDOWN | Delete instance # noqa: ignore-errors
google.cloud.gcp_compute_instance: google.cloud.gcp_compute_instance:

View file

@ -4,7 +4,7 @@
connection: local connection: local
gather_facts: false gather_facts: false
vars_files: vars_files:
- vars.yml - ../vars.yml
tasks: tasks:
- name: TEST | render inventory file - name: TEST | render inventory file
ansible.builtin.copy: ansible.builtin.copy:
@ -27,4 +27,4 @@
- name: TEST | run test case - name: TEST | run test case
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "testcase_{{ testcase }}.yml" file: "../testcase_{{ testcase }}.yml"

View file

@ -11,7 +11,7 @@ RC=0
# we want to run teardown regardless of playbook exit status, so catch the # we want to run teardown regardless of playbook exit status, so catch the
# exit code of ansible-playbook manually # exit code of ansible-playbook manually
set +e set +e
for ts in playbooks/testcase_*.yml; for ts in testcase_*.yml;
do do
testcase=$( basename "$ts" | sed -e 's/testcase_//' | sed -e 's/.yml//' ) testcase=$( basename "$ts" | sed -e 's/testcase_//' | sed -e 's/.yml//' )
ansible-playbook playbooks/test.yml "$@" --extra-vars "testcase=${testcase}" ansible-playbook playbooks/test.yml "$@" --extra-vars "testcase=${testcase}"