You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i create a disk with the module gcp_compute_disk.py first time the task is changed. This is okay. But if i rerun the Playbook without any change the task is every time in state changed. Not in state OK as expected.
I did a bit of debugging and found the following Issue.
On the diff (Method: def is_different(module, response):) the Resulsts are different. Here is the Output I got on a second round:
(I added a print with DIFFFF and the output of the two objects:
This is what I tried and was successfull. Change the creation of the disk_type_selflink method from compute.googleapis.com to www.googleapis.com. --> This worked for me.
Here is a patchfile with my Changes.
--- /gcp_compute_disk.py 2024-06-24 13:26:12.924958064 +0200+++ /usr/lib/python3/dist-packages/ansible_collections/google/cloud/plugins/modules/gcp_compute_disk.py 2024-06-24 13:46:13.724766189 +0200@@ -753,9 +753,9 @@
def disk_type_selflink(name, params):
if name is None:
return
- url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*"+ url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*"
if not re.match(url, name):
- name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name+ name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name
This could also occur on other modules. Maybe we need a general solution for this topic.
The text was updated successfully, but these errors were encountered:
SUMMARY
If i create a disk with the module gcp_compute_disk.py first time the task is changed. This is okay. But if i rerun the Playbook without any change the task is every time in state changed. Not in state OK as expected.
ISSUE TYPE
COMPONENT NAME
gcp_compute_disk.py
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
OS: Ubuntu 24.04 LTS with GCP
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
I did a bit of debugging and found the following Issue.
On the diff (Method: def is_different(module, response):) the Resulsts are different. Here is the Output I got on a second round:
(I added a print with DIFFFF and the output of the two objects:
As you can see the request Variable:
as the type of the disk.
So we can either fix this on this compare if we replace the Domain Part or we change the following lines.
This is what I tried and was successfull. Change the creation of the disk_type_selflink method from compute.googleapis.com to www.googleapis.com. --> This worked for me.
Here is a patchfile with my Changes.
This could also occur on other modules. Maybe we need a general solution for this topic.
The text was updated successfully, but these errors were encountered: