Giter Site home page Giter Site logo

Comments (9)

tersmitten avatar tersmitten commented on June 15, 2024

Are you sure this is only an issue on Ubuntu 16.04?

from ansible-locales.

tersmitten avatar tersmitten commented on June 15, 2024

Wouldn't it be better the remove the quotes from the template (etc/default/locale.j2)? I don't think they're needed anyway. Can you verify that for me?

from ansible-locales.

popstas avatar popstas commented on June 15, 2024

Just tested on containers:

  • debian:jessie
  • debian:wheezy
  • ubuntu:12.04
  • ubuntu:14.04
  • ubuntu:16.04

All idempotent except ubuntu:16.04

Tried to remove locale.j2 template, then checked all provisioned containers, all files was empty, on ubuntu 12.04 and 14.04 files absent:

$ docker exec -it ansible-role-locales-jessie cat /etc/default/locale
#  File generated by update-locale

$ docker exec -it ansible-role-locales-wheezy cat /etc/default/locale

#  File generated by update-locale

$ docker exec -it ansible-role-locales-1204 cat /etc/default/locale

cat: /etc/default/locale: No such file or directory

$ docker exec -it ansible-role-locales-1404 cat /etc/default/locale

cat: /etc/default/locale: No such file or directory

$ docker exec -it ansible-role-locales-1604 cat /etc/default/locale

#  File generated by update-locale

Then I provisioned role without changes and check /etc/defaults/locales again:

$ docker exec -it ansible-role-locales-jessie cat /etc/default/locale

# Ansible managed: Do NOT edit this file manually!

LANG="en_US.UTF-8"
$ docker exec -it ansible-role-locales-wheezy cat /etc/default/locale

# Ansible managed: Do NOT edit this file manually!

LANG="en_US.UTF-8"
$ docker exec -it ansible-role-locales-1204 cat /etc/default/locale

# Ansible managed: Do NOT edit this file manually!

LANG="en_US.UTF-8"
$ docker exec -it ansible-role-locales-1404 cat /etc/default/locale

# Ansible managed: Do NOT edit this file manually!

LANG="en_US.UTF-8"
$ docker exec -it ansible-role-locales-1604 cat /etc/default/locale

# Ansible managed: Do NOT edit this file manually!
#
LANG=en_US.UTF-8

Then I disabled handler and tried again:

$ docker exec -it ansible-role-locales-1604 cat /etc/default/locale

# Ansible managed: Do NOT edit this file manually!

LANG="en_US.UTF-8"

So, but appears only on Ubuntu 16.04 and only when /etc/default/locale was templated.
My variants:

  1. exclude quotes from template for ubuntu 16.04 or for all distribs (I checked, it resolves issue too)
  2. convert handler to task (checked)
  3. add changed_when: false to set default locale task

Also, I tried to add all possible variables to language_default:

locales_default:
  lang: en_US.UTF-8
  language: en_US.UTF-8
  lc_address: en_US.UTF-8
  lc_all: en_US.UTF-8
  lc_collate: en_US.UTF-8
  lc_ctype: en_US.UTF-8
  lc_identification: en_US.UTF-8
  lc_measurement: en_US.UTF-8
  lc_messages: en_US.UTF-8
  lc_monetary: en_US.UTF-8
  lc_name: en_US.UTF-8
  lc_numeric: en_US.UTF-8
  lc_paper: en_US.UTF-8
  lc_response: en_US.UTF-8
  lc_telephone: en_US.UTF-8
  lc_time: en_US.UTF-8

It also fails only on Ubuntu 16.04. All other variables idempotent with quotes. So, quotes needs for remove only for LANG:

$ docker exec -it ansible-role-locales-1604 cat /etc/default/locale
# Ansible managed: Do NOT edit this file manually!

LANG=en_US.UTF-8
LANGUAGE="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_RESPONSE="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"

What you think about quotes?

from ansible-locales.

tersmitten avatar tersmitten commented on June 15, 2024

Can you also reproduce this using:

vagrant up --provision ubuntu-1604;
vagrant@ansible-locales-ubuntu-1604:~$ cat /etc/default/locale 
# Ansible managed

LANG="en_US.UTF-8"
vagrant@ansible-locales-ubuntu-1604:~$ 

from ansible-locales.

tersmitten avatar tersmitten commented on June 15, 2024

Nevermind

vagrant@ansible-locales-ubuntu-1604:~$ sudo dpkg-reconfigure --frontend noninteractive locales
Generating locales (this might take a while)...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... done
  en_ZA.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... done
Generation complete.
vagrant@ansible-locales-ubuntu-1604:~$ cat /etc/default/locale 
# Ansible managed
#
LANG=en_US.UTF-8

from ansible-locales.

tersmitten avatar tersmitten commented on June 15, 2024

locales.tar.gz

It looks like there were quite a lot of changes in the locales package (from 14.04 -> 16.04)

from ansible-locales.

ferrarimarco avatar ferrarimarco commented on June 15, 2024

This also applies to Ubuntu 17.10 as well: https://travis-ci.org/ferrarimarco/open-development-environment-devbox/jobs/352838520

from ansible-locales.

tersmitten avatar tersmitten commented on June 15, 2024

I cannot reproduce the issue (with the included Vagrantfile)

from ansible-locales.

tersmitten avatar tersmitten commented on June 15, 2024

Fixed in #19

from ansible-locales.

Related Issues (7)

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.