Open vitabaks opened 8 months ago
Any ideas? This blocks the implementation of GCP support for my product https://github.com/vitabaks/postgresql_cluster/pull/464
Please give me an answer.
I think I found the reason for the error. The module only works if selfLink
is set manually
example:
- name: "GCP: [Load Balancer] Create regional backend service"
google.cloud.gcp_compute_region_backend_service:
auth_kind: "serviceaccount"
service_account_contents: "{{ gcp_service_account_contents }}"
project: "{{ gcp_project | default(project_info.resources[0].projectNumber) }}"
name: "{{ patroni_cluster_name }}-primary"
description: "{{ patroni_cluster_name }} primary backend"
region: "{{ region }}"
load_balancing_scheme: "INTERNAL"
protocol: "TCP"
network:
selfLink: "global/networks/{{ gcp_network_name }}"
backends:
- group: "zones/{{ zone }}/instanceGroups/{{ patroni_cluster_name }}"
balancing_mode: "CONNECTION"
health_checks:
- "global/healthChecks/{{ patroni_cluster_name }}-primary-hc"
state: present
It doesn't work when we use register: name-of-resource
and then we try to use this variable "{{ name-of-resource }}
" for example in health_checks parameter.
Is this a bug or do we need to continue explicitly defining the selfLink ourselves? Because the documentation still says this for source of disk:
This field represents a link to a Disk resource in GCP. It can be specified in two ways. First, you can place a dictionary with key ‘selfLink’ and value of your resource’s selfLink Alternatively, you can add register: name-of-resource
to a gcp_compute_disk task and then set this source field to “{{ name-of-resource }}”
I only ask because it used to work with 'register: name-of-resource'.
Please give me an answer.
Transition to Terraform. This collection is very poorly managed, and maintained so if you have work that needs to be done then do the transition as soon as you can. Also the vote to remove the gcp_collection is up again.
I would really prefer not to delete the collection because my product is based on Ansible, and I would strongly prefer not to switch to Terraform for this.
Yep, it's a terrible collection, which isn't maintained, but prided itself on automation generating this. It's a shame that after all the press over the years this got at AnsibleFest but it never delivered. :(
I would really prefer not to delete the collection because my product is based on Ansible, and I would strongly prefer not to switch to Terraform for this.
I'd take a look at using the ansible.builtin.uri modules, they work great for this
SUMMARY
Please help me figure out why I'm getting the error "
Invalid value for field 'xxxxxx'. The project '********' was not found.
" when using thegcp_compute_target_pool
module.Upd: I also get a similar error when using the
gcp_compute_instance_group
module.ISSUE TYPE
COMPONENT NAME
google.cloud.gcp_compute_target_pool
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
MacOS
STEPS TO REPRODUCE
EXPECTED RESULTS
Successful creation of a Target Pool with health-check and a list of instances.
ACTUAL RESULTS