Ansible Pilot

Ansible troubleshooting - invalid argument

How to reproduce the `invalid argument` error of the Ansible module file, troubleshooting, and fix to be able to successfully create a symlink in Linux.

November 16, 2021
Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons

Today we’re going to talk about Ansible troubleshooting, specifically about Invalid argument errors. I’m Luca Berton and welcome to today’s episode of Ansible Pilot.

The Best Resources For Ansible

Video Course

Books

demo

The best way of talking about Ansible troubleshooting is to jump in a live demo to show you practically the missing module parameter and how to solve it!

error code

---
- name: file module demo
  hosts: all
  vars:
    mylink: "~/example"
    mysrc: "/proc/cpuinfo"
  tasks:
    - name: Creating a symlink
      ansible.builtin.file:
        path: "{{ mylink }}"
        dest: "{{ mysrc }}"
        state: link

error execution


$ ansible-playbook -i virtualmachines/demo/inventory troubleshooting/invalidargument_error.yml
PLAY [file module demo] ********************************************************
TASK [Gathering Facts] *********************************************************
ok: [demo.example.com]
TASK [Creating a symlink] ******************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 22] Invalid argument: b'/proc/cpuinfo'
fatal: [demo.example.com]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.0.190 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/devops/.ansible/tmp/ansible-tmp-1637075583.2696111-7687-94302336849468/AnsiballZ_file.py\", line 100, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/devops/.ansible/tmp/ansible-tmp-1637075583.2696111-7687-94302336849468/AnsiballZ_file.py\", line 92, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/devops/.ansible/tmp/ansible-tmp-1637075583.2696111-7687-94302336849468/AnsiballZ_file.py\", line 41, in invoke_module\r\n    run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_ansible.builtin.file_payload_7ktwrx3h/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 966, in <module>\r\n  File \"/tmp/ansible_ansible.builtin.file_payload_7ktwrx3h/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 954, in main\r\n  File \"/tmp/ansible_ansible.builtin.file_payload_7ktwrx3h/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 688, in ensure_symlink\r\nOSError: [Errno 22] Invalid argument: b'/proc/cpuinfo'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
PLAY RECAP *********************************************************************
demo.example.com           : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

high verbose execution (-vvv)


$ ansible-playbook -i virtualmachines/demo/inventory troubleshooting/invalidargument_error.yml -vvv
ansible-playbook [core 2.11.6] 
  config file = None
  configured module search path = ['/Users/lberton/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/lberton/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.10.0 (default, Oct 13 2021, 06:45:00) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.2
  libyaml = True
No config file found; using defaults
host_list declined parsing /Users/lberton/prj/github/ansible-pilot/virtualmachines/demo/inventory as it did not pass its verify_file() method
script declined parsing /Users/lberton/prj/github/ansible-pilot/virtualmachines/demo/inventory as it did not pass its verify_file() method
auto declined parsing /Users/lberton/prj/github/ansible-pilot/virtualmachines/demo/inventory as it did not pass its verify_file() method
Parsed /Users/lberton/prj/github/ansible-pilot/virtualmachines/demo/inventory inventory source with ini plugin
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: invalidargument_error.yml ********************************************
1 plays in troubleshooting/invalidargument_error.yml
PLAY [file module demo] ********************************************************
TASK [Gathering Facts] *********************************************************
task path: /Users/lberton/prj/github/ansible-pilot/troubleshooting/invalidargument_error.yml:2
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'echo ~devops && sleep 0'"'"''
<192.168.0.190> (0, b'/home/devops\n', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/devops/.ansible/tmp `"&& mkdir "` echo /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101 `" && echo ansible-tmp-1637075611.201921-7700-238727032540101="` echo /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101 `" ) && sleep 0'"'"''
<192.168.0.190> (0, b'ansible-tmp-1637075611.201921-7700-238727032540101=/home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101\n', b'')
<demo.example.com> Attempting python interpreter discovery
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'echo PLATFORM; uname; echo FOUND; command -v '"'"'"'"'"'"'"'"'/usr/bin/python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.9'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.8'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.5'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/libexec/platform-python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python3'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python'"'"'"'"'"'"'"'"'; echo ENDFOUND && sleep 0'"'"''
<192.168.0.190> (0, b'PLATFORM\nLinux\nFOUND\n/usr/bin/python3.6\n/usr/libexec/platform-python\n/usr/bin/python3\nENDFOUND\n', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'/usr/bin/python3.6 && sleep 0'"'"''
<192.168.0.190> (0, b'{"platform_dist_result": ["redhat", "8.4", "Ootpa"], "osrelease_content": "NAME=\\"Red Hat Enterprise Linux\\"\\nVERSION=\\"8.4 (Ootpa)\\"\\nID=\\"rhel\\"\\nID_LIKE=\\"fedora\\"\\nVERSION_ID=\\"8.4\\"\\nPLATFORM_ID=\\"platform:el8\\"\\nPRETTY_NAME=\\"Red Hat Enterprise Linux 8.4 (Ootpa)\\"\\nANSI_COLOR=\\"0;31\\"\\nCPE_NAME=\\"cpe:/o:redhat:enterprise_linux:8.4:GA\\"\\nHOME_URL=\\"https://www.redhat.com/\\"\\nDOCUMENTATION_URL=\\"https://access.redhat.com/documentation/red_hat_enterprise_linux/8/\\"\\nBUG_REPORT_URL=\\"https://bugzilla.redhat.com/\\"\\n\\nREDHAT_BUGZILLA_PRODUCT=\\"Red Hat Enterprise Linux 8\\"\\nREDHAT_BUGZILLA_PRODUCT_VERSION=8.4\\nREDHAT_SUPPORT_PRODUCT=\\"Red Hat Enterprise Linux\\"\\nREDHAT_SUPPORT_PRODUCT_VERSION=\\"8.4\\"\\n"}\n', b'')
Using module file /usr/local/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible/modules/setup.py
<192.168.0.190> PUT /Users/lberton/.ansible/tmp/ansible-local-7697iluh4khz/tmpjxztg1jt TO /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101/AnsiballZ_setup.py
<192.168.0.190> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 '[192.168.0.190]'
<192.168.0.190> (0, b'sftp> put /Users/lberton/.ansible/tmp/ansible-local-7697iluh4khz/tmpjxztg1jt /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101/AnsiballZ_setup.py\n', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'chmod u+x /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101/ /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101/AnsiballZ_setup.py && sleep 0'"'"''
<192.168.0.190> (0, b'', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 -tt 192.168.0.190 '/bin/sh -c '"'"'/usr/libexec/platform-python /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101/AnsiballZ_setup.py && sleep 0'"'"''
<192.168.0.190> (0, b'\r\n{"ansible_facts": {"ansible_python": {"version": {"major": 3, "minor": 6, "micro": 8, "releaselevel": "final", "serial": 0}, "version_info": [3, 6, 8, "final", 0], "executable": "/usr/libexec/platform-python", "has_sslcontext": true, "type": "cpython"}, "ansible_system": "Linux", "ansible_kernel": "4.18.0-305.el8.x86_64", "ansible_kernel_version": "#1 SMP Thu Apr 29 08:54:30 EDT 2021", "ansible_machine": "x86_64", "ansible_python_version": "3.6.8", "ansible_fqdn": "demo.example.com", "ansible_hostname": "demo", "ansible_nodename": "demo.example.com", "ansible_domain": "example.com", "ansible_userspace_bits": "64", "ansible_architecture": "x86_64", "ansible_userspace_architecture": "x86_64", "ansible_machine_id": "e03fdda4378049efaa08f0a40eeb3df7", "ansible_iscsi_iqn": "", "ansible_user_id": "devops", "ansible_user_uid": 1001, "ansible_user_gid": 10, "ansible_user_gecos": "", "ansible_user_dir": "/home/devops", "ansible_user_shell": "/bin/bash", "ansible_real_user_id": 1001, "ansible_effective_user_id": 1001, "ansible_real_group_id": 10, "ansible_effective_group_id": 10, "ansible_cmdline": {"BOOT_IMAGE": "(hd0,msdos1)/vmlinuz-4.18.0-305.el8.x86_64", "root": "/dev/mapper/rhel_rhel8-root", "ro": true, "no_timer_check": true, "crashkernel": "auto", "resume": "/dev/mapper/rhel_rhel8-swap", "rd.lvm.lv": "rhel_rhel8/swap", "biosdevname": "0", "net.ifnames": "0", "rhgb": true, "quiet": true}, "ansible_proc_cmdline": {"BOOT_IMAGE": "(hd0,msdos1)/vmlinuz-4.18.0-305.el8.x86_64", "root": "/dev/mapper/rhel_rhel8-root", "ro": true, "no_timer_check": true, "crashkernel": "auto", "resume": "/dev/mapper/rhel_rhel8-swap", "rd.lvm.lv": ["rhel_rhel8/root", "rhel_rhel8/swap"], "biosdevname": "0", "net.ifnames": "0", "rhgb": true, "quiet": true}, "ansible_distribution": "RedHat", "ansible_distribution_release": "Ootpa", "ansible_distribution_version": "8.4", "ansible_distribution_major_version": "8", "ansible_distribution_file_path": "/etc/redhat-release", "ansible_distribution_file_variety": "RedHat", "ansible_distribution_file_parsed": true, "ansible_distribution_file_search_string": "Red Hat", "ansible_os_family": "RedHat", "ansible_is_chroot": false, "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABgQDAW9MaZgK1RHLUfi592OuH7iVdSr4QrxH66r2b4QcZDa1ormtbb/zyiX0by71MYTutyfATE2rJLs+eWbdUppAr3AfLK8ZOdC6mypN6vD3SAmIToQq2LA/UtNFSr49Rbi4JBKYGrrJayRdVSg/I7fupYDmoEryW5/RMzpLfEUdeFfIw3AMVnPxOaMTHlIn2hEUplgexVIgKQXaS9gLFrxUrjZh4KYIbfrvPRdMifU1psUwdK/AHEXuc4aNpQXI55+bKHkWUhNd4bsLnAxfmjUTqe+hLzOIXVxqR9vNE4tmJm0V2oo6Dqn1jv17enQ/4kTpotJTvSpddxoAYNE1V+RiBXqzmZ/U2fNith4lPvdPRoVuU6vAdMeONbqt6HSYueMZggayRSnJBdpNL1z2mhEYLaqOPCAoT6eUynFGD3d2+g8O5mDx9Aib6dxj0KKdQ7EqsRt/v/BSnG1onUimfeOq3UK8zZaZ8c9jEBL4xpFRh11vXn/PqAW6yfvlXzYR186E=", "ansible_ssh_host_key_rsa_public_keytype": "ssh-rsa", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBD191gzPfk8M293CUSfpDqIyYeCZ/CTkBhnfssDcl7hTjglDv2+bk286IYXW8MWDvsrBDNnD3obro23X7rPUm6k=", "ansible_ssh_host_key_ecdsa_public_keytype": "ecdsa-sha2-nistp256", "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIC0jh56hNupL4dEEY70XwEovfX3VmxdIEg1tDXdvsizO", "ansible_ssh_host_key_ed25519_public_keytype": "ssh-ed25519", "ansible_selinux_python_present": true, "ansible_selinux": {"status": "enabled", "policyvers": 33, "config_mode": "enforcing", "mode": "enforcing", "type": "targeted"}, "ansible_date_time": {"year": "2021", "month": "11", "weekday": "Tuesday", "weekday_number": "2", "weeknumber": "46", "day": "16", "hour": "15", "minute": "13", "second": "32", "epoch": "1637075612", "date": "2021-11-16", "time": "15:13:32", "iso8601_micro": "2021-11-16T15:13:32.116130Z", "iso8601": "2021-11-16T15:13:32Z", "iso8601_basic": "20211116T151332116130", "iso8601_basic_short": "20211116T151332", "tz": "UTC", "tz_dst": "UTC", "tz_offset": "+0000"}, "ansible_system_capabilities_enforced": "True", "ansible_system_capabilities": [""], "ansible_dns": {"search": ["example.com"], "nameservers": ["10.0.2.3", "192.168.0.1"]}, "ansible_virtualization_role": "guest", "ansible_virtualization_type": "virtualbox", "ansible_virtualization_tech_guest": ["virtualbox"], "ansible_virtualization_tech_host": [], "ansible_processor": ["0", "GenuineIntel", "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz"], "ansible_processor_count": 1, "ansible_processor_cores": 1, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 1, "ansible_processor_nproc": 1, "ansible_memtotal_mb": 809, "ansible_memfree_mb": 231, "ansible_swaptotal_mb": 2107, "ansible_swapfree_mb": 2106, "ansible_memory_mb": {"real": {"total": 809, "used": 578, "free": 231}, "nocache": {"free": 615, "used": 194}, "swap": {"total": 2107, "free": 2106, "used": 1, "cached": 0}}, "ansible_bios_date": "12/01/2006", "ansible_bios_vendor": "innotek GmbH", "ansible_bios_version": "VirtualBox", "ansible_board_asset_tag": "NA", "ansible_board_name": "VirtualBox", "ansible_board_serial": "NA", "ansible_board_vendor": "Oracle Corporation", "ansible_board_version": "1.2", "ansible_chassis_asset_tag": "NA", "ansible_chassis_serial": "NA", "ansible_chassis_vendor": "Oracle Corporation", "ansible_chassis_version": "NA", "ansible_form_factor": "Other", "ansible_product_name": "VirtualBox", "ansible_product_serial": "NA", "ansible_product_uuid": "NA", "ansible_product_version": "1.2", "ansible_system_vendor": "innotek GmbH", "ansible_devices": {"dm-1": {"virtual": 1, "links": {"ids": ["dm-name-rhel_rhel8-swap", "dm-uuid-LVM-zC6A0QsBDrGwKwxZtr1rcyTIPcBHeh3GT17wXnKVT0iabIr6cIdgtij0sxe1yQl9"], "uuids": ["7e5dc044-a7d1-4384-8a2e-e5d829e31945"], "labels": [], "masters": []}, "vendor": null, "model": null, "sas_address": null, "sas_device_handle": null, "removable": "0", "support_discard": "0", "partitions": {}, "rotational": "1", "scheduler_mode": "", "sectors": "4317184", "sectorsize": "512", "size": "2.06 GB", "host": "", "holders": []}, "dm-0": {"virtual": 1, "links": {"ids": ["dm-name-rhel_rhel8-root", "dm-uuid-LVM-zC6A0QsBDrGwKwxZtr1rcyTIPcBHeh3Grwodyj91WNUBFX1nPY4UW5GbWxigVvff"], "uuids": ["a3dfbd25-503a-413a-a281-45cfaad69feb"], "labels": [], "masters": []}, "vendor": null, "model": null, "sas_address": null, "sas_device_handle": null, "removable": "0", "support_discard": "0", "partitions": {}, "rotational": "1", "scheduler_mode": "", "sectors": "146800640", "sectorsize": "512", "size": "70.00 GB", "host": "", "holders": []}, "sda": {"virtual": 1, "links": {"ids": ["ata-VBOX_HARDDISK_VBcff81b56-ec300eaa", "scsi-0ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa", "scsi-1ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa", "scsi-SATA_VBOX_HARDDISK_VBcff81b56-ec300eaa"], "uuids": [], "labels": [], "masters": []}, "vendor": "ATA", "model": "VBOX HARDDISK", "sas_address": null, "sas_device_handle": null, "removable": "0", "support_discard": "0", "partitions": {"sda2": {"links": {"ids": ["ata-VBOX_HARDDISK_VBcff81b56-ec300eaa-part2", "lvm-pv-uuid-g7SkxV-RYrT-JL47-mMcA-qBOB-Zjjk-mdaQSN", "scsi-0ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part2", "scsi-1ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part2", "scsi-SATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part2"], "uuids": [], "labels": [], "masters": ["dm-0", "dm-1"]}, "start": "2099200", "sectors": "266336256", "sectorsize": 512, "size": "127.00 GB", "uuid": null, "holders": ["rhel_rhel8-swap", "rhel_rhel8-root"]}, "sda1": {"links": {"ids": ["ata-VBOX_HARDDISK_VBcff81b56-ec300eaa-part1", "scsi-0ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part1", "scsi-1ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part1", "scsi-SATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part1"], "uuids": ["ae6c1777-c1c9-42a1-8fcf-513077aac39b"], "labels": [], "masters": []}, "start": "2048", "sectors": "2097152", "sectorsize": 512, "size": "1.00 GB", "uuid": "ae6c1777-c1c9-42a1-8fcf-513077aac39b", "holders": []}}, "rotational": "1", "scheduler_mode": "mq-deadline", "sectors": "268435456", "sectorsize": "512", "size": "128.00 GB", "host": "IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)", "holders": []}}, "ansible_device_links": {"ids": {"sda1": ["ata-VBOX_HARDDISK_VBcff81b56-ec300eaa-part1", "scsi-0ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part1", "scsi-1ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part1", "scsi-SATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part1"], "sda2": ["ata-VBOX_HARDDISK_VBcff81b56-ec300eaa-part2", "lvm-pv-uuid-g7SkxV-RYrT-JL47-mMcA-qBOB-Zjjk-mdaQSN", "scsi-0ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part2", "scsi-1ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part2", "scsi-SATA_VBOX_HARDDISK_VBcff81b56-ec300eaa-part2"], "sda": ["ata-VBOX_HARDDISK_VBcff81b56-ec300eaa", "scsi-0ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa", "scsi-1ATA_VBOX_HARDDISK_VBcff81b56-ec300eaa", "scsi-SATA_VBOX_HARDDISK_VBcff81b56-ec300eaa"], "dm-1": ["dm-name-rhel_rhel8-swap", "dm-uuid-LVM-zC6A0QsBDrGwKwxZtr1rcyTIPcBHeh3GT17wXnKVT0iabIr6cIdgtij0sxe1yQl9"], "dm-0": ["dm-name-rhel_rhel8-root", "dm-uuid-LVM-zC6A0QsBDrGwKwxZtr1rcyTIPcBHeh3Grwodyj91WNUBFX1nPY4UW5GbWxigVvff"]}, "uuids": {"dm-1": ["7e5dc044-a7d1-4384-8a2e-e5d829e31945"], "dm-0": ["a3dfbd25-503a-413a-a281-45cfaad69feb"], "sda1": ["ae6c1777-c1c9-42a1-8fcf-513077aac39b"]}, "labels": {}, "masters": {"sda2": ["dm-0", "dm-1"]}}, "ansible_uptime_seconds": 15365, "ansible_mounts": [{"mount": "/", "device": "/dev/mapper/rhel_rhel8-root", "fstype": "xfs", "options": "rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota", "size_total": 75125227520, "size_available": 71803695104, "block_size": 4096, "block_total": 18341120, "block_available": 17530199, "block_used": 810921, "inode_total": 36700160, "inode_available": 36624744, "inode_used": 75416, "uuid": "a3dfbd25-503a-413a-a281-45cfaad69feb"}, {"mount": "/boot", "device": "/dev/sda1", "fstype": "xfs", "options": "rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota", "size_total": 1063256064, "size_available": 863862784, "block_size": 4096, "block_total": 259584, "block_available": 210904, "block_used": 48680, "inode_total": 524288, "inode_available": 523979, "inode_used": 309, "uuid": "ae6c1777-c1c9-42a1-8fcf-513077aac39b"}], "ansible_local": {}, "ansible_hostnqn": "", "ansible_fibre_channel_wwn": [], "ansible_lsb": {}, "ansible_service_mgr": "systemd", "ansible_interfaces": ["eth1", "lo", "eth0"], "ansible_eth0": {"device": "eth0", "macaddress": "08:00:27:dc:e4:34", "mtu": 1500, "active": true, "module": "e1000", "type": "ether", "pciid": "0000:00:03.0", "speed": 1000, "promisc": false, "ipv4": {"address": "10.0.2.15", "broadcast": "10.0.2.255", "netmask": "255.255.255.0", "network": "10.0.2.0"}, "features": {"rx_checksumming": "off", "tx_checksumming": "on", "tx_checksum_ipv4": "off [fixed]", "tx_checksum_ip_generic": "on", "tx_checksum_ipv6": "off [fixed]", "tx_checksum_fcoe_crc": "off [fixed]", "tx_checksum_sctp": "off [fixed]", "scatter_gather": "on", "tx_scatter_gather": "on", "tx_scatter_gather_fraglist": "off [fixed]", "tcp_segmentation_offload": "on", "tx_tcp_segmentation": "on", "tx_tcp_ecn_segmentation": "off [fixed]", "tx_tcp_mangleid_segmentation": "off", "tx_tcp6_segmentation": "off [fixed]", "generic_segmentation_offload": "on", "generic_receive_offload": "on", "large_receive_offload": "off [fixed]", "rx_vlan_offload": "on", "tx_vlan_offload": "on [fixed]", "ntuple_filters": "off [fixed]", "receive_hashing": "off [fixed]", "highdma": "off [fixed]", "rx_vlan_filter": "on [fixed]", "vlan_challenged": "off [fixed]", "tx_lockless": "off [fixed]", "netns_local": "off [fixed]", "tx_gso_robust": "off [fixed]", "tx_fcoe_segmentation": "off [fixed]", "tx_gre_segmentation": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_ipxip4_segmentation": "off [fixed]", "tx_ipxip6_segmentation": "off [fixed]", "tx_udp_tnl_segmentation": "off [fixed]", "tx_udp_tnl_csum_segmentation": "off [fixed]", "tx_gso_partial": "off [fixed]", "tx_tunnel_remcsum_segmentation": "off [fixed]", "tx_sctp_segmentation": "off [fixed]", "tx_esp_segmentation": "off [fixed]", "tx_udp_segmentation": "off [fixed]", "tx_gso_list": "off [fixed]", "rx_gro_list": "off", "tls_hw_rx_offload": "off [fixed]", "fcoe_mtu": "off [fixed]", "tx_nocache_copy": "off", "loopback": "off [fixed]", "rx_fcs": "off", "rx_all": "off", "tx_vlan_stag_hw_insert": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "rx_vlan_stag_filter": "off [fixed]", "l2_fwd_offload": "off [fixed]", "hw_tc_offload": "off [fixed]", "esp_hw_offload": "off [fixed]", "esp_tx_csum_hw_offload": "off [fixed]", "rx_udp_tunnel_port_offload": "off [fixed]", "tls_hw_tx_offload": "off [fixed]", "rx_gro_hw": "off [fixed]", "tls_hw_record": "off [fixed]"}, "timestamping": [], "hw_timestamp_filters": []}, "ansible_eth1": {"device": "eth1", "macaddress": "08:00:27:85:5a:fe", "mtu": 1500, "active": true, "module": "e1000", "type": "ether", "pciid": "0000:00:08.0", "speed": 1000, "promisc": false, "ipv4": {"address": "192.168.0.190", "broadcast": "192.168.0.255", "netmask": "255.255.255.0", "network": "192.168.0.0"}, "ipv6": [{"address": "fe80::a00:27ff:fe85:5afe", "prefix": "64", "scope": "link"}], "features": {"rx_checksumming": "off", "tx_checksumming": "on", "tx_checksum_ipv4": "off [fixed]", "tx_checksum_ip_generic": "on", "tx_checksum_ipv6": "off [fixed]", "tx_checksum_fcoe_crc": "off [fixed]", "tx_checksum_sctp": "off [fixed]", "scatter_gather": "on", "tx_scatter_gather": "on", "tx_scatter_gather_fraglist": "off [fixed]", "tcp_segmentation_offload": "on", "tx_tcp_segmentation": "on", "tx_tcp_ecn_segmentation": "off [fixed]", "tx_tcp_mangleid_segmentation": "off", "tx_tcp6_segmentation": "off [fixed]", "generic_segmentation_offload": "on", "generic_receive_offload": "on", "large_receive_offload": "off [fixed]", "rx_vlan_offload": "on", "tx_vlan_offload": "on [fixed]", "ntuple_filters": "off [fixed]", "receive_hashing": "off [fixed]", "highdma": "off [fixed]", "rx_vlan_filter": "on [fixed]", "vlan_challenged": "off [fixed]", "tx_lockless": "off [fixed]", "netns_local": "off [fixed]", "tx_gso_robust": "off [fixed]", "tx_fcoe_segmentation": "off [fixed]", "tx_gre_segmentation": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_ipxip4_segmentation": "off [fixed]", "tx_ipxip6_segmentation": "off [fixed]", "tx_udp_tnl_segmentation": "off [fixed]", "tx_udp_tnl_csum_segmentation": "off [fixed]", "tx_gso_partial": "off [fixed]", "tx_tunnel_remcsum_segmentation": "off [fixed]", "tx_sctp_segmentation": "off [fixed]", "tx_esp_segmentation": "off [fixed]", "tx_udp_segmentation": "off [fixed]", "tx_gso_list": "off [fixed]", "rx_gro_list": "off", "tls_hw_rx_offload": "off [fixed]", "fcoe_mtu": "off [fixed]", "tx_nocache_copy": "off", "loopback": "off [fixed]", "rx_fcs": "off", "rx_all": "off", "tx_vlan_stag_hw_insert": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "rx_vlan_stag_filter": "off [fixed]", "l2_fwd_offload": "off [fixed]", "hw_tc_offload": "off [fixed]", "esp_hw_offload": "off [fixed]", "esp_tx_csum_hw_offload": "off [fixed]", "rx_udp_tunnel_port_offload": "off [fixed]", "tls_hw_tx_offload": "off [fixed]", "rx_gro_hw": "off [fixed]", "tls_hw_record": "off [fixed]"}, "timestamping": [], "hw_timestamp_filters": []}, "ansible_lo": {"device": "lo", "mtu": 65536, "active": true, "type": "loopback", "promisc": false, "ipv4": {"address": "127.0.0.1", "broadcast": "", "netmask": "255.0.0.0", "network": "127.0.0.0"}, "features": {"rx_checksumming": "on [fixed]", "tx_checksumming": "on", "tx_checksum_ipv4": "off [fixed]", "tx_checksum_ip_generic": "on [fixed]", "tx_checksum_ipv6": "off [fixed]", "tx_checksum_fcoe_crc": "off [fixed]", "tx_checksum_sctp": "on [fixed]", "scatter_gather": "on", "tx_scatter_gather": "on [fixed]", "tx_scatter_gather_fraglist": "on [fixed]", "tcp_segmentation_offload": "on", "tx_tcp_segmentation": "on", "tx_tcp_ecn_segmentation": "on", "tx_tcp_mangleid_segmentation": "on", "tx_tcp6_segmentation": "on", "generic_segmentation_offload": "on", "generic_receive_offload": "on", "large_receive_offload": "off [fixed]", "rx_vlan_offload": "off [fixed]", "tx_vlan_offload": "off [fixed]", "ntuple_filters": "off [fixed]", "receive_hashing": "off [fixed]", "highdma": "on [fixed]", "rx_vlan_filter": "off [fixed]", "vlan_challenged": "on [fixed]", "tx_lockless": "on [fixed]", "netns_local": "on [fixed]", "tx_gso_robust": "off [fixed]", "tx_fcoe_segmentation": "off [fixed]", "tx_gre_segmentation": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_ipxip4_segmentation": "off [fixed]", "tx_ipxip6_segmentation": "off [fixed]", "tx_udp_tnl_segmentation": "off [fixed]", "tx_udp_tnl_csum_segmentation": "off [fixed]", "tx_gso_partial": "off [fixed]", "tx_tunnel_remcsum_segmentation": "off [fixed]", "tx_sctp_segmentation": "on", "tx_esp_segmentation": "off [fixed]", "tx_udp_segmentation": "off [fixed]", "tx_gso_list": "off [fixed]", "rx_gro_list": "off", "tls_hw_rx_offload": "off [fixed]", "fcoe_mtu": "off [fixed]", "tx_nocache_copy": "off [fixed]", "loopback": "on [fixed]", "rx_fcs": "off [fixed]", "rx_all": "off [fixed]", "tx_vlan_stag_hw_insert": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "rx_vlan_stag_filter": "off [fixed]", "l2_fwd_offload": "off [fixed]", "hw_tc_offload": "off [fixed]", "esp_hw_offload": "off [fixed]", "esp_tx_csum_hw_offload": "off [fixed]", "rx_udp_tunnel_port_offload": "off [fixed]", "tls_hw_tx_offload": "off [fixed]", "rx_gro_hw": "off [fixed]", "tls_hw_record": "off [fixed]"}, "timestamping": [], "hw_timestamp_filters": []}, "ansible_default_ipv4": {"gateway": "10.0.2.2", "interface": "eth0", "address": "10.0.2.15", "broadcast": "10.0.2.255", "netmask": "255.255.255.0", "network": "10.0.2.0", "macaddress": "08:00:27:dc:e4:34", "mtu": 1500, "type": "ether", "alias": "eth0"}, "ansible_default_ipv6": {}, "ansible_all_ipv4_addresses": ["10.0.2.15", "192.168.0.190"], "ansible_all_ipv6_addresses": ["fe80::a00:27ff:fe85:5afe"], "ansible_fips": false, "ansible_apparmor": {"status": "disabled"}, "ansible_env": {"LS_COLORS": "rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:", "SSH_CONNECTION": "192.168.0.105 56448 192.168.0.190 22", "_": "/usr/libexec/platform-python", "LANG": "en_US.UTF-8", "S_COLORS": "auto", "XDG_SESSION_ID": "9", "USER": "devops", "SELINUX_ROLE_REQUESTED": "", "PWD": "/home/devops", "HOME": "/home/devops", "LC_CTYPE": "C.UTF-8", "SSH_CLIENT": "192.168.0.105 56448 22", "SELINUX_LEVEL_REQUESTED": "", "SSH_TTY": "/dev/pts/0", "SHELL": "/bin/bash", "TERM": "xterm-256color", "SELINUX_USE_CURRENT_RANGE": "", "SHLVL": "2", "LOGNAME": "devops", "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1001/bus", "XDG_RUNTIME_DIR": "/run/user/1001", "PATH": "/home/devops/.local/bin:/home/devops/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin", "HISTSIZE": "100000", "LESSOPEN": "||/usr/bin/lesspipe.sh %s"}, "ansible_pkg_mgr": "dnf", "gather_subset": ["all"], "module_setup": true}, "invocation": {"module_args": {"gather_subset": ["all"], "gather_timeout": 10, "filter": [], "fact_path": "/etc/ansible/facts.d"}}}\r\n', b'Shared connection to 192.168.0.190 closed.\r\n')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'rm -f -r /home/devops/.ansible/tmp/ansible-tmp-1637075611.201921-7700-238727032540101/ > /dev/null 2>&1 && sleep 0'"'"''
<192.168.0.190> (0, b'', b'')
ok: [demo.example.com]
META: ran handlers
TASK [Creating a symlink] ******************************************************
task path: /Users/lberton/prj/github/ansible-pilot/troubleshooting/invalidargument_error.yml:8
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'echo ~devops && sleep 0'"'"''
<192.168.0.190> (0, b'/home/devops\n', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/devops/.ansible/tmp `"&& mkdir "` echo /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000 `" && echo ansible-tmp-1637075612.284926-7710-266273776232000="` echo /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000 `" ) && sleep 0'"'"''
<192.168.0.190> (0, b'ansible-tmp-1637075612.284926-7710-266273776232000=/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000\n', b'')
Using module file /usr/local/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible/modules/file.py
<192.168.0.190> PUT /Users/lberton/.ansible/tmp/ansible-local-7697iluh4khz/tmp6r_9w7_f TO /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py
<192.168.0.190> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 '[192.168.0.190]'
<192.168.0.190> (0, b'sftp> put /Users/lberton/.ansible/tmp/ansible-local-7697iluh4khz/tmp6r_9w7_f /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py\n', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'chmod u+x /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/ /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py && sleep 0'"'"''
<192.168.0.190> (0, b'', b'')
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 -tt 192.168.0.190 '/bin/sh -c '"'"'/usr/libexec/platform-python /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py && sleep 0'"'"''
<192.168.0.190> (1, b'Traceback (most recent call last):\r\n  File "/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py", line 100, in <module>\r\n    _ansiballz_main()\r\n  File "/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py", line 92, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File "/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py", line 41, in invoke_module\r\n    run_name=\'__main__\', alter_sys=True)\r\n  File "/usr/lib64/python3.6/runpy.py", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File "/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py", line 966, in <module>\r\n  File "/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py", line 954, in main\r\n  File "/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py", line 688, in ensure_symlink\r\nOSError: [Errno 22] Invalid argument: b\'/proc/cpuinfo\'\r\n', b'Shared connection to 192.168.0.190 closed.\r\n')
<192.168.0.190> Failed to connect to the host via ssh: Shared connection to 192.168.0.190 closed.
<192.168.0.190> ESTABLISH SSH CONNECTION FOR USER: devops
<192.168.0.190> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/Users/lberton/prj/github/ansible-pilot/demo/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="devops"' -o ConnectTimeout=10 -o ControlPath=/Users/lberton/.ansible/cp/bf202c4314 192.168.0.190 '/bin/sh -c '"'"'rm -f -r /home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/ > /dev/null 2>&1 && sleep 0'"'"''
<192.168.0.190> (0, b'', b'')
The full traceback is:
Traceback (most recent call last):
  File "/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py", line 100, in <module>
    _ansiballz_main()
  File "/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py", line 92, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py", line 41, in invoke_module
    run_name='__main__', alter_sys=True)
  File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py", line 966, in <module>
  File "/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py", line 954, in main
  File "/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py", line 688, in ensure_symlink
OSError: [Errno 22] Invalid argument: b'/proc/cpuinfo'
fatal: [demo.example.com]: FAILED! => {
    "changed": false,
    "module_stderr": "Shared connection to 192.168.0.190 closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py\", line 100, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py\", line 92, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/devops/.ansible/tmp/ansible-tmp-1637075612.284926-7710-266273776232000/AnsiballZ_file.py\", line 41, in invoke_module\r\n    run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 966, in <module>\r\n  File \"/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 954, in main\r\n  File \"/tmp/ansible_ansible.builtin.file_payload_gvofg1m0/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 688, in ensure_symlink\r\nOSError: [Errno 22] Invalid argument: b'/proc/cpuinfo'\r\n",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
PLAY RECAP *********************************************************************
demo.example.com           : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

fix code

---
- name: file module demo
  hosts: all
  vars:
    mylink: "~/example"
    mysrc: "/proc/cpuinfo"
  tasks:
    - name: Creating a symlink
      ansible.builtin.file:
        src: "{{ mysrc }}"
        dest: "{{ mylink }}"
        state: link

fix execution


$ ansible-playbook -i virtualmachines/demo/inventory troubleshooting/invalidargument_fix.yml
PLAY [file module demo] ***************************************************************************
TASK [Gathering Facts] ****************************************************************************
ok: [demo.example.com]
TASK [Creating a symlink] *************************************************************************
ok: [demo.example.com]
PLAY RECAP ****************************************************************************************
demo.example.com           : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

code with ❤️ in GitHub

Recap

Now you know how to reproduce, troubleshoot and fix the invalid argument module fatal error. Subscribe to the YouTube channel, Medium, Website, Twitter, and Substack to not miss the next episode of the Ansible Pilot.

Academy

Learn the Ansible automation technology with some real-life examples in my

My book Ansible By Examples: 200+ Automation Examples For Linux and Windows System Administrator and DevOps

BUY the Complete PDF BOOK to easily Copy and Paste the 200+ Ansible code

Want to keep this project going? Please donate

Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons
Trustpilot
Follow me

Subscribe not to miss any new releases

FREE Top 10 Best Practices

Top 10 Best Practices of Ansible Automation: save time, reduce errors and stress