ansible-collections / ibm_zos_core

Red Hat Ansible Certified Content for IBM Z
77 stars 44 forks source link

[Bug] zos_fetch cannot handle relative path correctly #1747

Open juergen-holtz opened 5 days ago

juergen-holtz commented 5 days ago

Is there an existing issue for this?

Bug description

The module zos_fetch in collection ibm.ibm_zos_core allows to fetch a data set from z/OS and store it locally on the host executing the playbook.

The destination parameter dest: expects the local path where the file or data set will be stored.

Common convention is that path names can be either absolute, i.e., starting from the root (e.g., /tmp/) or relative, starting from the current directory (e.g. tmp/).

I made the following observations when trying to store the data set in a file that ends up in /Users/juergen/Dev/MyAnsible/playbooks/tmp/, where the current working directory from where ansible-playbook is executed is playbooks:

When a "simple" relative path such as tmp/abc1 is used, the parameter validation fails. This error message is reported by Ansible:

fatal: [zos_system]: FAILED! => {"changed": false, "msg": "Parameter verification failed", "rc": null, "stderr": "Invalid argument \"tmp/abc1\" for type \"path\".", "stderr_lines": ["Invalid argument \"tmp/abc1\" for type \"path\"."], "stdout": null, "stdout_lines": null}

However, with a more "verbose" relative path such as ../playbooks/tmp/abc2, the data set can be fetched successfully. It seems a bit odd to first go up one level in the filesystem tree just to re-enter the directory where I've been before.

I can reproduce and illustrate the error using following playbook:

- name: Replay zos_fetch issue 
  hosts: zos_system
  gather_facts: false 
  collections:
    - ibm.ibm_zos_core

  vars_files:
    - env.yml

  environment: "{{ environment_vars }}"

  tasks:
    - name: "Get current directory on localhost"
      ansible.builtin.shell: pwd
      delegate_to: localhost
      register: result 
    - name: "Show current directory on localhost"
      ansible.builtin.debug: 
        var: result.stdout_lines

    - name: "Fetch failure with invalid argument error"
      ibm.ibm_zos_core.zos_fetch:
        src: IBMUSER.TVT5002.CERTGEN
        dest: "tmp/abc1" 
        flat: true 
        encoding:
          from: IBM-1047 
          to: ISO8859-1 
      ignore_errors: true

    - name: "Fetch workaround"
      ibm.ibm_zos_core.zos_fetch:
        src: IBMUSER.TVT5002.CERTGEN
        dest: "../playbooks/tmp/abc2"
        flat: true
        encoding:
          from: IBM-1047
          to: ISO8859-1

IBM z/OS Ansible core Version

v1.11.0

IBM Z Open Automation Utilities

v1.3.1

IBM Enterprise Python

v3.11.x (default)

ansible-version

v2.17.x

z/OS version

v3.1 (unsupported)

Ansible module

zos_fetch

Playbook verbosity output.

78975 1728722686.25384: starting run ansible-playbook [core 2.17.4] config file = /Users/juergen/Dev/MyAnsible/playbooks/ansible.cfg configured module search path = ['/Users/juergen/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible ansible collection location = /Users/juergen/.ansible/collections:/usr/share/ansible/collections executable location = /opt/homebrew/bin/ansible-playbook python version = 3.12.6 (main, Sep 6 2024, 19:03:47) [Clang 15.0.0 (clang-1500.3.9.4)] (/opt/homebrew/Cellar/ansible/10.4.0/libexec/bin/python) jinja version = 3.1.4 libyaml = True Using /Users/juergen/Dev/MyAnsible/playbooks/ansible.cfg as config file 78975 1728722686.25521: Added group all to inventory 78975 1728722686.25521: Added group ungrouped to inventory 78975 1728722686.25523: Group all now contains ungrouped 78975 1728722686.25525: Examining possible inventory source: /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml setting up inventory plugins Loading collection ansible.builtin from 78975 1728722686.30190: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/cache 78975 1728722686.30225: Loading CacheModule 'memory' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/cache/memory.py 78975 1728722686.30257: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory 78975 1728722686.30291: Loading InventoryModule 'host_list' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/host_list.py 78975 1728722686.30326: Loaded config def from plugin (inventory/script) 78975 1728722686.30326: Loading InventoryModule 'script' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/script.py 78975 1728722686.30350: Loading InventoryModule 'auto' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/auto.py 78975 1728722686.30390: Loaded config def from plugin (inventory/yaml) 78975 1728722686.30390: Loading InventoryModule 'yaml' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/yaml.py 78975 1728722686.30444: Loading InventoryModule 'ini' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/ini.py 78975 1728722686.30805: Loading InventoryModule 'toml' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/toml.py 78975 1728722686.30806: Attempting to use plugin host_list (/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/host_list.py) host_list declined parsing /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml as it did not pass its verify_file() method 78975 1728722686.30807: Attempting to use plugin script (/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/script.py) script declined parsing /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml as it did not pass its verify_file() method 78975 1728722686.30822: Attempting to use plugin auto (/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/auto.py) 78975 1728722686.30826: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml 78975 1728722686.30852: /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml was not parsable by auto 78975 1728722686.30900: Attempting to use plugin yaml (/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/inventory/yaml.py) 78975 1728722686.30916: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml 78975 1728722686.30948: Added group mac to inventory 78975 1728722686.30950: set inventory_file for localhost 78975 1728722686.30951: set inventory_dir for localhost 78975 1728722686.30951: Added host localhost to inventory Set default localhost to localhost 78975 1728722686.30952: Added host localhost to group mac 78975 1728722686.30952: set ansible_connection for localhost 78975 1728722686.30953: set ansible_python_interpreter for localhost 78975 1728722686.30953: set my_host_var for localhost 78975 1728722686.30954: set inventory_file for zos_system 78975 1728722686.30955: set inventory_dir for zos_system 78975 1728722686.30955: Added host zos_system to inventory 78975 1728722686.30955: Added host zos_system to group mac 78975 1728722686.30955: set ansible_host for zos_system 78975 1728722686.30956: set ansible_user for zos_system 78975 1728722686.30956: set ansible_remote_port for zos_system 78975 1728722686.30956: set ansible_python_interpreter for zos_system Parsed /Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml inventory source with yaml plugin 78975 1728722686.30957: Reconcile groups and hosts in inventory. 78975 1728722686.30958: Group all now contains mac 78975 1728722686.31025: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/vars/init' skipped due to reserved name 78975 1728722686.31115: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments 78975 1728722686.31147: Loading ModuleDocFragment 'vars_plugin_staging' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/vars_plugin_staging.py 78975 1728722686.31155: Loaded config def from plugin (vars/host_group_vars) 78975 1728722686.31155: Loading VarsModule 'host_group_vars' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/vars/host_group_vars.py (found_in_cache=False, class_only=True) 78975 1728722686.31157: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/vars 78975 1728722686.31161: Loading VarsModule 'host_group_vars' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/vars/host_group_vars.py (found_in_cache=True, class_only=False) 78975 1728722686.31175: Loading CacheModule 'memory' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/cache/memory.py (found_in_cache=True, class_only=False) 78975 1728722686.31568: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/init' skipped due to reserved name 78975 1728722686.31634: Loading ModuleDocFragment 'connection_pipelining' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/connection_pipelining.py 78975 1728722686.31645: Loaded config def from plugin (connection/local) 78975 1728722686.31646: Loading Connection 'local' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/local.py (found_in_cache=False, class_only=True) 78975 1728722686.31839: Loaded config def from plugin (connection/paramiko_ssh) 78975 1728722686.31839: Loading Connection 'paramiko_ssh' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/paramiko_ssh.py (found_in_cache=False, class_only=True) 78975 1728722686.32506: Loading ModuleDocFragment 'connection_pipelining' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/connection_pipelining.py (found_in_cache=True, class_only=False) 78975 1728722686.32518: Loaded config def from plugin (connection/psrp) 78975 1728722686.32519: Loading Connection 'psrp' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/psrp.py (found_in_cache=False, class_only=True) 78975 1728722686.32745: Loading ModuleDocFragment 'connection_pipelining' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/connection_pipelining.py (found_in_cache=True, class_only=False) 78975 1728722686.32769: Loaded config def from plugin (connection/ssh) 78975 1728722686.32770: Loading Connection 'ssh' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/ssh.py (found_in_cache=False, class_only=True) 78975 1728722686.40797: Loading ModuleDocFragment 'connection_pipelining' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/connection_pipelining.py (found_in_cache=True, class_only=False) 78975 1728722686.40811: Loaded config def from plugin (connection/winrm) 78975 1728722686.40812: Loading Connection 'winrm' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/winrm.py (found_in_cache=False, class_only=True) 78975 1728722686.40854: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell/init' skipped due to reserved name 78975 1728722686.40897: Loading ModuleDocFragment 'shell_windows' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/shell_windows.py 78975 1728722686.40916: Loaded config def from plugin (shell/cmd) 78975 1728722686.40917: Loading ShellModule 'cmd' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell/cmd.py (found_in_cache=False, class_only=True) 78975 1728722686.40922: Loading ModuleDocFragment 'shell_windows' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/shell_windows.py (found_in_cache=True, class_only=False) 78975 1728722686.40940: Loaded config def from plugin (shell/powershell) 78975 1728722686.40940: Loading ShellModule 'powershell' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell/powershell.py (found_in_cache=False, class_only=True) 78975 1728722686.40972: Loading ModuleDocFragment 'shell_common' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/shell_common.py 78975 1728722686.41063: Loaded config def from plugin (shell/sh) 78975 1728722686.41064: Loading ShellModule 'sh' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell/sh.py (found_in_cache=False, class_only=True) 78975 1728722686.41099: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/become/init' skipped due to reserved name 78975 1728722686.41148: Loaded config def from plugin (become/runas) 78975 1728722686.41148: Loading BecomeModule 'runas' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/become/runas.py (found_in_cache=False, class_only=True) 78975 1728722686.41210: Loaded config def from plugin (become/su) 78975 1728722686.41211: Loading BecomeModule 'su' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/become/su.py (found_in_cache=False, class_only=True) 78975 1728722686.41265: Loaded config def from plugin (become/sudo) 78975 1728722686.41266: Loading BecomeModule 'sudo' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/become/sudo.py (found_in_cache=False, class_only=True) 78975 1728722686.41280: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/fetch.yml Loading collection ibm.ibm_zos_core from /Users/juergen/.ansible/collections/ansible_collections/ibm/ibm_zos_core 78975 1728722686.41567: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback 78975 1728722686.41627: Loading ModuleDocFragment 'default_callback' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/default_callback.py 78975 1728722686.41685: Loading ModuleDocFragment 'result_format_callback' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/result_format_callback.py 78975 1728722686.41703: Loaded config def from plugin (callback/default) 78975 1728722686.41703: Loading CallbackModule 'default' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/default.py Loading callback plugin default of type stdout, v2.0 from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/default.py 78975 1728722686.41721: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/init' skipped due to reserved name 78975 1728722686.41722: Loading CallbackModule 'default' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/default.py (found_in_cache=True, class_only=True) 78975 1728722686.42370: Loaded config def from plugin (callback/junit) 78975 1728722686.42370: Loading CallbackModule 'junit' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/junit.py (found_in_cache=False, class_only=True) 78975 1728722686.42396: Loading ModuleDocFragment 'result_format_callback' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/doc_fragments/result_format_callback.py (found_in_cache=True, class_only=False) 78975 1728722686.42415: Loaded config def from plugin (callback/minimal) 78975 1728722686.42416: Loading CallbackModule 'minimal' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/minimal.py (found_in_cache=False, class_only=True) 78975 1728722686.42435: Loading CallbackModule 'oneline' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/oneline.py (found_in_cache=False, class_only=True) 78975 1728722686.42460: Loaded config def from plugin (callback/tree) 78975 1728722686.42461: Loading CallbackModule 'tree' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/callback/tree.py (found_in_cache=False, class_only=True) Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: fetch.yml **** Positional arguments: fetch.yml verbosity: 4 connection: ssh become_method: sudo tags: ('all',) inventory: ('/Users/juergen/Dev/MyAnsible/playbooks/inventory/inventory.yml',) forks: 25 1 plays in fetch.yml 78975 1728722686.42467: in VariableManager get_vars() 78975 1728722686.42476: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722686.42485: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722686.42489: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722686.42514: done with get_vars() 78975 1728722686.42516: in VariableManager get_vars() 78975 1728722686.42520: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722686.42528: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722686.42531: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722686.42546: done with get_vars() 78975 1728722686.42547: variable 'omit' from source: magic vars 78975 1728722686.42558: in VariableManager get_vars() 78975 1728722686.42563: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722686.42569: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722686.42577: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722686.42599: done with get_vars() 78975 1728722686.42607: variable 'omit' from source: magic vars

PLAY [Replay zos_fetch issue] ** 78975 1728722686.44854: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/strategy 78975 1728722686.44911: Loading StrategyModule 'linear' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/strategy/linear.py 78975 1728722686.44930: getting the remaining hosts for this loop 78975 1728722686.44931: done getting the remaining hosts for this loop 78975 1728722686.44933: getting the next task for host zos_system 78975 1728722686.44934: done getting next task for host zos_system 78975 1728722686.44935: ^ task is: TASK: meta (flush_handlers) 78975 1728722686.44936: ^ state is: HOST STATE: block=1, task=1, rescue=0, always=0, handlers=0, run_state=1, fail_state=0, pre_flushing_run_state=None, update_handlers=True, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 78975 1728722686.44937: getting variables 78975 1728722686.44937: in VariableManager get_vars() 78975 1728722686.44948: Calling all_inventory to load vars for zos_system 78975 1728722686.44949: Calling groups_inventory to load vars for zos_system 78975 1728722686.44950: Calling all_plugins_inventory to load vars for zos_system 78975 1728722686.44957: processing dir /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars 78975 1728722686.44968: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722686.45007: Calling all_plugins_play to load vars for zos_system 78975 1728722686.45012: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722686.45013: processing dir /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars 78975 1728722686.45022: Calling groups_plugins_play to load vars for zos_system 78975 1728722686.45025: processing dir /Users/juergen/Dev/MyAnsible/playbooks/inventory/host_vars 78975 1728722686.45050: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/init' skipped due to reserved name 78975 1728722686.45066: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722686.45073: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722686.45076: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722686.45095: done with get_vars() 78975 1728722686.45097: done getting variables 78975 1728722686.45196: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/action 78975 1728722686.45218: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/action/pycache 78975 1728722686.45233: in VariableManager get_vars() 78975 1728722686.45235: Calling all_inventory to load vars for zos_system 78975 1728722686.45236: Calling groups_inventory to load vars for zos_system 78975 1728722686.45237: Calling all_plugins_inventory to load vars for zos_system 78975 1728722686.45240: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722686.45241: Calling all_plugins_play to load vars for zos_system 78975 1728722686.45242: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722686.45243: Calling groups_plugins_play to load vars for zos_system 78975 1728722686.45256: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/init' skipped due to reserved name 78975 1728722686.45260: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722686.45267: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722686.45269: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722686.45289: done with get_vars() 78975 1728722686.45292: done queuing things up, now waiting for results queue to drain 78975 1728722686.45293: results queue empty 78975 1728722686.45293: checking for any_errors_fatal 78975 1728722686.45294: done checking for any_errors_fatal 78975 1728722686.45294: checking for max_fail_percentage 78975 1728722686.45294: done checking for max_fail_percentage 78975 1728722686.45294: checking to see if all hosts have failed and the running result is not ok 78975 1728722686.45294: done checking to see if all hosts have failed 78975 1728722686.45294: getting the remaining hosts for this loop 78975 1728722686.45295: done getting the remaining hosts for this loop 78975 1728722686.45296: getting the next task for host zos_system 78975 1728722686.45297: done getting next task for host zos_system 78975 1728722686.45298: ^ task is: TASK: Fetch failure with invalid argument error 78975 1728722686.45298: ^ state is: HOST STATE: block=2, task=1, rescue=0, always=0, handlers=0, run_state=1, fail_state=0, pre_flushing_run_state=1, update_handlers=True, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 78975 1728722686.45299: getting variables 78975 1728722686.45299: in VariableManager get_vars() 78975 1728722686.45301: Calling all_inventory to load vars for zos_system 78975 1728722686.45302: Calling groups_inventory to load vars for zos_system 78975 1728722686.45302: Calling all_plugins_inventory to load vars for zos_system 78975 1728722686.45306: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722686.45307: Calling all_plugins_play to load vars for zos_system 78975 1728722686.45307: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722686.45308: Calling groups_plugins_play to load vars for zos_system 78975 1728722686.45321: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/init' skipped due to reserved name 78975 1728722686.45324: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722686.45332: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722686.45334: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722686.45360: done with get_vars() 78975 1728722686.45361: done getting variables 78975 1728722686.46893: Loading ActionModule 'ansible_collections.ibm.ibm_zos_core.plugins.action.zos_fetch' from /Users/juergen/.ansible/collections/ansible_collections/ibm/ibm_zos_core/plugins/action/zos_fetch.py (searched paths: /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/action:/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/action/pycache) (found_in_cache=False, class_only=True)

TASK [Fetch failure with invalid argument error] *** task path: /Users/juergen/Dev/MyAnsible/playbooks/fetch.yml:21 78975 1728722686.46905: entering _queue_task() for zos_system/ibm.ibm_zos_core.zos_fetch 78975 1728722686.46905: Creating lock for ibm.ibm_zos_core.zos_fetch 78975 1728722686.47068: worker is 1 (out of 1 available) 78975 1728722686.47076: exiting _queue_task() for zos_system/ibm.ibm_zos_core.zos_fetch 78975 1728722686.47083: done queuing things up, now waiting for results queue to drain 78975 1728722686.47084: waiting for pending results... 78975 1728722686.47208: running TaskExecutor() for zos_system/TASK: Fetch failure with invalid argument error 78975 1728722686.47236: in run() - task 0e8b6519-f42d-a8cb-d767-000000000005 78975 1728722686.47243: variable 'ansible_search_path' from source: unknown 78975 1728722686.47263: calling self._execute() 78975 1728722686.47288: variable 'ansible_host' from source: host vars for 'zos_system' 78975 1728722686.47289: variable 'ansible_user' from source: host vars for 'zos_system' 78975 1728722686.47294: variable 'omit' from source: magic vars 78975 1728722686.47336: variable 'omit' from source: magic vars 78975 1728722686.47343: variable 'omit' from source: magic vars 78975 1728722686.47353: variable 'environment_vars' from source: play vars_files from 'env.yml' 78975 1728722686.47470: variable 'environment_vars' from source: play vars_files from 'env.yml' 78975 1728722686.47472: variable 'ZOAU' from source: play vars_files from 'env.yml' 78975 1728722686.47495: variable 'ZOAU' from source: play vars_files from 'env.yml' 78975 1728722686.47524: variable 'PYZ' from source: play vars_files from 'env.yml' 78975 1728722686.47549: variable 'ZOAU' from source: play vars_files from 'env.yml' 78975 1728722686.47550: variable 'PYZ' from source: play vars_files from 'env.yml' 78975 1728722686.47574: variable 'ZOAU' from source: play vars_files from 'env.yml' 78975 1728722686.47575: variable 'PYZ' from source: play vars_files from 'env.yml' 78975 1728722686.47613: variable 'omit' from source: magic vars 78975 1728722686.47628: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection 78975 1728722686.47660: Loading Connection 'ssh' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/ssh.py (found_in_cache=True, class_only=False) 78975 1728722686.47668: trying /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell 78975 1728722686.47690: Loading ShellModule 'sh' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 78975 1728722686.47691: Loading ShellModule 'sh' from /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 78975 1728722686.47704: variable 'inventory_hostname' from source: host vars for 'zos_system' 78975 1728722686.47704: variable 'ansible_host' from source: host vars for 'zos_system' 78975 1728722686.47705: variable 'ansible_user' from source: host vars for 'zos_system' 78975 1728722686.47749: Set connection var ansible_port to 21222 78975 1728722686.47751: Set connection var ansible_timeout to 10 78975 1728722686.47752: Set connection var ansible_pipelining to True 78975 1728722686.47755: Set connection var ansible_module_compression to ZIP_DEFLATED 78975 1728722686.47756: Set connection var ansible_shell_executable to /bin/sh 78975 1728722686.47757: Set connection var ansible_connection to ssh 78975 1728722686.47757: Set connection var ansible_shell_type to sh 78975 1728722686.47766: variable 'ansible_shell_executable' from source: unknown 78975 1728722686.47767: variable 'ansible_connection' from source: unknown 78975 1728722686.47768: variable 'ansible_module_compression' from source: unknown 78975 1728722686.47769: variable 'ansible_shell_type' from source: unknown 78975 1728722686.47769: variable 'ansible_shell_executable' from source: unknown 78975 1728722686.47770: variable 'ansible_host' from source: host vars for 'zos_system' 78975 1728722686.47771: variable 'ansible_user' from source: host vars for 'zos_system' 78975 1728722686.47772: variable 'ansible_port' from source: unknown 78975 1728722686.47772: variable 'ansible_pipelining' from source: unknown 78975 1728722686.47773: variable 'ansible_timeout' from source: unknown 78975 1728722686.47806: Loading ActionModule 'ansible_collections.ibm.ibm_zos_core.plugins.action.zos_fetch' from /Users/juergen/.ansible/collections/ansible_collections/ibm/ibm_zos_core/plugins/action/zos_fetch.py (searched paths: /opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/action:/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/action/pycache) (found_in_cache=True, class_only=False) 78975 1728722686.47807: variable 'omit' from source: magic vars 78975 1728722686.47808: starting attempt loop 78975 1728722686.47809: running the handler 78975 1728722686.47906: variable 'ansible_module_compression' from source: unknown 78975 1728722686.47953: ANSIBALLZ: Using lock for ibm.ibm_zos_core.zos_fetch 78975 1728722686.47954: ANSIBALLZ: Acquiring lock 78975 1728722686.47955: ANSIBALLZ: Lock acquired: 4381881456 78975 1728722686.47956: ANSIBALLZ: Creating module 78975 1728722686.54541: ANSIBALLZ: Writing module into payload 78975 1728722686.54648: ANSIBALLZ: Writing module 78975 1728722686.54679: ANSIBALLZ: Renaming module 78975 1728722686.54698: ANSIBALLZ: Done creating module 78975 1728722686.54708: variable 'ansible_python_interpreter' from source: host vars for 'zos_system' 78975 1728722686.54744: variable 'PYZ' from source: play vars_files from 'env.yml' Using module file /Users/juergen/.ansible/collections/ansible_collections/ibm/ibm_zos_core/plugins/modules/zos_fetch.py Pipelining is enabled. 78975 1728722686.54788: _low_level_execute_command(): starting 78975 1728722686.54797: _low_level_execute_command(): executing: /bin/sh -c '_BPXK_AUTOCVT=ON ZOAU_HOME=/usr/lpp/IBM/zoautil PYTHONPATH=/usr/lpp/IBM/cyp/v3r11/pyz/bin LIBPATH=/usr/lpp/IBM/zoautil/lib:/usr/lpp/IBM/cyp/v3r11/pyz/lib:/lib:/usr/lib PATH=/usr/lpp/IBM/zoautil/bin:/usr/lpp/IBM/cyp/v3r11/pyz/bin:/local/bin:/bin _CEE_RUNOPTS='"'"'FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)'"'"' _TAG_REDIR_ERR=txt _TAG_REDIR_IN=txt _TAG_REDIR_OUT=txt LANG=C PYTHONSTDINENCODING=cp1047 /usr/lpp/IBM/cyp/v3r11/pyz/bin/python && sleep 0'

ESTABLISH SSH CONNECTION FOR USER: ibmuser SSH: EXEC ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o Port=21222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ibmuser"' -o ConnectTimeout=10 -o 'ControlPath="/Users/juergen/.ansible/cp/7aa025b323"' hsslp13.pok.stglabs.ibm.com '/bin/sh -c '"'"'_BPXK_AUTOCVT=ON ZOAU_HOME=/usr/lpp/IBM/zoautil PYTHONPATH=/usr/lpp/IBM/cyp/v3r11/pyz/bin LIBPATH=/usr/lpp/IBM/zoautil/lib:/usr/lpp/IBM/cyp/v3r11/pyz/lib:/lib:/usr/lib PATH=/usr/lpp/IBM/zoautil/bin:/usr/lpp/IBM/cyp/v3r11/pyz/bin:/local/bin:/bin _CEE_RUNOPTS='"'"'"'"'"'"'"'"'FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)'"'"'"'"'"'"'"'"' _TAG_REDIR_ERR=txt _TAG_REDIR_IN=txt _TAG_REDIR_OUT=txt LANG=C PYTHONSTDINENCODING=cp1047 /usr/lpp/IBM/cyp/v3r11/pyz/bin/python && sleep 0'"'"'' 78975 1728722686.55091: Sending initial data 78975 1728722686.82766: Sent initial data (187714 bytes) 78975 1728722686.82783: stderr chunk (state=3): >>>OpenSSH_9.7p1, LibreSSL 3.3.6 debug1: Reading configuration data /Users/juergen/.ssh/config debug1: /Users/juergen/.ssh/config line 1: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/juergen/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/juergen/.ssh/known_hosts2' debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: auto-mux: Trying existing master at '/Users/juergen/.ansible/cp/7aa025b323' debug2: fd 3 setting O_NONBLOCK debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering debug3: mux_client_request_alive: done pid = 78853 debug3: mux_client_request_session: session request sent debug1: mux_client_request_session: master session id: 2 <<< 78975 1728722687.65819: stdout chunk (state=3): >>> {"stderr": "Invalid argument \"tmp/abc1\" for type \"path\".", "failed": true, "msg": "Parameter verification failed", "exception": " File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/modules/zos_fetch.py\", line 879, in run_module\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 1036, in parse_args\n updated_value = handler.handle_arg()\n ^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 186, in handle_arg\n self.contents = self._resolve_arg_type()\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 807, in _resolve_arg_type\n return self.type_handlers.get(self.arg_def.arg_type)(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 248, in _dict_type\n updated_value = handler.handle_arg()\n ^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 186, in handle_arg\n self.contents = self._resolve_arg_type()\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 807, in _resolve_arg_type\n return self.type_handlers.get(self.arg_def.arg_type)(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 355, in _path_type\n raise ValueError('Invalid argument \"{0}\" for type \"path\".'.format(contents))\n", "invocation": {"module_args": {"src": "IBMUSER.TVT5002.CERTGEN", "dest": "tmp/abc1", "flat": true, "encoding": {"from": "IBM-1047", "to": "ISO8859-1"}, "fail_on_missing": true, "is_binary": false, "use_qualifier": false, "validate_checksum": true, "ignore_sftp_stderr": false, "tmp_hlq": null, "from_encoding": "IBM-1047", "to_encoding": "ISO8859-1"}}} <<< 78975 1728722687.65830: stderr chunk (state=3): >>>debug3: mux_client_read_packet_timeout: read header failed: Broken pipe debug2: Received exit status from master 1 <<< 78975 1728722687.65859: stderr chunk (state=3): >>><<< 78975 1728722687.65862: stdout chunk (state=3): >>><<< (1, b'\n{"stderr": "Invalid argument \\"tmp/abc1\\" for type \\"path\\".", "failed": true, "msg": "Parameter verification failed", "exception": " File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/modules/zos_fetch.py\\", line 879, in run_module\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 1036, in parse_args\\n updated_value = handler.handle_arg()\\n ^^^^^^^^^^^^^^^^^^^^\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 186, in handle_arg\\n self.contents = self._resolve_arg_type()\\n ^^^^^^^^^^^^^^^^^^^^^^^^\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 807, in _resolve_arg_type\\n return self.type_handlers.get(self.arg_def.arg_type)(\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 248, in _dict_type\\n updated_value = handler.handle_arg()\\n ^^^^^^^^^^^^^^^^^^^^\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 186, in handle_arg\\n self.contents = self._resolve_arg_type()\\n ^^^^^^^^^^^^^^^^^^^^^^^^\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 807, in _resolve_arg_type\\n return self.type_handlers.get(self.arg_def.arg_type)(\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n File \\"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\\", line 355, in _path_type\\n raise ValueError(\'Invalid argument \\"{0}\\" for type \\"path\\".\'.format(contents))\\n", "invocation": {"module_args": {"src": "IBMUSER.TVT5002.CERTGEN", "dest": "tmp/abc1", "flat": true, "encoding": {"from": "IBM-1047", "to": "ISO8859-1"}, "fail_on_missing": true, "is_binary": false, "use_qualifier": false, "validate_checksum": true, "ignore_sftp_stderr": false, "tmp_hlq": null, "from_encoding": "IBM-1047", "to_encoding": "ISO8859-1"}}}\n', b"OpenSSH_9.7p1, LibreSSL 3.3.6\r\ndebug1: Reading configuration data /Users/juergen/.ssh/config\r\ndebug1: /Users/juergen/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files\r\ndebug1: /etc/ssh/ssh_config line 54: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/juergen/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/juergen/.ssh/known_hosts2'\r\ndebug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling\r\ndebug1: auto-mux: Trying existing master at '/Users/juergen/.ansible/cp/7aa025b323'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 78853\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n") Failed to connect to the host via ssh: OpenSSH_9.7p1, LibreSSL 3.3.6 debug1: Reading configuration data /Users/juergen/.ssh/config debug1: /Users/juergen/.ssh/config line 1: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/juergen/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/juergen/.ssh/known_hosts2' debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: auto-mux: Trying existing master at '/Users/juergen/.ansible/cp/7aa025b323' debug2: fd 3 setting O_NONBLOCK debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering debug3: mux_client_request_alive: done pid = 78853 debug3: mux_client_request_session: session request sent debug1: mux_client_request_session: master session id: 2 debug3: mux_client_read_packet_timeout: read header failed: Broken pipe debug2: Received exit status from master 1 78975 1728722687.66006: _low_level_execute_command() done: rc=1, stdout= {"stderr": "Invalid argument \"tmp/abc1\" for type \"path\".", "failed": true, "msg": "Parameter verification failed", "exception": " File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/modules/zos_fetch.py\", line 879, in run_module\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 1036, in parse_args\n updated_value = handler.handle_arg()\n ^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 186, in handle_arg\n self.contents = self._resolve_arg_type()\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 807, in _resolve_arg_type\n return self.type_handlers.get(self.arg_def.arg_type)(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 248, in _dict_type\n updated_value = handler.handle_arg()\n ^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 186, in handle_arg\n self.contents = self._resolve_arg_type()\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 807, in _resolve_arg_type\n return self.type_handlers.get(self.arg_def.arg_type)(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/tmp/ansible_ibm.ibm_zos_core.zos_fetch_payload_oag2vbi3/ansible_ibm.ibm_zos_core.zos_fetch_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/better_arg_parser.py\", line 355, in _path_type\n raise ValueError('Invalid argument \"{0}\" for type \"path\".'.format(contents))\n", "invocation": {"module_args": {"src": "IBMUSER.TVT5002.CERTGEN", "dest": "tmp/abc1", "flat": true, "encoding": {"from": "IBM-1047", "to": "ISO8859-1"}, "fail_on_missing": true, "is_binary": false, "use_qualifier": false, "validate_checksum": true, "ignore_sftp_stderr": false, "tmp_hlq": null, "from_encoding": "IBM-1047", "to_encoding": "ISO8859-1"}}} , stderr=OpenSSH_9.7p1, LibreSSL 3.3.6 debug1: Reading configuration data /Users/juergen/.ssh/config debug1: /Users/juergen/.ssh/config line 1: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/juergen/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/juergen/.ssh/known_hosts2' debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: auto-mux: Trying existing master at '/Users/juergen/.ansible/cp/7aa025b323' debug2: fd 3 setting O_NONBLOCK debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering debug3: mux_client_request_alive: done pid = 78853 debug3: mux_client_request_session: session request sent debug1: mux_client_request_session: master session id: 2 debug3: mux_client_read_packet_timeout: read header failed: Broken pipe debug2: Received exit status from master 1 78975 1728722687.66121: done with _execute_module (ibm.ibm_zos_core.zos_fetch, {'src': 'IBMUSER.TVT5002.CERTGEN', 'dest': 'tmp/abc1', 'flat': True, 'encoding': {'from': 'IBM-1047', 'to': 'ISO8859-1'}, '_ansible_check_mode': False, '_ansible_no_log': False, '_ansible_debug': True, '_ansible_diff': False, '_ansible_verbosity': 4, '_ansible_version': '2.17.4', '_ansible_module_name': 'ibm.ibm_zos_core.zos_fetch', '_ansible_syslog_facility': 'LOG_USER', '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p', 'vfat'], '_ansible_string_conversion_action': 'warn', '_ansible_socket': None, '_ansible_shell_executable': '/bin/sh', '_ansible_keep_remote_files': False, '_ansible_tmpdir': None, '_ansible_remote_tmp': '~/.ansible/tmp', '_ansible_ignore_unknown_opts': False, '_ansible_target_log_info': None}) 78975 1728722687.66137: handler run complete 78975 1728722687.66153: attempt loop complete, returning result 78975 1728722687.66160: _execute() done 78975 1728722687.66163: dumping result to json 78975 1728722687.66165: done dumping result, returning 78975 1728722687.66188: done running TaskExecutor() for zos_system/TASK: Fetch failure with invalid argument error [0e8b6519-f42d-a8cb-d767-000000000005] 78975 1728722687.66196: sending task result for task 0e8b6519-f42d-a8cb-d767-000000000005 78975 1728722687.66406: done sending task result for task 0e8b6519-f42d-a8cb-d767-000000000005 78975 1728722687.66409: WORKER PROCESS EXITING fatal: [zos_system]: FAILED! => { "changed": false, "msg": "Parameter verification failed", "rc": null, "stderr": "Invalid argument \"tmp/abc1\" for type \"path\".", "stderr_lines": [ "Invalid argument \"tmp/abc1\" for type \"path\"." ], "stdout": null, "stdout_lines": null } ...ignoring 78975 1728722687.66778: no more pending results, returning what we have 78975 1728722687.66797: results queue empty 78975 1728722687.66797: checking for any_errors_fatal 78975 1728722687.66799: done checking for any_errors_fatal 78975 1728722687.66799: checking for max_fail_percentage 78975 1728722687.66801: done checking for max_fail_percentage 78975 1728722687.66801: checking to see if all hosts have failed and the running result is not ok 78975 1728722687.66802: done checking to see if all hosts have failed 78975 1728722687.66802: getting the remaining hosts for this loop 78975 1728722687.66804: done getting the remaining hosts for this loop 78975 1728722687.66806: getting the next task for host zos_system 78975 1728722687.66811: done getting next task for host zos_system 78975 1728722687.66813: ^ task is: TASK: meta (flush_handlers) 78975 1728722687.66815: ^ state is: HOST STATE: block=3, task=1, rescue=0, always=0, handlers=0, run_state=1, fail_state=0, pre_flushing_run_state=1, update_handlers=True, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 78975 1728722687.66819: getting variables 78975 1728722687.66820: in VariableManager get_vars() 78975 1728722687.66959: Calling all_inventory to load vars for zos_system 78975 1728722687.66963: Calling groups_inventory to load vars for zos_system 78975 1728722687.66965: Calling all_plugins_inventory to load vars for zos_system 78975 1728722687.67003: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722687.67006: Calling all_plugins_play to load vars for zos_system 78975 1728722687.67008: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722687.67010: Calling groups_plugins_play to load vars for zos_system 78975 1728722687.67098: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/__init__' skipped due to reserved name 78975 1728722687.67113: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722687.67133: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722687.67151: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722687.67219: done with get_vars() 78975 1728722687.67224: done getting variables 78975 1728722687.67249: in VariableManager get_vars() 78975 1728722687.67254: Calling all_inventory to load vars for zos_system 78975 1728722687.67256: Calling groups_inventory to load vars for zos_system 78975 1728722687.67257: Calling all_plugins_inventory to load vars for zos_system 78975 1728722687.67264: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722687.67266: Calling all_plugins_play to load vars for zos_system 78975 1728722687.67267: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722687.67269: Calling groups_plugins_play to load vars for zos_system 78975 1728722687.67296: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/__init__' skipped due to reserved name 78975 1728722687.67304: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722687.67319: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722687.67323: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722687.67361: done with get_vars() 78975 1728722687.67368: done queuing things up, now waiting for results queue to drain 78975 1728722687.67369: results queue empty 78975 1728722687.67369: checking for any_errors_fatal 78975 1728722687.67371: done checking for any_errors_fatal 78975 1728722687.67371: checking for max_fail_percentage 78975 1728722687.67372: done checking for max_fail_percentage 78975 1728722687.67372: checking to see if all hosts have failed and the running result is not ok 78975 1728722687.67373: done checking to see if all hosts have failed 78975 1728722687.67373: getting the remaining hosts for this loop 78975 1728722687.67373: done getting the remaining hosts for this loop 78975 1728722687.67375: getting the next task for host zos_system 78975 1728722687.67378: done getting next task for host zos_system 78975 1728722687.67379: ^ task is: TASK: meta (flush_handlers) 78975 1728722687.67380: ^ state is: HOST STATE: block=4, task=1, rescue=0, always=0, handlers=0, run_state=1, fail_state=0, pre_flushing_run_state=1, update_handlers=True, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 78975 1728722687.67381: getting variables 78975 1728722687.67382: in VariableManager get_vars() 78975 1728722687.67387: Calling all_inventory to load vars for zos_system 78975 1728722687.67388: Calling groups_inventory to load vars for zos_system 78975 1728722687.67389: Calling all_plugins_inventory to load vars for zos_system 78975 1728722687.67396: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722687.67398: Calling all_plugins_play to load vars for zos_system 78975 1728722687.67399: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722687.67401: Calling groups_plugins_play to load vars for zos_system 78975 1728722687.67427: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/__init__' skipped due to reserved name 78975 1728722687.67435: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722687.67448: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722687.67453: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722687.67490: done with get_vars() 78975 1728722687.67493: done getting variables 78975 1728722687.67503: in VariableManager get_vars() 78975 1728722687.67508: Calling all_inventory to load vars for zos_system 78975 1728722687.67509: Calling groups_inventory to load vars for zos_system 78975 1728722687.67510: Calling all_plugins_inventory to load vars for zos_system 78975 1728722687.67516: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/inventory/group_vars/all.yml 78975 1728722687.67517: Calling all_plugins_play to load vars for zos_system 78975 1728722687.67519: Calling groups_plugins_inventory to load vars for zos_system 78975 1728722687.67521: Calling groups_plugins_play to load vars for zos_system 78975 1728722687.67543: '/opt/homebrew/Cellar/ansible/10.4.0/libexec/lib/python3.12/site-packages/ansible/plugins/connection/__init__' skipped due to reserved name 78975 1728722687.67550: evaluation_path: /Users/juergen/Dev/MyAnsible/playbooks 78975 1728722687.67562: search_path: /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml /Users/juergen/Dev/MyAnsible/playbooks/vars/env.yml /Users/juergen/Dev/MyAnsible/playbooks/env.yml 78975 1728722687.67567: Loading data from /Users/juergen/Dev/MyAnsible/playbooks/env.yml Read vars_file 'env.yml' 78975 1728722687.67601: done with get_vars() 78975 1728722687.67605: done queuing things up, now waiting for results queue to drain 78975 1728722687.67606: results queue empty 78975 1728722687.67606: checking for any_errors_fatal 78975 1728722687.67607: done checking for any_errors_fatal 78975 1728722687.67607: checking for max_fail_percentage 78975 1728722687.67608: done checking for max_fail_percentage 78975 1728722687.67608: checking to see if all hosts have failed and the running result is not ok 78975 1728722687.67608: done checking to see if all hosts have failed 78975 1728722687.67609: getting the remaining hosts for this loop 78975 1728722687.67609: done getting the remaining hosts for this loop 78975 1728722687.67611: getting the next task for host zos_system 78975 1728722687.67613: done getting next task for host zos_system 78975 1728722687.67613: ^ task is: None 78975 1728722687.67614: ^ state is: HOST STATE: block=5, task=0, rescue=0, always=0, handlers=0, run_state=5, fail_state=0, pre_flushing_run_state=1, update_handlers=True, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False 78975 1728722687.67614: done queuing things up, now waiting for results queue to drain 78975 1728722687.67615: results queue empty 78975 1728722687.67615: checking for any_errors_fatal 78975 1728722687.67615: done checking for any_errors_fatal 78975 1728722687.67616: checking for max_fail_percentage 78975 1728722687.67616: done checking for max_fail_percentage 78975 1728722687.67617: checking to see if all hosts have failed and the running result is not ok 78975 1728722687.67617: done checking to see if all hosts have failed 78975 1728722687.67618: getting the next task for host zos_system 78975 1728722687.67619: done getting next task for host zos_system 78975 1728722687.67620: ^ task is: None 78975 1728722687.67620: ^ state is: HOST STATE: block=5, task=0, rescue=0, always=0, handlers=0, run_state=5, fail_state=0, pre_flushing_run_state=1, update_handlers=True, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False PLAY RECAP ********************************************************************* zos_system : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=1 78975 1728722687.67673: RUNNING CLEANUP ### Ansible configuration. ```YAML [defaults] forks=25 remote_port=21222 [connection] pipelining=True ``` ### Contents of the inventory ```YAML mac: hosts: localhost: ansible_connection: local ansible_python_interpreter: /opt/homebrew/bin/python3.12 my_host_var: MacOS zos_system: ansible_host: hsslp13.pok.stglabs.ibm.com ansible_user: ibmuser ansible_remote_port: 21222 ansible_python_interpreter: "{{ PYZ }}/bin/python" ``` ### Contents of `group_vars` or `host_vars` ```YAML n/a ```
juergen-holtz commented 5 days ago

Looking closer into the debug trace, it turns out that the path is checked for being an absolute path in _path_type method within better_arg_parser.py. Before, the local path is fixed however, the requirement is that a local path is only allowed with a tilde, .. or . prepended (see method fix_local_path).

A possible fix could be to provide better documentation that states how the relative path should be provided or by prepending ./ to the given path if it doesn't start with / and anything else being tested in this method.
Example:

    final_path = given_path
        if given_path.startswith("~"):
            final_path = path.expanduser(given_path)
        elif given_path.startswith(".."):
            pwd = str(path.realpath(".."))
            final_path = pwd + given_path[2:]
        elif given_path.startswith("."):
            wd = str(path.realpath("."))
            final_path = wd + given_path[1:]
        elif not given_path.startswith("/")):
            wd = str(path.realpath("."))
            final_path = path.join(wd, given_path)

        return str(final_path)