Code Monkey home page Code Monkey logo

ansible-locales's Issues

`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?

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?

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?

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.