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: broken in Ansible 10 #9734

Open
1 task done
k0ste opened this issue Feb 12, 2025 · 2 comments · May be fixed by #9735
Open
1 task done

locale_gen: broken in Ansible 10 #9734

k0ste opened this issue Feb 12, 2025 · 2 comments · May be fixed by #9735
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type) traceback

Comments

@k0ste
Copy link

k0ste commented Feb 12, 2025

Summary

The locale_gen module raises errors on locale_gen tasks when Ansible upgraded from 9 to 11. The task was used for 8 years and works fine, until last module changes

Issue Type

Bug Report

Component Name

locale_gen

Ansible Version

ansible [core 2.18.2]
  config file = /Users/k0ste/Development/ansible/ansible.cfg
  configured module search path = ['/Users/k0ste/Development/ansible/library']
  ansible python module location = /opt/homebrew/Cellar/ansible/11.2.0/libexec/lib/python3.13/site-packages/ansible
  ansible collection location = /Users/k0ste/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.13.2 (main, Feb  4 2025, 14:51:09) [Clang 16.0.0 (clang-1600.0.26.6)] (/opt/homebrew/Cellar/ansible/11.2.0/libexec/bin/python)
  jinja version = 3.1.5
  libyaml = True

Community.general Version

# /opt/homebrew/Cellar/ansible/11.2.0/libexec/lib/python3.13/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 10.3.0

Configuration

ANSIBLE_NOCOLOR(/Users/k0ste/Development/ansible/ansible.cfg) = False
ANSIBLE_NOCOWS(/Users/k0ste/Development/ansible/ansible.cfg) = True
CACHE_PLUGIN(/Users/k0ste/Development/ansible/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/Users/k0ste/Development/ansible/ansible.cfg) = cache/facts
CACHE_PLUGIN_TIMEOUT(/Users/k0ste/Development/ansible/ansible.cfg) = 3600
CONFIG_FILE() = /Users/k0ste/Development/ansible/ansible.cfg
DEFAULT_FILTER_PLUGIN_PATH(/Users/k0ste/Development/ansible/ansible.cfg) = ['/Users/k0ste/Development/ansible/my_filters']
DEFAULT_FORKS(/Users/k0ste/Development/ansible/ansible.cfg) = 10
DEFAULT_GATHERING(/Users/k0ste/Development/ansible/ansible.cfg) = smart
DEFAULT_HOST_LIST(/Users/k0ste/Development/ansible/ansible.cfg) = ['/Users/k0ste/Development/ansible/inventory/static_inventory.ini']
DEFAULT_LOAD_CALLBACK_PLUGINS(/Users/k0ste/Development/ansible/ansible.cfg) = True
DEFAULT_MANAGED_STR(/Users/k0ste/Development/ansible/ansible.cfg) = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
DEFAULT_MODULE_PATH(/Users/k0ste/Development/ansible/ansible.cfg) = ['/Users/k0ste/Development/ansible/library']
DEFAULT_MODULE_UTILS_PATH(/Users/k0ste/Development/ansible/ansible.cfg) = ['/Users/k0ste/Development/ansible/module_utils']
DEFAULT_NO_LOG(/Users/k0ste/Development/ansible/ansible.cfg) = False
DEFAULT_NO_TARGET_SYSLOG(/Users/k0ste/Development/ansible/ansible.cfg) = True
DEFAULT_POLL_INTERVAL(/Users/k0ste/Development/ansible/ansible.cfg) = 15
DEFAULT_PRIVATE_ROLE_VARS(/Users/k0ste/Development/ansible/ansible.cfg) = False
DEFAULT_REMOTE_USER(/Users/k0ste/Development/ansible/ansible.cfg) = bender
DEFAULT_ROLES_PATH(/Users/k0ste/Development/ansible/ansible.cfg) = ['/Users/k0ste/Development/ansible/roles']
DEFAULT_TIMEOUT(/Users/k0ste/Development/ansible/ansible.cfg) = 10
DEFAULT_UNDEFINED_VAR_BEHAVIOR(/Users/k0ste/Development/ansible/ansible.cfg) = True
DEFAULT_VAULT_PASSWORD_FILE(/Users/k0ste/Development/ansible/ansible.cfg) = /Users/k0ste/Development/ansible/vault.txt
DEPRECATION_WARNINGS(/Users/k0ste/Development/ansible/ansible.cfg) = True
DIFF_ALWAYS(/Users/k0ste/Development/ansible/ansible.cfg) = True
DIFF_CONTEXT(/Users/k0ste/Development/ansible/ansible.cfg) = 3
DISPLAY_ARGS_TO_STDOUT(/Users/k0ste/Development/ansible/ansible.cfg) = False
DISPLAY_SKIPPED_HOSTS(/Users/k0ste/Development/ansible/ansible.cfg) = True
HOST_KEY_CHECKING(/Users/k0ste/Development/ansible/ansible.cfg) = False
INVENTORY_CACHE_ENABLED(/Users/k0ste/Development/ansible/ansible.cfg) = True
INVENTORY_CACHE_PLUGIN(/Users/k0ste/Development/ansible/ansible.cfg) = jsonfile
INVENTORY_CACHE_PLUGIN_CONNECTION(/Users/k0ste/Development/ansible/ansible.cfg) = cache/inventory
INVENTORY_CACHE_TIMEOUT(/Users/k0ste/Development/ansible/ansible.cfg) = 43200
MAX_FILE_SIZE_FOR_DIFF(/Users/k0ste/Development/ansible/ansible.cfg) = 1044480
PERSISTENT_CONTROL_PATH_DIR(/Users/k0ste/Development/ansible/ansible.cfg) = /tmp/ansible-pc
RETRY_FILES_ENABLED(/Users/k0ste/Development/ansible/ansible.cfg) = True
RETRY_FILES_SAVE_PATH(/Users/k0ste/Development/ansible/ansible.cfg) = /tmp/ansible-retry
SHOW_CUSTOM_STATS(/Users/k0ste/Development/ansible/ansible.cfg) = True
SYSTEM_WARNINGS(/Users/k0ste/Development/ansible/ansible.cfg) = True
USE_PERSISTENT_CONNECTIONS(/Users/k0ste/Development/ansible/ansible.cfg) = True

OS / Environment

Welcome to CentOS Stream 9 5.14.0-559.el9.x86_64
Platform:	Supermicro X11DPi-N(T)
BIOS:		4.4 (American Megatrends Inc. 08/16/2024)
CPU:		Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz [2P/24C]
RAM:		58Gi free / 62Gi total
LoadAvg:	0.00 0.00 0.00

Steps to Reproduce

---
- name: "locale_gen | test"
  become: true
  gather_facts: true
  remote_user: user
  no_log: false
  strategy: linear
  hosts:
    - example.com
  tasks:
    - name: "locale_gen | Deploy locales"
      community.general.locale_gen:
        name: "{{ locale['locale'] + '.' + locale['charset'] }}"
        state: "present"
      loop: "{{ vars['locales_gen'] | flatten(levels=1) }}"
      loop_control:
        loop_var: "locale"
        label: "{{ 'Deploy locale: ' + locale['locale'] }}"
      vars:
        locales_gen:
          - locale: 'ru_RU'
            charset: 'UTF-8'
          - locale: 'en_US'
            charset: 'UTF-8'

Expected Results

PLAY [locale_gen | test] ****************************************************************************************************************************************************************************************************************************************************************
[WARNING]: Found variable using reserved name: tags
[WARNING]: Found variable using reserved name: serial

TASK [locale_gen | Deploy locales] ******************************************************************************************************************************************************************************************************************************************************
ok: [example.com] => (item=Deploy locale: ru_RU)
ok: [example.com] => (item=Deploy locale: en_US)

PLAY RECAP ******************************************************************************************************************************************************************************************************************************************************************************
example.com : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Actual Results

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_community.general.locale_gen_payload_q1ikezst/ansible_community.general.locale_gen_payload.zip/ansible_collections/community/general/plugins/module_utils/mh/deco.py", line 56, in wrapper
    func(self, *args, **kwargs)
  File "/tmp/ansible_community.general.locale_gen_payload_q1ikezst/ansible_community.general.locale_gen_payload.zip/ansible_collections/community/general/plugins/module_utils/mh/base.py", line 92, in run
    self.__init_module__()
  File "/tmp/ansible_community.general.locale_gen_payload_q1ikezst/ansible_community.general.locale_gen_payload.zip/ansible_collections/community/general/plugins/modules/locale_gen.py", line 147, in __init_module__
  File "/tmp/ansible_community.general.locale_gen_payload_q1ikezst/ansible_community.general.locale_gen_payload.zip/ansible_collections/community/general/plugins/modules/locale_gen.py", line 167, in assert_available
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/i18n/SUPPORTED'
failed: [example.com] (item=Deploy locale: en_US) => {
    "ansible_loop_var": "locale",
    "changed": false,
    "diff": {},
    "invocation": {
        "module_args": {
            "name": [
                "en_US.UTF-8"
            ],
            "state": "present"
        }
    },
    "locale": {
        "charset": "UTF-8",
        "locale": "en_US"
    },
    "mechanism": "glibc",
    "msg": "Module failed with exception: [Errno 2] No such file or directory: '/usr/share/i18n/SUPPORTED'",
    "name": [
        "en_US.UTF-8"
    ],
    "output": {
        "diff": {},
        "mechanism": "glibc",
        "name": [
            "en_US.UTF-8"
        ],
        "ubuntu_mode": false
    },
    "ubuntu_mode": false,
    "vars": {
        "mechanism": "glibc",
        "name": [
            "en_US.UTF-8"
        ],
        "ubuntu_mode": false
    }
}

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 has_pr module module plugins plugin (any type) traceback labels Feb 12, 2025
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 has_pr module module plugins plugin (any type) traceback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants