new module locale_gen fails with "Is the package “locales” installed?"

583 views
Skip to first unread message

ayounggun

unread,
Apr 24, 2014, 5:16:28 PM4/24/14
to ansible...@googlegroups.com
Hi all

Can anyone see what I'm doing wrong? I'm trying to generate and set the system's locale with the following tasks against ubuntu server 14.04.

tasks
- name: install the locales package
  apt: pkg=locales state=present

- name: ensure the locale exists
  locale_gen: name={{ locale }} state=present

- name: set the locale
  command: /usr/sbin/update-locale LANG={{ locale }} --reset

output
msg: /etc/locale.gen and /var/lib/locales/supported.d/local are missing. Is the package “locales” installed?

However I have confirmed that the locales package is indeed installed.

Also if I don't use the locale_gen: module everything works fine.

tasks
- name: install the locales package
  apt: pkg=locales state=present

- name: ensure the locale exists
  command: /usr/sbin/locale-gen {{ locale }}

- name: set the locale
  command: /usr/sbin/update-locale LANG={{ locale }} --reset

output
changed: [vps03.fqdn.com] => {"changed": true, "cmd": ["/usr/sbin/locale-gen", "en_GB.UTF-8"], "delta": "0:00:02.105356", "end": "2014-04-25 01:03:10.600058", "item": "", "rc": 0, "start": "2014-04-25 01:03:08.494702", "stderr": "", "stdout": "Generating locales...\n  en_GB.UTF-8... done\nGeneration complete."}

Thanks for the help

Michael DeHaan

unread,
Apr 25, 2014, 4:36:58 PM4/25/14
to ansible...@googlegroups.com
"However I have confirmed that the locales package is indeed installed."

Is it installed on the remote node?  That's where it's needed.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/644eaf13-e972-4ee7-9998-d154f9ad4898%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ayounggun

unread,
May 5, 2014, 3:01:42 PM5/5/14
to ansible...@googlegroups.com
Hi Michael

Thanks - sorry for not replying. I forgot to set up notifications correctly.

the locales package is installed on the remote node via the task

- name: install the locales package
  apt: pkg=locales state=present

and I confirmed that it was present

root@vps01:~# apt-get install locales
Reading package lists... Done
Building dependency tree       
Reading state information... Done
locales is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

using /usr/sbin/locale-gen directly works fine so I guess I'll stick with that for now

I get the error message on ubuntu server 12.04 and 14.04

if I haven't made any obvious mistakes perhaps I should mention this on github

Thanks

Michael DeHaan

unread,
May 5, 2014, 11:53:00 PM5/5/14
to ansible...@googlegroups.com
The error message may have made some assumptions about the name of the package in a particular distro.

If you'd like to file a ticket in github we can take a look.



Reply all
Reply to author
Forward
0 new messages