*I have a task defined as follows:*
- name: add postgres system user
user:
name: "{{ postgres_system_user }}"
comment: Postgres User
update_password: always
expires: -1
password: "{{ postgres_system_user_password | password_hash('sha512')
}}"
group: "{{ postgres_system_group }}"
*The above task is called from playbook:*
- name: postgres_server installation
hosts: "{{ pgsql_server }}"
environment:
PATH: "/opt/rh/rh-python36/root/usr/bin:{{ ansible_env.PATH }}"
tags: postgres
vars_files:
- group_vars/all.yml
- group_vars/vault.yml
become: yes
become_method: sudo
roles:
- postgres_svr_install
*This play worked previously but suddenly started failing. error generated
is :*
The full traceback is:
Traceback (most recent call last):
File
"/tmp/ka141e/ansible/ansible-tmp-1639000602.7519922-98708-187912480777368/AnsiballZ_user.py",
line 102, in <module>
_ansiballz_main()
File
"/tmp/ka141e/ansible/ansible-tmp-1639000602.7519922-98708-187912480777368/AnsiballZ_user.py",
line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File
"/tmp/ka141e/ansible/ansible-tmp-1639000602.7519922-98708-187912480777368/AnsiballZ_user.py",
line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.user', init_globals=None,
run_name='__main__', alter_sys=True)
File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File
"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py",
line 3103, in <module>
File
"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py",
line 3042, in main
File
"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py",
line 1158, in modify_user
File
"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py",
line 823, in modify_user_usermod
ValueError: invalid literal for int() with base 10: ''
fatal: [cs-airflow-poc.com]: FAILED! => {
"changed": false,
"module_stderr": "Shared connection to cs-airflow-poc.com closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File
\"/tmp/ka141e/ansible/ansible-tmp-1639000602.7519922-98708-187912480777368/AnsiballZ_user.py\",
line 102, in <module>\r\n _ansiballz_main()\r\n File
\"/tmp/ka141e/ansible/ansible-tmp-1639000602.7519922-98708-187912480777368/AnsiballZ_user.py\",
line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path,
ANSIBALLZ_PARAMS)\r\n File
\"/tmp/ka141e/ansible/ansible-tmp-1639000602.7519922-98708-187912480777368/AnsiballZ_user.py\",
line 40, in invoke_module\r\n
runpy.run_module(mod_name='ansible.modules.user', init_globals=None,
run_name='__main__', alter_sys=True)\r\n File
\"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\r\n fname,
loader, pkg_name)\r\n File \"/usr/lib64/python2.7/runpy.py\", line 82, in
_run_module_code\r\n mod_name, mod_fname, mod_loader, pkg_name)\r\n
File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\r\n exec
code in run_globals\r\n File
\"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py\",
line 3103, in <module>\r\n \r\n File
\"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py\",
line 3042, in main\r\n \r\n File
\"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py\",
line 1158, in modify_user\r\n \r\n File
\"/tmp/ansible_user_payload_L5H9uE/ansible_user_payload.zip/ansible/modules/user.py\",
line 823, in modify_user_usermod\r\n \r\nValueError: invalid literal for
int() with base 10: ''\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
*I can see it calling python2.7 irrespective of the set environment at the
top play. This play is run from the control server and I've tested this on
2 servers so far, failing at the same task. *
*Please help.*
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d6ffaced-03d9-4dc8-9733-2a7532a894b5n%40googlegroups.com.