diff --git a/defaults/main.yml b/defaults/main.yml index 2cf8a896..47815f80 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -218,6 +218,10 @@ lxc_cache_download_template_options: >- --variant {{ lxc_cache_default_variant }} {{ lxc_cache_download_template_extra_options }} +# Locales to populate in the LXC base cache +lxc_cache_locales: + - en_US.UTF-8 + # LXC must be installed from a COPR repository on CentOS 7 since the version # provided in EPEL is much too old (1.x). lxc_centos_package_baseurl: https://copr-be.cloud.fedoraproject.org/results/thm/lxc2.0/epel-7-x86_64/ diff --git a/templates/prep-scripts/ubuntu_16_prep.sh.j2 b/templates/prep-scripts/ubuntu_16_prep.sh.j2 index 3d47e866..a84274f7 100644 --- a/templates/prep-scripts/ubuntu_16_prep.sh.j2 +++ b/templates/prep-scripts/ubuntu_16_prep.sh.j2 @@ -35,6 +35,13 @@ for action in disable mask; do systemctl ${action} systemd-networkd-resolvconf-update.service || true done +{% for locale in lxc_cache_locales %} +locale-gen {{ locale }} +{% if loop.first | bool %} +update-locale LANG={{ locale }} +{% endif %} +{% endfor %} + # Set the IP of the lxcbr0 interface as the DNS server echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf systemctl enable systemd-networkd diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 5aa22fa9..18581397 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -23,10 +23,8 @@ _lxc_cache_map: - /etc/apt/sources.list - /etc/apt/apt.conf.d/ - /etc/apt/preferences.d/ - - /etc/default/locale - /etc/environment - /etc/localtime - - /etc/locale.conf - /root/repo.keys - /etc/protocols @@ -37,11 +35,13 @@ _lxc_cache_distro_packages: - ca-certificates - cron # xenial doesn't have cronie - dbus + - debianutils # for 'which' executable - gcc - iproute2 - iputils-ping - libffi-dev - libssl-dev + - locales - netbase - openssh-server - openssl @@ -54,4 +54,3 @@ _lxc_cache_distro_packages: - systemd-sysv - tar - wget - - debianutils # for 'which' executable