Open dmitriy-lifanov opened 1 year ago
Hello! taking a brief look, name
is required in every element in the patch_matchers
list.
Your second and third path_rules
elements don't include a name:
- path_rules:
- paths:
- '/'
- '/*'
- service: '{{ backendservice }}'
Perhaps you meant to have them all be the same object?
path_matchers:
- name: '{{ instance_name }}'
path_rules:
- paths:
- '/'
- '/*'
service: '{{ backendservice }}'
I have tried this example and it's not working:
- name: '{{ instance_name }}'
path_rules:
- paths:
- '/'
- '/*'
service: '{{ backendservice }}'
Also I have tried to modify it like this:
- name: create a URL map
google.cloud.gcp_compute_url_map:
name: 'urlmap-forwardingrule-path_matcher'
project: '{{ gcp_project }}'
auth_kind: '{{ gcp_cred_kind }}'
host_rules:
- hosts: '{{ instance_name }}'
- path_matcher: '{{ instance_name }}-matcher'
path_matchers:
- name: '{{ instance_name }}-matcher'
- path_rules:
- paths:
- '/'
- '/*'
- service: '{{ backendservice }}'
And got such an error:
TASK [gcloud/create_lb : create a URL map] ***********************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "missing required arguments: path_matcher found in host_rules"}
Can you explain the error you got with the first example?
In your second example, I believe it's failing because your split the map into list elements, and are now missing the path_matcher
field in the first entry (withhosts
).
That's fixed by joining the list elements:
host_rules:
- hosts: '{{ instance_name }}'
path_matcher: '{{ instance_name }}-matcher'
This example returns such an error:
- name: create a URL map
google.cloud.gcp_compute_url_map:
name: 'urlmap-forwardingrule-path_matcher'
project: '{{ gcp_project }}'
auth_kind: '{{ gcp_cred_kind }}'
host_rules:
- hosts: '{{ instance_name }}'
path_matcher: '{{ instance_name }}-matcher'
path_matchers:
- name: '{{ instance_name }}'
path_rules:
- paths:
- '/'
- '/*'
service: '{{ backendservice }}'
TASK [gcloud/create_lb : create a URL map] ***********************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (google.cloud.gcp_compute_url_map) module: path_matchers.service. Supported parameters include: default_service, default_url_redirect, path_matchers, service_account_email, name, tests, project, state, default_route_action, env_type, auth_kind, header_action, service_account_contents, service_account_file, host_rules, scopes, description."}
And the second one also returns another error:
- name: create a URL map
google.cloud.gcp_compute_url_map:
name: 'urlmap-forwardingrule-path_matcher'
project: '{{ gcp_project }}'
auth_kind: '{{ gcp_cred_kind }}'
host_rules:
- hosts: '{{ instance_name }}'
path_matcher: '{{ instance_name }}-matcher'
path_matchers:
- name: '{{ instance_name }}-matcher'
- path_rules:
- paths:
- '/'
- '/*'
- service: '{{ backendservice }}'
TASK [gcloud/create_lb : create a URL map] ***********************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "missing required arguments: name found in path_matchers"}
SUMMARY
Following this manual I can't create URL map
ISSUE TYPE
COMPONENT NAME
google.cloud.gcp_compute_url_map
ANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
Linux elementary OS 6.1 Jólnir
STEPS TO REPRODUCE
EXPECTED RESULTS
Url Map is created
ACTUAL RESULTS
Got an error