How do I get my task to return the output as key=value pairs? I'd like to 
set the four values returned when I do msg= to key name nameserver1,2,3,4.

- debug: msg="{{route53_hosted_zones.stdout.split() }}"

- debug: var={{route53_hosted_zones.stdout.split() }}

TASK: [route53 | debug msg="{{route53_hosted_zones.stdout.split()}}"] 
********* 
<localhost> ESTABLISH CONNECTION FOR USER: ubuntu
ok: [localhost] => {
    "item": "", 
    "msg": "[u'ns-892.awsdns-47.net', u'ns-167.awsdns-20.com', 
u'ns-1965.awsdns-53.co.uk', u'ns-1105.awsdns-10.org']"
}

TASK: [route53 | debug var={{route53_hosted_zones.stdout.split()}}] 
*********** 
<localhost> ESTABLISH CONNECTION FOR USER: ubuntu
ok: [localhost] => {
    "[uns-892.awsdns-47.net,": "{{ [uns-892.awsdns-47.net, }}", 
    "item": ""
}

The task:

- name: create {{ domain_name }} zone
  local_action: shell executable=/bin/sh aws route53 create-hosted-zone 
--name {{ domain_name }} --caller-reference Job{{ job_number }} --query 
DelegationSet.NameServers --output text
  register: route53_hosted_zones

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to