How to fix this nmcli error - Error: invalid <setting>.<property> 'autoconnect'.\n"

1,085 views
Skip to first unread message

Joanna Delaporte

unread,
Nov 23, 2015, 2:10:40 PM11/23/15
to Ansible Project
fatal: [redacted]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"autoconnect": "yes", "conn_name": "enp5s0", "dns4": "redacted", "gw4": "redacted", "ip4": "redacted", "state": "present", "type": "ethernet"}, "module_name": "nmcli"}, "msg": "Error: invalid <setting>.<property> 'autoconnect'.\n", "name": "enp5s0", "rc": 2}

---
# This is a role to configure my workstation.

- hosts: redacted
  user: redacted
  sudo: yes
  pre_tasks:
  - nmcli: 'conn_name="{{ ansible_interfaces[1] }}"
          state=present
          type=ethernet
          autoconnect=yes
          ip4="redacted"
          gw4="redacted"
          dns4="redacted"'

Joanna Delaporte

unread,
Nov 23, 2015, 9:40:20 PM11/23/15
to Ansible Project
Well, to make the play run, I removed " autoconnect=yes" line. However, that is supposedly the default, so I am not sure why that line was turning into 'autoconnect'.\n. I tried a few different methods of quoting, putting the whole play on one line, etc. Every syntax method I tried returned the same "'autoconnect'.\n" in the debug output. Removing the autoconnect assignment made the play run smoothly for each different syntax attempt.

Joanna Delaporte

unread,
Nov 23, 2015, 10:58:28 PM11/23/15
to Ansible Project
The module code appears to break while parsing the dictionary into a string, at or near line 505. This happens with the DNS entry when I pass in more than one entry as well. 

505 dstr+="%s: %s\n" % ( key, str_val)
Reply all
Reply to author
Forward
0 new messages