Hi,

I'm using ansible 2.7.

I am trying to set a bunch of dns records for my project using 
the gcp_dns_resource_record_set module.
This works just fine:
- name: create a resource record set for {{env}}
  gcp_dns_resource_record_set:
    name: "{{ env }}.{{ dns_name }}"
    managed_zone: "{{ my_managed_zone }}"
    type: A
    ttl: 300 
    target:
    - "{{ new_global_ip.address }}"
    project: "{{ project_id }}"
    auth_kind: "{{ auth_kind }}"
    service_account_file: "{{ credentials_file }}"
    state: present

My record is being created.

Trying to set a CNAME record like ...
- name: create a resource record set for *.{{env}}.{{dns_name}}
  gcp_dns_resource_record_set:
    name: "*.{{ env }}.{{ dns_name }}"
    managed_zone: "{{ my_managed_zone }}"
    type: CNAME
    ttl: 600
    target:
    - "{{ env }}.{{dns_name }}"
    project: "{{ project_id }}"
    auth_kind: "{{ auth_kind }}"
    service_account_file: "{{ credentials_file }}"
    state: present

This is NOT working....
The full traceback is:
Traceback (most recent call last):
  File 
"/home/kloeffler/.ansible/tmp/ansible-tmp-1545164919.18-37286040098745/AnsiballZ_gcp_dns_resource_record_set.py",
 
line 113, in <module>
    _ansiballz_main()
  File 
"/home/kloeffler/.ansible/tmp/ansible-tmp-1545164919.18-37286040098745/AnsiballZ_gcp_dns_resource_record_set.py",
 
line 105, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File 
"/home/kloeffler/.ansible/tmp/ansible-tmp-1545164919.18-37286040098745/AnsiballZ_gcp_dns_resource_record_set.py",
 
line 48, in invoke_module
    imp.load_module('__main__', mod, module, MOD_DESC)
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
473, in <module>
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
185, in main
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
196, in create
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
387, in create_change
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
405, in resource_to_change_request
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
393, in update_soa
  File 
"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py", line 
378, in prefetch_soa_resource
ValueError: Google DNS Managed Zone XXXXXXXXXXXXX not found

fatal: [localhost]: FAILED! => {
    "changed": false, 
    "module_stderr": "Traceback (most recent call last):\n  File 
\"/home/kloeffler/.ansible/tmp/ansible-tmp-1545164919.18-37286040098745/AnsiballZ_gcp_dns_resource_record_set.py\",
 
line 113, in <module>\n    _ansiballz_main()\n  File 
\"/home/kloeffler/.ansible/tmp/ansible-tmp-1545164919.18-37286040098745/AnsiballZ_gcp_dns_resource_record_set.py\",
 
line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, 
ANSIBALLZ_PARAMS)\n  File 
\"/home/kloeffler/.ansible/tmp/ansible-tmp-1545164919.18-37286040098745/AnsiballZ_gcp_dns_resource_record_set.py\",
 
line 48, in invoke_module\n    imp.load_module('__main__', mod, module, 
MOD_DESC)\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 473, in <module>\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 185, in main\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 196, in create\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 387, in create_change\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 405, in resource_to_change_request\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 393, in update_soa\n  File 
\"/tmp/ansible_gcp_dns_resource_record_set_payload_h2FmDS/__main__.py\", 
line 378, in prefetch_soa_resource\nValueError: Google DNS Managed Zone 
XXXXXXXXXXXXX not found\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 
    "rc": 1


As you can see in the ansible calls, I am usingthe same {{ my_managed_zone 
}} (which I got by calling gcp_dns_managed_zone ).
It is also not working for A records like " something.{{ env }}.{{ dns_name 
}}. "

Help?
Anyone?
What am I missing?

Thanks!
Katja

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d419fe3c-60ac-44cd-a1d0-94705cff0ca1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to