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

**URL:** <https://forum.ansible.com/t/how-to-fix-this-nmcli-error-error-invalid-setting-property-autoconnect-n/19834>\
**Category:** Ansible Project\
**Created:** [November 23, 2015, 7:10pm UTC](https://forum.ansible.com/t/how-to-fix-this-nmcli-error-error-invalid-setting-property-autoconnect-n/19834 "2015-11-23T19:10:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [November 23, 2015, 7:10pm UTC](https://forum.ansible.com/t/how-to-fix-this-nmcli-error-error-invalid-setting-property-autoconnect-n/19834/1 "2015-11-23T19:10:40Z")

</div>

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 . ‘autoconnect’.\n”, “name”: “enp5s0”, “rc”: 2}

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [November 24, 2015, 2:40am UTC](https://forum.ansible.com/t/how-to-fix-this-nmcli-error-error-invalid-setting-property-autoconnect-n/19834/2 "2015-11-24T02:40:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [November 24, 2015, 3:58am UTC](https://forum.ansible.com/t/how-to-fix-this-nmcli-error-error-invalid-setting-property-autoconnect-n/19834/3 "2015-11-24T03:58:28Z")

</div>

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)

 |
| |
