File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -23,5 +23,7 @@ freeipa_host_group__env_name: "{{ common__env_name }}"
2323freeipa_host_group__infra_type : " {{ common__infra_type }}"
2424freeipa_host_group__region : " {{ common__region }}"
2525
26+ freeipa_host_group__gcp_project : " {{ common__gcp_project }}"
27+
2628# Outputs
2729freeipa_host_group__host_group_name : " freeipa_server_hosts"
Original file line number Diff line number Diff line change 4646# when: freeipa_host_group__infra_type == "azure"
4747# block:
4848
49- # TODO: A block per cloud provider - GCP
5049# Get instance details for specific infra_type - GCP
51- # - name: Gather FreeIPA instance details on GCP
52- # when: freeipa_host_group__infra_type == "gcp"
53- # block:
50+ - name : Gather FreeIPA instance details on GCP
51+ when : freeipa_host_group__infra_type == "gcp"
52+ block :
53+ - name : Gather Address information used by FreeIPA GCP instance
54+ google.cloud.gcp_compute_address_info :
55+ region : " {{ freeipa_host_group__region }}"
56+ project : " {{ freeipa_host_group__gcp_project }}"
57+ # Filter on the freeipa instance name with the timestamp stripped
58+ filters :
59+ - " name : {{ __freeipa_server_instance_id | regex_replace('[^-]+$', '') }}*"
60+ register : __gcp_freeipa_address_info
61+
62+ - name : Set facts for the FreeIPA server IP
63+ ansible.builtin.set_fact :
64+ __freeipa_server_public_ip : " {{ __gcp_freeipa_address_info.resources | map(attribute='address') }}"
5465
5566# Add the FreeIPA server and username to the inventory
5667- name : Add FreeIPA servers to inventory
You can’t perform that action at this time.
0 commit comments