k8s module error: 'NoneType' object has no attribute 'endswith'\n"

Team,

I have simple test and its failing with below when using k8s module.

task/main.yaml

  • name: “Validate k8s version KUBECTL”

shell: “kubectl version --short”

register: k8s_version

failed_when: k8s_version.rc == 1

  • debug:

var: k8s_version.stdout

  • name: “Validate k8s Versions Client & Server: K8s Module”

k8s:

validate:

verify_ssl: no

output

changed: [localhost]

TASK [2_k8s_validations : debug] ***********************************************************************************************************************************

ok: [localhost] => {

“k8s_version.stdout”: “Client Version: v1.10.1\nServer Version: v1.13.5”

}

TASK [2_k8s_validations : Validate k8s Versions Client & Server: K8s Module] ***************************************************************************************

fatal: [localhost]: FAILED! => {“changed”: false, “module_stderr”: “/Users/amohmad/.ansible/tmp/ansible-tmp-1571351337.4579258-273170310360257/AnsiballZ_k8s.py:18: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses\n import imp\nTraceback (most recent call last):\n File "/Users/amohmad/.ansible/tmp/ansible-tmp-1571351337.4579258-273170310360257/AnsiballZ_k8s.py", line 114, in \n _ansiballz_main()\n File "/Users/amohmad/.ansible/tmp/ansible-tmp-1571351337.4579258-273170310360257/AnsiballZ_k8s.py", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/Users/amohmad/.ansible/tmp/ansible-tmp-1571351337.4579258-273170310360257/AnsiballZ_k8s.py", line 49, in invoke_module\n imp.load_module(‘main’, mod, module, MOD_DESC)\n File "/usr/local/Cellar/ansible/2.8.5/libexec/lib/python3.7/imp.py", line 234, in load_module\n return load_source(name, filename, file)\n File "/usr/local/Cellar/ansible/2.8.5/libexec/lib/python3.7/imp.py", line 169, in load_source\n module = _exec(spec, sys.modules[name])\n File "", line 630, in _exec\n File "", line 728, in exec_module\n File "", line 219, in _call_with_frames_removed\n File "/var/folders/qq/t_5mbv151fxfq9_vdgyvcvg8yz98pj/T/ansible_k8s_payload_yo7cq9fu/main.py", line 258, in \n File "/var/folders/qq/t_5mbv151fxfq9_vdgyvcvg8yz98pj/T/ansible_k8s_payload_yo7cq9fu/main.py", line 254, in main\n File "/var/folders/qq/t_5mbv151fxfq9_vdgyvcvg8yz98pj/T/ansible_k8s_payload_yo7cq9fu/ansible_k8s_payload.zip/ansible/module_utils/k8s/raw.py", line 160, in execute_module\nAttributeError: ‘NoneType’ object has no attribute ‘endswith’\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}

PLAY RECAP *********************************************************************************************************************************************************

localhost