Debian Codegraph @

ansible_collections/google/cloud/tests/integration/targets/inventory_gce/testcase_hostname.yml

raw
1 ---
2 - name: TEST | print hosts
3 ansible.builtin.debug:
4 var: groups
5
6 - name: TEST | fetch instance info for vm1
7 google.cloud.gcp_compute_instance_info:
8 filters:
9 - name = {{ prefix }}-vm1
10 zone: "{{ gcp_zone }}"
11 project: "{{ gcp_project }}"
12 auth_kind: "{{ gcp_cred_kind }}"
13 service_account_file: "{{ gcp_cred_file }}"
14 scopes:
15 - https://www.googleapis.com/auth/compute
16 register: _vm
17
18 - name: TEST | compare API vs inventory hostnames
19 ansible.builtin.assert:
20 that:
21 - _vm.resources | length > 0
22 - _vm.resources[0].hostname in groups['gcp_dns_static']