Coder Social home page Coder Social logo

ansible-locales's Introduction

locales

CI Ansible Galaxy

Set locales on Debian-like systems.

Requirements

None

Variables

  • locales_present [default: ['en_US.UTF-8']]:
  • locales_absent [default: []]:
  • locales_language_packs_present [default: ['language-pack-en', 'language-pack-en-base']]:
  • locales_language_packs_absent [default: []]:
  • locales_default: [default: {}]: Default declarations
  • locales_default.lang: [default: 'en_US.UTF-8']: Provides default value for LC_* variables that have not been explicitly set
  • locales_default.language: [optional]: Same as above? But with higher priority, see
  • locales_default.lc_address: [optional]: How addresses are formatted (country first or last, where zip code goes etc.)
  • locales_default.lc_all: [optional]: Overrides individual LC_* settings: if LC_ALL is set, none of the below have any effect
  • locales_default.lc_collate: [optional]: How strings (file names...) are alphabetically sorted. Using the "C" or "POSIX" locale here results in a strcmp()-like sort order, which may be preferable to language-specific locales
  • locales_default.lc_ctype: [optional]: How characters are classified as letters, numbers etc. This determines things like how characters are converted between upper and lower case
  • locales_default.lc_identification: [optional]: Metadata about the locale information
  • locales_default.lc_measurement: [optional]: What units of measurement are used (feet, meters, pounds, kilos etc.)
  • locales_default.lc_messages: [optional]: What language should be used for system messages
  • locales_default.lc_monetary: [optional]: What currency you use, its name, and its symbol
  • locales_default.lc_name: [optional]: How names are represented (surname first or last, etc.)
  • locales_default.lc_numeric: [optional]: How you format your numbers. For example, in many countries a period (.) is used as a decimal separator, while others use a comma (,)
  • locales_default.lc_paper: [optional]: Paper sizes: 11 x 17 inches, A4, etc
  • locales_default.lc_response: [optional]: Determines how responses (such as Yes and No) appear in the local language
  • locales_default.lc_telephone: [optional]: What your telephone numbers look like
  • locales_default.lc_time: [optional]: How your time and date are formatted. Use for example "en_DK.UTF-8" to get a 24-hour-clock in some programs

Dependencies

None

Example

---
- hosts: all
  roles:
    - oefenweb.locales

License

MIT

Author Information

Mischa ter Smitten (based on work of knopki and nickjj)

Feedback, bug-reports, requests, ...

Are welcome!

ansible-locales's People

Contributors

aheimlich avatar chriswayg avatar popstas avatar tbaecker avatar tersmitten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-locales's Issues

Role not idempotent on Ubuntu 16.04

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?

Linux Mint not supported

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?

`lang` is required property if `locales_default` is specified

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.