Last year I posted about how to configure “locales” in Debian or Ubuntu, using Ansible. Back then I did not know that there is an Ansible
debconf module available, and I have no idea how I could miss it. Anyway, this makes things a bit easier, but not much.
First of all, the module let’s you both set and query values. However because the
locales package does not use
debconf for the list of locales, but stores this list in
/etc/locale.gen, things are still unnecessary complicated. But I managed to get it working without having to use an additional file as flag if this step was completed before.