oefenweb / ansible-locales Goto Github PK
View Code? Open in Web Editor NEWAnsible role to set up locales in Debian-like systems
License: MIT License
Ansible role to set up locales in Debian-like systems
License: MIT License
Doing this:
- role: tersmitten.locales
vars:
locales_default:
lc_all: C.UTF-8
Fails with:
fatal: [x.y.z.v]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'lang'"}
Passing in also lang
fixes this:
- role: tersmitten.locales
vars:
locales_default:
lang: C.UTF-8
lc_all: C.UTF-8
Also, lang
default is documented as [en_US.UTF-8]
while it should be rather just en_US.UTF-8
because it's a string not a list?
Hi,
At least in Ubuntu 18.04 there is no more /var/lib/locales/supported.d/local directory
Yoann
I tested this and it works well with Debian Jessie. Is there a reason why /etc/default/locale
does not include LANGUAGE=
? I'm used to setting this on my Debian servers.
Hi!
Is oefenweb.locales a finale name? Or will it change again to tersmitten locales?
This ansible galaxy changes are unpredictable -.-
I've tried to use this role with a Linux Mint OS which is a ubuntu derivative: the language packs do not install due to the when
clause in the tasks. Why are these clauses needed here? For debian support?
Handler dpkg-reconfigure --frontend noninteractive locales
update /etc/default/locale to:
# Ansible managed: Do NOT edit this file manually!
#
LANG=en_US.UTF-8
There is no quotes around LANG
value. At next role play don't idempotence:
TASK [: set default locale] ****************************************************
--- before: /etc/default/locale
+++ after: dynamically generated
@@ -1,3 +1,3 @@
# Ansible managed: Do NOT edit this file manually!
-#
-LANG=en_US.UTF-8
+
+LANG="en_US.UTF-8"
After 3-rd play of role's changed=0, but it cause fail ci tests.
I can convert handler to task and place it before template task:
- name: update locales
command: dpkg-reconfigure --frontend noninteractive locales
when: _locales_install_lang_packs|changed or _locales_remove_lang_packs|changed
tags: [configuration, locales, locales-update, skip_ansible_lint]
- name: set default locale
template:
src: etc/default/locale.j2
dest: /etc/default/locale
owner: root
group: root
mode: 0644
tags: [configuration, locales, locales-default]
But it some ugly. Maybe you know better solution?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.