blob: 1124b0ea3e4cb5a441b6e7bd55b8d9ad069ac54e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
---
- name: Generate oo_list_hosts group
hosts: localhost
gather_facts: no
tasks:
- set_fact: scratch_group=tag_env-{{ cluster_id }}
when: cluster_id != ''
- set_fact: scratch_group=all
when: scratch_group is not defined
- add_host: name={{ item }} groups=oo_list_hosts
with_items: groups[scratch_group] | difference(['localhost']) | difference(groups.status_terminated)
- name: List Hosts
hosts: oo_list_hosts
gather_facts: no
tasks:
- debug: msg="public:{{hostvars[inventory_hostname].gce_public_ip}} private:{{hostvars[inventory_hostname].gce_private_ip}}"
|