The documentation states that multiple DNS entries should be formatted like so:
|
A list of upto 3 dns servers, ipv4 format e.g. To add two IPv4 DNS server addresses: [“8.8.8.8 8.8.4.4”]
Following that example, I get the error: “Error: failed to modify ipv4.dns: invalid IPv4 address ‘["216.xxx.xxx.xxx’.\n”
|
- | - |
The documentation provides examples that include:
# To add two IPv4 DNS server addresses:
-nmcli: conn_name=my-eth1 dns4=["8.8.8.8", "8.8.4.4"] state=present
When I follow that example, I end up with an extra params error and template expressions erro:
ERROR! this task 'nmcli' has extra params, which is only allowed in the following modules...
Always quote template expression brackets when they start a value...
---
- hosts: redacted
user: redacted
sudo: yes
pre_tasks:
- nmcli: 'conn_name="{{ ansible_interfaces[1] }}"
state=present
type=ethernet
ip4=redacted
gw4=redacted
dns4=["redacted", "8.8.8.8", "redacted"]'
I've tried swapping the quotes around, with singles inside and doubles outside, and got the same extra params error. I haven't cracked the syntax just right yet.
I'd love a pointer for what to try next.