Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route53 error when creating a TXT record #6112

Closed
spatten opened this issue Feb 21, 2014 · 4 comments
Closed

Route53 error when creating a TXT record #6112

spatten opened this issue Feb 21, 2014 · 4 comments
Labels
bug This issue/PR relates to a bug. cloud

Comments

@spatten
Copy link
Contributor

spatten commented Feb 21, 2014

Issue Type:

Bug Report

Ansible Version:
# ansible --version
ansible 1.4.5
Environment:

Running on OS X. Managing Ubuntu 12.04 LTS on AWS.

Summary:

I can't create a TXT record with the route53 module

Steps To Reproduce:

Run this playbook:

tasks:
  - route53: >
      command=create
      zone={{ domain }}
      record={{ domain }}
      type=TXT
      value="test"
      overwrite=true
      aws_access_key={{ aws_access_key }}
      aws_secret_key={{ aws_secret_key }}

Things work fine if I try to create a CNAME or A or MX record with the same variables. For example, this works:

- route53: >
    command=create
    zone={{ domain }}
    record=www.{{ domain }}
    type=CNAME
    value={{ domain }}
    aws_access_key={{ aws_access_key }}
    aws_secret_key={{ aws_secret_key }}

For TXT records I get the following error:

msg: Invalid Resource Record: FATAL problem: InvalidTXTRDATA encountered at test

I've checked and checked and I'm pretty sure that it's not me.

Expected Results:

A TXT record is created

Actual Results:

I get the following output:

msg: Invalid Resource Record: FATAL problem: InvalidTXTRDATA encountered at test
@spatten
Copy link
Contributor Author

spatten commented Feb 21, 2014

Sorry, I figured out the problem. TXT records need to be surrounded by double-quotes. This works:

- route53: >
    command=create
    zone={{ domain }}
    record={{ domain }}
    type=TXT
    value='"test"'
    overwrite=true
    aws_access_key={{ aws_access_key }}
    aws_secret_key={{ aws_secret_key }}

@spatten spatten closed this as completed Feb 21, 2014
@conrado
Copy link
Contributor

conrado commented Dec 1, 2014

Anyone else think this is kind of wrong?

@bseddon
Copy link

bseddon commented Jan 26, 2016

@spatten Thanks for posting the fix. Who would have thought...

@RRAlex
Copy link

RRAlex commented Nov 14, 2016

For others trying to fit 2 values in a TXT record, the format is without brackets or lists, but simply by single quoting all the values once:

value: '"First value", "2nd val"'

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. cloud
Projects
None yet
Development

No branches or pull requests

7 participants