--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/904af85e-17bb-4975-92a7-ad60eeac9c68n%40googlegroups.com.
- name: Locate Instance
hosts: localhost
gather_facts: false
tasks:
- name: search for google instances
gcp_compute_instance_info:
filters:
# - tags.items = [webserver]
- name = webserver
zone: us-central1-a
project: {{ gcp_project }}
auth_kind: serviceaccount
service_account_file: {{ service_account }}
scopes:
- https://www.googleapis.com/auth/compute
register: instances
- name: Add all the retrieved instances ip_address to a dynamic inventory
add_host: hostname={{ item.networkInterfaces[0].accessConfigs[0].natIP }} groupname=new_instances
with_items: "{{ instances.resources }}"
# - "{{ disk['resources']['name'] }}"
# - "{{ ansible_facts }}"
# - "{{ gcp_compute_disk_name | select('match', '^(gcp-compute-disk)') | list }}"
when: instances is defined
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/2Y5orHeAH40/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwNmpb8D28Fdvn5i2a%2BL7ZmVByg5pYgyUVvi_-7VW3EpRQ%40mail.gmail.com.