# Newbie query

**URL:** <https://forum.ansible.com/t/newbie-query/32595>\
**Category:** Ansible Project\
**Created:** [April 3, 2020, 8:34am UTC](https://forum.ansible.com/t/newbie-query/32595 "2020-04-03T08:34:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_StubbfFamily](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@The\_StubbfFamily](https://forum.ansible.com/u/The_StubbfFamily)\
**Post date:** [April 3, 2020, 8:34am UTC](https://forum.ansible.com/t/newbie-query/32595/1 "2020-04-03T08:34:08Z")

</div>

I am trying to automate the creation of a TXT record on Route53. I am having issues with the playbook and decided to strip it right back to a basic invocation:

ansible -vvv -m “route53” -a 'ttl=3600 aws\_secret\_key=‘secret’ [zone=xxx.net](http://zone=xxx.net) record=\_acme-challenge.aaa.yyy.xxx.net retry\_interval=500 private\_zone=False state=present type=TXT wait\_timeout=300 wait=True aws\_access\_key=‘key’ value=VK1\_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM ’ localhost

Route53 is expecting the value enclosed in " " - no matter how I encapsulate the value I get the same error:

localhost | FAILED! =\> {  
“changed”: false,  
“invocation”: {  
“module\_args”: {  
“alias”: null,  
“alias\_evaluate\_target\_health”: false,  
“alias\_hosted\_zone\_id”: null,  
“aws\_access\_key”: “key”,  
“aws\_secret\_key”: “secret”,  
“ec2\_url”: null,

“failover”: null,  
“health\_check”: null,  
“hosted\_zone\_id”: null,  
“identifier”: null,  
“overwrite”: null,  
“private\_zone”: false,  
“profile”: null,  
“record”: “\_acme-challenge.aaa.bbb.ccc.net”,  
“region”: null,  
“retry\_interval”: 500,  
“security\_token”: null,  
“state”: “present”,  
“ttl”: 3600,  
“type”: “TXT”,  
“validate\_certs”: true,  
“value”: [  
“VK1\_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM”  
],  
“vpc\_id”: null,  
“wait”: true,  
“wait\_timeout”: 300,  
“weight”: null,  
“zone”: “[ccc.net](http://ccc.net)”  
}  
},  
“msg”: “[Invalid Resource Record: FATAL problem: InvalidCharacterString (Value should be enclosed in quotation marks) encountered with ‘VK1\_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM’]”  
}

What am I doing wrong ?

Thanks

Andy

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [April 3, 2020, 8:40am UTC](https://forum.ansible.com/t/newbie-query/32595/2 "2020-04-03T08:40:03Z")

</div>

Hi Andy,

> ansible -vvv -m "route53" -a 'ttl=3600 aws\_secret\_key='secret'  
> zone=xxx.net record=\_acme-challenge.aaa.yyy.xxx.net  
> retry\_interval=500 private\_zone=False state=present type=TXT  
> wait\_timeout=300 wait=True aws\_access\_key='key'  
> value=VK1\_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM ' localhost

try `value='"VK1_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM"'` or  
`value="VK1_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM"`. (It's better to  
use playbooks with YAML syntax. There it is easier to understand what  
happens IMO.)

Route53 wants the value passed by Ansible to be enclosed in double  
quotes, so you have to give Ansible a string which \*contains\* double  
quotes as well.

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [April 3, 2020, 1:56pm UTC](https://forum.ansible.com/t/newbie-query/32595/3 "2020-04-03T13:56:48Z")

</div>

Hi,

> This is the task:
> 
> &nbsp;&nbsp;- name: create AWS Route53 TXT records  
> &nbsp;&nbsp;&nbsp;&nbsp;route53:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aws\_access\_key: "{{ vars.var\_aws\_access\_key }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aws\_secret\_key: "{{ vars.var\_aws\_secret\_key }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zone: "{{ aws\_zone }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;record: "{{ challenge.challenge\_data[item]['dns-01'].record  
> }} " type: TXT  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: '"VK1\_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM"'

Could you try:

&nbsp;&nbsp;value:  
&nbsp;&nbsp;&nbsp;&nbsp;- '"VK1\_axFJiaazkF0eaz6erW9VebwrNqko8PvaHHte1EM"'

instead? Maybe that works better.

(The idea is that potentially the "convert string to list" step which  
will happen if a string is passed for a list option might remove the  
quotes.)

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: present  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wait: yes  
> &nbsp;&nbsp;&nbsp;&nbsp;with\_items: "{{ [crt\_common\_name] }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;when: challenge is changed  
> &nbsp;&nbsp;&nbsp;&nbsp;debugger: on\_failed

This looks very much like you're trying to use the acme\_certificate  
module. If that's true, you should change the `when:` condition to

&nbsp;&nbsp;when: |  
&nbsp;&nbsp;&nbsp;&nbsp;challenge is changed and  
&nbsp;&nbsp;&nbsp;&nbsp;crt\_common\_name in challenge.challenge\_data

(just putting it into three lines to avoid auto-inserted linebreaks)

The example in the acme\_certificate documentation was missing that and  
will be updated soon  
([https://github.com/ansible/ansible/pull/68630/files](https://github.com/ansible/ansible/pull/68630/files)).

Cheers,  
Felix
