-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Bug] community shell module returns garbage in a call to dls
if pipeling is disabled for ibm pyz3.10+
#775
Comments
dls
if pipeling is disabled for ibm pyz3.10+
The concerning point:
|
It seems like the environment variables With
And with
The full output of the
Overall, the recommendation would be to enable pipelining with Ansible playbooks (mainly for better performance) in which case the The above info was gathered by running a playbook with all the different combinations - Generic playbook task: - name: pipelining(<??>) | autocvt(<??>) | pythonstdinencoding(<??>) |
tags:
vars:
ansible_pipelining: <??>
environment:
_BPXK_AUTOCVT: <??>
PYTHONSTDINENCODING: <??>
block:
- name: "pipelining(<??>) | autocvt(<??>) | pythonstdinencoding(<??>)"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
Full playbook: - name: recreate issue 775
hosts: zvm
collections:
- ibm.ibm_zos_core
gather_facts: no
vars:
PYZ: "<path_to_pyz>"
ZOAU: "<path_to_zoau>"
ansible_host: <url>.ibm.com
ansible_user: KETAN
ansible_python_interpreter: "{{ PYZ }}/bin/python3"
DEFAULT_DATA_SET_NAME: "KETAN.ANSIBLE.TESTDS"
environment:
_CEE_RUNOPTS: "FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
_TAG_REDIR_ERR: "txt"
_TAG_REDIR_IN: "txt"
_TAG_REDIR_OUT: "txt"
LANG: "C"
ZOAU: "{{ ZOAU }}/bin"
LIBPATH: "{{ ZOAU }}/lib/:{{ PYZ }}/lib:/lib:/usr/lib:."
ZOAUTIL_DIR: "{{ ZOAU }}"
PYTHONPATH: "{{ ZOAU }}/lib"
PYTHON: "{{ PYZ }}/bin"
PATH: "{{ ZOAU }}/bin:{{ PYZ }}/bin:/bin:/usr/sbin:/var/bin:."
TMPHLQ: "KETAN"
tasks:
- name: pipelining(NO) | autocvt(ON) | pythonstdinencoding(cp1047) | a
tags: a
vars:
ansible_pipelining: no
environment:
_BPXK_AUTOCVT: "ON"
PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(NO) | autocvt(ON) | pythonstdinencoding(cp1047) | a"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(NO) | autocvt(ON) | pythonstdinencoding('') | b
tags: b
vars:
ansible_pipelining: no
environment:
_BPXK_AUTOCVT: "ON"
# PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(NO) | autocvt(ON) | pythonstdinencoding('') | b"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(NO) | autocvt(ALL) | pythonstdinencoding(cp1047) | c
tags: c
vars:
ansible_pipelining: no
environment:
_BPXK_AUTOCVT: "ALL"
PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(NO) | autocvt(ALL) | pythonstdinencoding(cp1047) | c"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(NO) | autocvt(ALL) | pythonstdinencoding('') | d
tags: d
vars:
ansible_pipelining: no
environment:
_BPXK_AUTOCVT: "ALL"
# PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(NO) | autocvt(ALL) | pythonstdinencoding('') | d"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(YES) | autocvt(ON) | pythonstdinencoding(cp1047) | e
tags: e
vars:
ansible_pipelining: yes
environment:
_BPXK_AUTOCVT: "ON"
PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(YES) | autocvt(ON) | pythonstdinencoding(cp1047) | e"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(YES) | autocvt(ON) | pythonstdinencoding('') | f
tags: f
vars:
ansible_pipelining: yes
environment:
_BPXK_AUTOCVT: "ON"
# PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(YES) | autocvt(ON) | pythonstdinencoding('') | f"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(YES) | autocvt(ALL) | pythonstdinencoding(cp1047) | g
tags: g
vars:
ansible_pipelining: yes
environment:
_BPXK_AUTOCVT: "ALL"
PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(YES) | autocvt(ALL) | pythonstdinencoding(cp1047) | g"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
- name: pipelining(YES) | autocvt(ALL) | pythonstdinencoding('') | h
tags: h
vars:
ansible_pipelining: yes
environment:
_BPXK_AUTOCVT: "ALL"
# PYTHONSTDINENCODING: "cp1047"
block:
- name: "pipelining(YES) | autocvt(ALL) | pythonstdinencoding('') | h"
meta: noop
- name: check if ds exists.
shell: "dls {{ DEFAULT_DATA_SET_NAME }}"
register: output
ignore_errors: yes
- name: print
debug:
msg:
- "{{output.stdout if output is defined and output.stdout is defined else ''}}"
- "{{output.stderr if output is defined and output.stderr is defined else '' }}"
|
This was mainly a research item, the recreate playbook from the above comment plus the insights about the 3 variables mentioned above further clarifies the picture with default encodings on z/OS interface and Ansible community behavior. Closing out this item as there's no more work to be done specifically relating to this item |
Is there an existing issue for this?
Are the dependencies a supported version?
IBM Z Open Automation Utilities
v1.2.2
IBM Enterprise Python
v3.10.x
IBM z/OS Ansible core Version
v1.5.0
ansible-version
v2.11.x
z/OS version
v2.4
Ansible module
No response
Bug description
This is potentially related to an ongoing investigative issue around new python (3.10+) behavior with how binary streams/files are treated. Attached in the zip file is the playbook where the issue was originally found. Seems like it may be a result of the
shell
module having issues with getting the right encoding down (similar to the behavior of the community lineinfile and blockinfile modules in the linked issue). Where the behavior differs is that for this playbook, turning ON pipelining seems to make it work alright whereas turning OFF pipelining is where the command fails.Contents of the playbook, see
verbosity output
section for results:Playbook verbosity output.
note: the vars section of the playbook contains:
Contents of
group_vars
orhost_vars
see inventory section above.
The text was updated successfully, but these errors were encountered: