ansible-collections / ansible-collections/google.cloud
gcp_compute_instance module doesn't update instance tags
- Dominant language
- Python
- Stars
- 105
- Forks
- 144
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 4
Description
### SUMMARY
gcp_compute_instance module doesn't update instance tags for an existing instance.
For example the same module can update labels, but apparently not tags.
code to update labels: https://github.com/ansible-collections/google.cloud/blob/7fa00db18cdc287629b851b80f05cb321f15e8d9/plugins/modules/gcp_compute_instance.py#L1209-L1214
but no code to update tags
fyi this issue was also reported in the ansible repository few years ago:
https://github.com/ansible/ansible/issues/47883
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
gcp_compute_instance
##### ANSIBLE VERSION
```
ansible 2.9.11
config file = /home/alex/ansible-project/ansible.cfg
configured module search path = ['/home/alex/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/alex/.local/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.5 (default, Aug 12 2020, 00:00:00) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
```
##### CONFIGURATION
```
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/alex/.vault_pass.txt
HOST_KEY_CHECKING(/home/alex/ansible-project/ansible.cfg) = False
INVENTORY_ENABLED(/home/alex/ansible-project/ansible.cfg) = ['google.cloud.gcp_compute', 'auto', 'yaml', 'ini', 'toml']
```
##### OS / ENVIRONMENT
Fedora 32
##### STEPS TO REPRODUCE
- create instance without defining tags with gcp_compute_instance module
- define some tags
- run the playbook again
##### EXPECTED RESULTS
machine has the tags defined
##### ACTUAL RESULTS
machine doesn't have tags defined
Contributor guide
Research direction
Start in plugins/modules/gcp_compute_instance.py around the label-update code linked in the issue, and trace how an existing instance is reconciled on a second playbook run. Reproduce the stated create-then-add-tags sequence; done means the existing GCP instance has the newly defined tags after the update run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100