yum: AttributeError: 'module' object has no attribute 'i18n'

10 views
Skip to first unread message

Xander Cage

unread,
May 20, 2019, 6:10:31 AM5/20/19
to Ansible Project
hi,

got this error out of nowhere...what's the problem here?

ansible --version
ansible 2.7.10
  config file = /etc/ansible/aix/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Mar 26 2019, 22:07:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]


fatal: [AIXHOST]: FAILED! => {
   
"ansible_facts": {
       
"pkg_mgr": "yum"
   
},
   
"changed": false,
   
"rc": 1
}

MSG
:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDOUT
:

Traceback (most recent call last):
 
File "/root/.ansible/tmp/ansible-tmp-1558346846.77-273271480181096/AnsiballZ_yum.py", line 113, in <module>
    _ansiballz_main
()
 
File "/root/.ansible/tmp/ansible-tmp-1558346846.77-273271480181096/AnsiballZ_yum.py", line 105, in _ansiballz_main
    invoke_module
(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
 
File "/root/.ansible/tmp/ansible-tmp-1558346846.77-273271480181096/AnsiballZ_yum.py", line 48, in invoke_module
    imp
.load_module('__main__', mod, module, MOD_DESC)
 
File "/tmp/ansible_yum_payload_3ucq8o/__main__.py", line 341, in <module>
 
File "/opt/freeware/lib/python2.7/site-packages/yum/__init__.py", line 49, in <module>
    _
= yum.i18n._
AttributeError: 'module' object has no attribute 'i18n'



MODULE_STDERR
:

Shared connection to 10.0.0.2 closed.



Jonathan Lozada De La Matta

unread,
May 20, 2019, 7:36:25 AM5/20/19
to ansible...@googlegroups.com
looks like you typed an option that's not available. can you share the tasks?

Jonathan Lozada De La Matta on mobile

Xander Cage

unread,
May 20, 2019, 7:47:19 AM5/20/19
to Ansible Project
# tasks file for manage_aixtoolbox

- name: gather all aix facts
  aix_facts
:
           options
:
                 
- all

- name: check if perzl
  shell
: /usr/bin/yum -q repolist | /usr/bin/grep -q perzl
 
register: perzl_repo
  failed_when
: false

- name: fail if on perzl repo
  fail
: msg="still on perzl"
 
when: perzl_repo.rc == 0

- name: backup sudoers file
  copy
:
      src
: /etc/sudoers
      dest
: /etc/sudoers.save
      remote_src
: yes
      backup
: yes
  failed_when
: false

- name: make sure packages directory exists
  file
:
      path
: /opt/freeware/lib/rpm/Packages
      state
: directory

- name: generate yum conf from template
 
template:
         src
: yum.conf_71.j2
         dest
: /opt/freeware/etc/yum/yum.conf
 
when: ansible_facts["oslevel"]["OS_Ver"] == "71"

- name: generate yum conf from template
 
template:
         src
: yum.conf_72.j2
         dest
: /opt/freeware/etc/yum/yum.conf
 
when: ansible_facts["oslevel"]["OS_Ver"] == "72"

- name: remove all old repo configs
  file
:
      path
: /opt/freeware/etc/yum/repos.d/
      state
: absent

- name: install common packages
  yum
:
     state
: present
     name
: "{{ package_list }}"
     update_cache
: yes
     skip_broken
: yes
     allow_downgrade
: yes

- name: restore sudoers file
  copy
:
      src
: /etc/sudoers.save
      dest
: /etc/sudoers
      remote_src
: yes
  failed_when
: false

- name: remove sudoers backup
  file
:
      path
: /etc/sudoers.save
      state
: absent
  failed_when
: false

Reply all
Reply to author
Forward
0 new messages