Specify it this way

  - 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";

Thanks!
Michael

On Thursday, October 23, 2014 4:01:54 AM UTC-5, Edgars wrote:
>
> 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/c71d6409-0ce3-425d-8b20-5540e3c4411d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to