Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale_gen Don't do anything #8487

Open
1 task done
samikhelil83 opened this issue Jun 11, 2024 · 9 comments · May be fixed by #9238
Open
1 task done

locale_gen Don't do anything #8487

samikhelil83 opened this issue Jun 11, 2024 · 9 comments · May be fixed by #9238
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@samikhelil83
Copy link

samikhelil83 commented Jun 11, 2024

Summary

I'm trying to add this locale on Ubuntu 22.04 or Ubuntu 24.04 but nothing happens, the output of the command is always Changed:false.
ansible -m locale_gen -a "name=es_AR.UTF-8 state=present" localhost

Issue Type

Bug Report

Component Name

locale_gen

Ansible Version

$ ansible --version
ansible [core 2.17.0]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 1.3.6  

# /usr/local/lib/python3.10/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 9.0.1

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

ubuntu 22.02

Steps to Reproduce

# ansible -m locale_gen -a "name=es_AR.UTF-8 state=present" localhost
localhost | SUCCESS => {
    "changed": false,
    "name": "es_AR.UTF-8",
    "ubuntu_mode": true
}



Expected Results

# locale -a | grep es_AR 
# es_AR.utf8

Actual Results

# locale -a |grep es_AR 
#

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Jun 11, 2024
@lukasz-zaroda
Copy link

I confirm, have the same issue here with Ubuntu 24.04.

@russoz
Copy link
Collaborator

russoz commented Nov 24, 2024

Hi @samikhelil83 @lukasz-zaroda ,

I cannot reproduce the error. Running in Ubuntu 24.04, with community.general 10.0.1 (latest at the time of writing):

(venv) root@ubuntu-noble:~# locale -a
C
C.utf8
en_US.utf8
POSIX
(venv) root@ubuntu-noble:~# ansible -m locale_gen -a "name=es_AR.UTF-8 state=present" localhost -v
Using /etc/ansible/ansible.cfg as config file
localhost | CHANGED => {
    "changed": true,
    "name": [
        "es_AR.UTF-8"
    ],
    "ubuntu_mode": false
}
(venv) root@ubuntu-noble:~# locale -a
C
C.utf8
en_US.utf8
es_AR.utf8
POSIX

I see you have c.g. 1.3.6 installed as well, it might be using the old one.

I will try running on 9.0.1 as well.

@russoz
Copy link
Collaborator

russoz commented Nov 24, 2024

Same thing with 9.0.1:

(venv) root@ubuntu-noble:~# ansible-galaxy collection list

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 9.0.1  
(venv) root@ubuntu-noble:~# locale -a
C
C.utf8
en_US.utf8
POSIX
(venv) root@ubuntu-noble:~# ansible -m locale_gen -a "name=es_AR.UTF-8 state=present" localhost -v
Using /etc/ansible/ansible.cfg as config file
localhost | CHANGED => {
    "changed": true,
    "name": "es_AR.UTF-8",
    "ubuntu_mode": false
}
(venv) root@ubuntu-noble:~# locale -a
C
C.utf8
en_US.utf8
es_AR.utf8
POSIX

@russoz
Copy link
Collaborator

russoz commented Nov 24, 2024

Oddly enough, I tried with 1.3.6 and got the same successful results:

(venv) root@ubuntu-noble:~# locale -a
C
C.utf8
en_US.utf8
POSIX
(venv) root@ubuntu-noble:~# ansible-galaxy collection install 'community.general==1.3.6'
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-1.3.6.tar.gz to /root/.ansible/tmp/ansible-local-3890spont0ec/tmpkwh03wah/community-general-1.3.6-6et3vv9t
Installing 'community.general:1.3.6' to '/root/.ansible/collections/ansible_collections/community/general'
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-kubernetes-2.0.1.tar.gz to /root/.ansible/tmp/ansible-local-3890spont0ec/tmpkwh03wah/community-kubernetes-2.0.1-1xoniae9
community.general:1.3.6 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/google-cloud-1.4.1.tar.gz to /root/.ansible/tmp/ansible-local-3890spont0ec/tmpkwh03wah/google-cloud-1.4.1-kdf_eozs
Installing 'community.kubernetes:2.0.1' to '/root/.ansible/collections/ansible_collections/community/kubernetes'
community.kubernetes:2.0.1 was installed successfully
Installing 'google.cloud:1.4.1' to '/root/.ansible/collections/ansible_collections/google/cloud'
google.cloud:1.4.1 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/kubernetes-core-5.0.0.tar.gz to /root/.ansible/tmp/ansible-local-3890spont0ec/tmpkwh03wah/kubernetes-core-5.0.0-ulj83f8_
Installing 'kubernetes.core:5.0.0' to '/root/.ansible/collections/ansible_collections/kubernetes/core'
kubernetes.core:5.0.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-netcommon-7.1.0.tar.gz to /root/.ansible/tmp/ansible-local-3890spont0ec/tmpkwh03wah/ansible-netcommon-7.1.0-ucobh5by
Installing 'ansible.netcommon:7.1.0' to '/root/.ansible/collections/ansible_collections/ansible/netcommon'
ansible.netcommon:7.1.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-5.1.2.tar.gz to /root/.ansible/tmp/ansible-local-3890spont0ec/tmpkwh03wah/ansible-utils-5.1.2-0h3c60is
Installing 'ansible.utils:5.1.2' to '/root/.ansible/collections/ansible_collections/ansible/utils'
ansible.utils:5.1.2 was installed successfully
(venv) root@ubuntu-noble:~# ansible -m locale_gen -a "name=es_AR.UTF-8 state=present" localhost -v
Using /etc/ansible/ansible.cfg as config file
localhost | CHANGED => {
    "changed": true,
    "msg": "OK",
    "name": "es_AR.UTF-8"
}
(venv) root@ubuntu-noble:~# locale -a
C
C.utf8
en_US.utf8
es_AR.utf8
POSIX

Not sure anymore of what is going on.

@russoz
Copy link
Collaborator

russoz commented Nov 24, 2024

Could you please run with -vvvv and paste the results in pastebin or gist.github.com? As in

ansible -m locale_gen -a "name=es_AR.UTF-8 state=present" localhost -vvvv

@lukasz-zaroda
Copy link

lukasz-zaroda commented Nov 28, 2024

https://gist.github.com/lukasz-zaroda/8ca7101b65c43f2b7a5f4555b47ceced This is the output of an example command. The given locale has been not generated on the target.

Also: Locale's line in /etc/locale.gen is still commented after running the module, so maybe is it something with line detection?

@russoz
Copy link
Collaborator

russoz commented Dec 1, 2024

Hi, #9131 was actually used to investigate more and it does seem that the module has an issue when running in ubuntu_mode=true. I should be working on it by the next weekend or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants