ansible-collections / ansible-collections/google.cloud
gcp_dns_resource_record_set does not work with service_account_contents
- Dominant language
- Python
- Stars
- 105
- Forks
- 144
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 4
Description
##### SUMMARY
Migrating old issue over from: https://github.com/ansible/ansible/issues/58242 Still happening for me on ansible 2.9.10
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
gcp_dns_resource_record_set
##### ANSIBLE VERSION
```paste below
ansible 2.9.10
config file = /Users/user/workspace/devops-ansible/ansible.cfg
configured module search path = ['/Users/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/Cellar/ansible/2.9.10/libexec/lib/python3.8/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
```
##### STEPS TO REPRODUCE
```yaml
- name: DNS setup
hosts: localhost
gather_facts: false
become: false
vars:
target_ip: "123.123.123.123"
gcp_project: "PROJECT"
gcp_cred_kind: serviceaccount
gcp_cred_content: "{{ gcp_service_account_PROJECT }}"
gcp_cred_file: "./PROJECT-12345678.json"
tasks:
- name: create dns zones
gcp_dns_managed_zone:
name: foo-zone
dns_name: bar.foo.
description: "foo"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: present
register: registered_zones
- name: Create dns records
gcp_dns_resource_record_set:
managed_zone: "{{ registered_zones }}"
name: "www.bar.foo."
target:
- "{{ target_ip }}"
type: "A"
ttl: 3600
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_contents: "{{ gcp_cred_content }}"
# this works
#service_account_file: "{{ gcp_cred_file }}"
state: present
```
##### EXPECTED RESULTS
I expect the dns records to actually be created regardless if service_account_contents or service_account_file is used.
##### ACTUAL RESULTS
```paste below
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Credential type 'serviceaccount' not implemented"}
```
Contributor guide
Research direction
Start by reproducing the failure with the provided playbook and the gcp_dns_resource_record_set component, comparing service_account_contents with the working service_account_file setting. Trace how the module handles the serviceaccount auth_kind and credentials, then verify that the DNS record is created successfully when credentials are supplied as contents.
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
- Clearly specified
- Newbie friendliness
- 72/100