1

I had a problem with locales on vagrant described in other question.

For fixing this problem I need to set environment variable:

export LC_ALL="en_US.UTF-8"

Is there a way to do that globally for playbook?

Community
  • 1
  • 1
kharandziuk
  • 12,020
  • 17
  • 63
  • 121

1 Answers1

5

I ran into this same problem with Postgres and Vagrant and Ansible. Here's how I solved it.

- name: dev locale
  action: command sudo update-locale LC_ALL=en_US.UTF-8
- name: set default locale
  sudo: yes
  lineinfile: dest=/etc/default/locale
    regexp="LC_ALL"
    line="LC_ALL=\"en_US.UTF-8\""

Yes, the command sudo line is weird. But it works.

iamtankist
  • 3,464
  • 1
  • 19
  • 25
tedder42
  • 23,519
  • 13
  • 86
  • 102
  • i need to mention, that the [ansible module locale_gen](http://docs.ansible.com/ansible/locale_gen_module.html) did not work for me (debian 8). – michabbb Dec 29 '15 at 01:48
  • @michabbb make sure it is reported- [is this the problem](https://github.com/ansible/ansible-modules-extras/issues/823)? – tedder42 Dec 29 '15 at 01:52
  • my locales don´t have spaces, so i guess it's another problem. – michabbb Dec 29 '15 at 02:02