mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-30 16:41:28 -07:00
22 lines
608 B
YAML
22 lines
608 B
YAML
---
|
|
- name: TEST | print hosts
|
|
ansible.builtin.debug:
|
|
var: groups
|
|
|
|
- name: TEST | fetch instance info for vm1
|
|
google.cloud.gcp_compute_instance_info:
|
|
filters:
|
|
- name = {{ prefix }}-vm1
|
|
zone: "{{ gcp_zone }}"
|
|
project: "{{ gcp_project }}"
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
scopes:
|
|
- https://www.googleapis.com/auth/compute
|
|
register: _vm
|
|
|
|
- name: TEST | compare API vs inventory hostnames
|
|
ansible.builtin.assert:
|
|
that:
|
|
- _vm.resources | length > 0
|
|
- _vm.resources[0].hostname in groups['gcp_dns_static']
|