Hi All
I am trying to run ansible playbook to create powerdns record .pdns.yml
- name: add dns record
vars:
pilot_dns: “{{ input_dns }}”
pilot_dom: “{{ input_domain }}”
arecord: “{{ input_hostname }}”
iprecord: “{{ input_ip }}”
command: curl -X PATCH --data ‘{“rrsets”: [ {“name”: "’" {{ arecord }} “.'”, “type”: “A”, “ttl”: 86400, “changetype”: “REPLACE”, “records”: [ {“content”: “'” {{ iprecord }} “'”, “disabled”: false } ] } ] }’ -H “‘X-API-Key: changeme’” ‘http://“{{ pilot_pdns }}”:8081/api/v1/servers/localhost/zones/“{{ pilot_dom }}”.’ | jq .
tags: add_pdns
I get syntax error when i run as “ansible-playbook pdns.yml --check”
ERROR! Syntax Error while loading YAML.
The offending line appears to be:
iprecord: “{{ input_ip }}”
command: curl -X PATCH --data ‘{“rrsets”: [ {“name”: "’" {{ arecord }} “.'”, “type”: “A”, “ttl”: 86400, “changetype”: “REPLACE”, “records”: [ {“content”: “'” {{ iprecord }} “'”, “disabled”: false } ] } ] }’ -H “‘X-API-Key: changeme’” ‘http://“{{ pilot_pdns }}”:8081/api/v1/servers/localhost/zones/“{{ pilot_dom }}”.’ | jq .
^ here
any help here ?