Hi,
Debconf and its pair tools can be used to reconfigure a Debian package, or to
preconfigure packages before they get installed.
matlab-support matlab-support/default-version select Matlab {{ matlab_version }} @ {{ matlab_instdir }}/{{ matlab_version }}
matlab-support matlab-support/rename-libs boolean false
matlab-support matlab-support/matlab-install-glob string {{ matlab_instdir }}/{{ matlab_version }}
matlab-support matlab-support/mexbuild-user string
- name: Preseed matlab-supportThis _won't_ change the setting I'm interested in because it is also set in /etc/matlab/debconf:
action: shell debconf-set-selections </var/local/preseed/matlab-support
register: matlab_selections
when_boolean: ${matlab_seed.changed}
tags:
- matlab
- name: Dpkg-reconfigure matlab-support
action: command dpkg-reconfigure -fnoninteractive matlab-support
when_boolean: ${matlab_selections.changed}
tags:
- matlab
- name: Configure matlab-support
action: lineinfile dest=/etc/matlab/debconf regexp="^MATLAB_INSTALL_GLOB=" line="MATLAB_INSTALL_GLOB=${matlab_instdir}/${matlab_version}"
when_boolean: ${matlab_selections.changed}
tags:
- matlab
https://bugs.launchpad.net/ubuntu/+source/pam/+bug/682662
Here it's clearly stated that
"by design of debconf that settings on the system take precedence over any values set in the debconf database"
This won't-fix-bug-report also contains a proposal how to deal with this and answering debconf question via an EDITOR script, which seems like a workable approach for an ansible module to me.
Sebastian
Hi,
I tested your module and it seems to work, although it is sad that there isn't a better way to implement this.
Some suggested improvements:
- rename it to `dpkg_reconfigure`, because other modules also use underscores in their names
- parameter `keys` could also accept a list (eg. keys={{ var_with_list }} or keys=["locales/default_environment_locale fr_FR.UTF-8", "locales/locales_to_be_generated en_US.UTF-8 UTF-8, fr_FR.UTF-8 UTF"], if it works?)
- parameter `keys` could also accept a dict (eg. keys={"locales/default_environment_locale": "fr_FR.UTF-8", "locales/locales_to_be_generated": "en_US.UTF-8 UTF-8, fr_FR.UTF-8 UTF"], if it works?)
- parameter `keys` could be renamed to `values` or `answers`, because debconf man pages refer to this as being values (not keys)
- maybe `debconf-shows` could be used instead of `debconf-get-selections`, because it is part of the standard `debconf` package and there is no need to install additional packages for `debconf-utils`
Greetings,
gw
Sebastien
--
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 ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.