mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-08 11:50:28 -07:00
WIP: fix compute instance + several tests
compute selflinks return back `wwww.googleapis.com` as the domain, which was causing a perma-diff. Fixing google.cloud's normalization fixes that. Fixing the following tests as well, since creating an instance now works: - gcp_compute_instance - gcp_compute_instance_group - gcp_compute_instance_group_manager - gcp_compute_instance_template - gcp_compute_region_autoscaler - gcp_compute_region_instance_group_manager - gcp_compute_target_instance - gcp_compute_target_pool
This commit is contained in:
parent
4816e97719
commit
0fc41bbda4
17 changed files with 36 additions and 32 deletions
|
@ -1379,9 +1379,9 @@ def disk_type_selflink(name, params):
|
||||||
def machine_type_selflink(name, params):
|
def machine_type_selflink(name, params):
|
||||||
if name is None:
|
if name is None:
|
||||||
return
|
return
|
||||||
url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*/machineTypes/.*"
|
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*/machineTypes/.*"
|
||||||
if not re.match(url, name):
|
if not re.match(url, name):
|
||||||
name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/machineTypes/%s".format(**params) % name
|
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/machineTypes/%s".format(**params) % name
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
|
@ -263,7 +263,7 @@
|
||||||
google.cloud.gcp_compute_disk:
|
google.cloud.gcp_compute_disk:
|
||||||
name: "{{ resource_prefix }}"
|
name: "{{ resource_prefix }}"
|
||||||
size_gb: 50
|
size_gb: 50
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: present
|
state: present
|
||||||
register: network
|
register: network
|
||||||
- name: delete a instance group
|
- name: delete a instance group
|
||||||
|
@ -144,6 +145,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: absent
|
state: absent
|
||||||
register: network
|
register: network
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: present
|
state: present
|
||||||
register: network
|
register: network
|
||||||
- name: create a address
|
- name: create a address
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -171,7 +172,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -201,6 +202,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: absent
|
state: absent
|
||||||
register: network
|
register: network
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: present
|
state: present
|
||||||
register: network
|
register: network
|
||||||
- name: create a address
|
- name: create a address
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -59,7 +60,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -99,7 +100,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -125,7 +126,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -165,7 +166,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -201,6 +202,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: absent
|
state: absent
|
||||||
register: network
|
register: network
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: present
|
state: present
|
||||||
register: network
|
register: network
|
||||||
- name: create a address
|
- name: create a address
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -216,7 +217,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -246,6 +247,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: absent
|
state: absent
|
||||||
register: network
|
register: network
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: present
|
state: present
|
||||||
register: network
|
register: network
|
||||||
- name: create a address
|
- name: create a address
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -171,7 +172,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
machine_type: n1-standard-1
|
machine_type: n1-standard-1
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
|
@ -201,6 +202,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: absent
|
state: absent
|
||||||
register: network
|
register: network
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: present
|
state: present
|
||||||
register: network
|
register: network
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
labels:
|
labels:
|
||||||
environment: production
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
|
@ -150,7 +151,7 @@
|
||||||
- auto_delete: 'true'
|
- auto_delete: 'true'
|
||||||
boot: 'true'
|
boot: 'true'
|
||||||
initialize_params:
|
initialize_params:
|
||||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2204-lts
|
||||||
labels:
|
labels:
|
||||||
environment: production
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
|
@ -168,6 +169,7 @@
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
auto_create_subnetworks: true
|
||||||
state: absent
|
state: absent
|
||||||
register: network
|
register: network
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
cloud/gcp
|
cloud/gcp
|
||||||
unsupported
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue