debconf multiselect is converted to string

19 views
Skip to first unread message

Ann Elliott

unread,
Jul 25, 2023, 11:33:44 AM7/25/23
to Ansible Project
While debconf is working for me just fine when setting string values, when I try to use vtype: multiselect, my list is converted into a string and only the last item gets selected. The relevant section of the yaml file:

  - name: ldap nsswitch
    debconf:
      name: libnss-ldapd
      question: libnss-ldapd/nsswitch
      value: passwd, group, shadow
      vtype: multiselect

but these settings were not applied.

I then changed the value to

      value:
        - passwd
        - group
        - shadow

and get the warning

[WARNING]: The value "['passwd', 'group', 'shadow']" (type list) was converted to ""['passwd', 'group', 'shadow']"" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.

I then tried "value: "passwd, group, shadow" (and maybe "[passwd, group, shadow]" but I don't remember for sure). No change in behavior.

When I log into the machine I ran the ansible script on, with any of those versions on the ansible file, I see

$ debconf-show libnss-ldapd
  libnss-ldapd/clean_nsswitch: false
* libnss-ldapd/nsswitch: sudoers

What I expect to see:

$ debconf-show libnss-ldapd
* libnss-ldapd/nsswitch: passwd, group, shadow
  libnss-ldapd/clean_nsswitch: false

ansible version is 2.10.8

Is this user error or a bug in debconf?

Brian Coca

unread,
Jul 25, 2023, 12:05:30 PM7/25/23
to ansible...@googlegroups.com
open a bug, value should be 'raw' and we should convert depending on type:

--
----------
Brian Coca

Reply all
Reply to author
Forward
0 new messages