Hi
I have this task:
- name: Edit DHCP Client settings
lineinfile: dest=/etc/dhcp/dhclient.conf line={{ item }} state=present
with_items:
- supersede domain-search "example.com","local.example.com";
- default domain-name "example.com";
And I always get this error:
failed: [127.0.0.1] => (item=supersede domain-search
> "example.com","local.example.com";) => {"failed": true, "item": "supersede
> domain-search \"example.com\",\"local.example.com\";"}
> msg: this module requires key=value arguments
> (['dest=/etc/dhcp/dhclient.conf', 'line=supersede', 'domain-search',
> 'example.com,local.example.com;', 'state=present'])
> failed: [127.0.0.1] => (item=default domain-name "example.com";) =>
> {"failed": true, "item": "default domain-name \"example.com\";"}
> msg: this module requires key=value arguments
> (['dest=/etc/dhcp/dhclient.conf', 'line=default', 'domain-name',
> 'example.com;', 'state=present'])
I have tried to put whole line in quotes like this:
lineinfile: "dest=/etc/dhcp/dhclient.conf line={{ item }} state=present"
Also tried nested quotes like this:
with_items:
- "supersede domain-search 'example.com','local.example.com';"
- "default domain-name 'example.com';"
Also tried to escape double-quotes and single-quotes.
But still getting the same error. What is the correct way to put quotes
here?
Thanks in advance
Edgars
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/df489bc6-b3de-4015-9e50-8b7965f67119%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.