ansible-collections / ansible-collections/google.cloud

gcp_compute_address is not idempotent when registering an INTERNAL address.

Open
#253 3 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
105
Forks
144
Avg merge
5d 10h
Merged PRs (30d)
4

Description

##### SUMMARY
gcp_compute_address is not idempotent when registering an INTERNAL address.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
gcp_compute_address.py

##### ANSIBLE VERSION

```paste below
ansible 2.9.10
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]
```

##### CONFIGURATION

```paste below

```

##### OS / ENVIRONMENT

##### STEPS TO REPRODUCE
Run the task reserve and internal address. Run the same task again, a new IP will be allocated.

```yaml

tasks:
- name: create an internal address
gcp_compute_address:
name: test-internal-ip
region: us-west1
project: project-name
address_type: INTERNAL
subnetwork: subnet/self/link
```

##### EXPECTED RESULTS

Should have been idempotent.

##### ACTUAL RESULTS

On subsequent run of task, new IP was allocated everytime.

```paste below

```
Possible cause would be because of
```
"networkTier": "PREMIUM"
```
is added as default parameter with INTERNAL addresses as well.

Contributor guide

Open the contributing guide

Research direction

Start with gcp_compute_address.py and reproduce the issue using the YAML task in the report, running it twice for an INTERNAL address. Trace how the module compares or registers the address on the second run; done means repeating the task does not allocate a new IP.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, google-cloud, python
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.