Community.okd.k8s and kubernetes.core.k8s hang/get stuck indefinitely

Hi,

I’m trying to use ansible to interact with OKD (OpenShift upstream project) cluster. I have ansible installed within a virtual environment (python 3.8.10). Ansible version is:
ansible --version
ansible [core 2.13.10]

Listing collections with ansible-galaxy collection list, I see the following versions for community.okd.k8s and kubernetes.core.k8s:

~/.ansible/collections/ansible_collections
Collection Version
community.okd 3.0.1
kubernetes.core 3.0.1
~/.venv/lib/python3.8/site-packages/ansible_collections
Collection Version
community.okd 2.2.0
kubernetes.core 2.3.2

I can use community.okd.openshift_auth to login but when it comes to using community.okd.k8s, the playbook gets stuck indefinitely.

Using community.okd.k8s

Example playbook that I’m trying to run:

- name: Setting up OKD
  become: true
  become_user: root
  hosts: localhost
  tasks:
    - name: Login to OKD # not using this as it requires setting either the "environment" or "api_key" for each OKD tasks after login 
      community.okd.k8s_auth:
        host: https://api.aspmokd01.all.space:6443
        password: "{{ okd_admin_password }}"
        username: "{{ okd_admin_user }}"
        validate_certs: false
      register: okd_auth
      environment:
        K8S_AUTH_API_KEY: okd_auth.openshift_auth

    - name: Create a k8s namespace
      community.okd.k8s:
        api_key: okd_auth.openshift_auth
        name: testing
        api_version: v1
        kind: Namespace
        state: present

Below is how I’m trying to run it and the output for the community.okd.k8s task.
ansible-playbook --ask-vault-pass -i ansible/inventory.yml ansible/playbooks/okd_deploy.yml -vvvvv

Output (full output is lengthy so only showing select bits and full output for the community.okd.k8s task:

[WARNING]: Collection community.okd does not support Ansible version 2.13.10
[WARNING]: Collection kubernetes.core does not support Ansible version 2.13.10
TASK [Create a k8s namespace] **************************************************************************************************************************************************************************************************
task path: /home/user1/ansible_project/ansible/playbooks/okd_deploy.yml:16
redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info
redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: user1
<localhost> EXEC /bin/sh -c 'echo ~user1 && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user1/.ansible/tmp `"&& mkdir "` echo /home/user1/.ansible/tmp/ansible-tmp-1712586762.9948385-29764-140730930417156 `" && echo ansible-tmp-1712586762.9948385-29764-140730930417156="` echo /home/user1/.ansible/tmp/ansible-tmp-1712586762.9948385-29764-140730930417156 `" ) && sleep 0'
Including module_utils file ansible/__init__.py
Including module_utils file ansible/module_utils/__init__.py
Including module_utils file ansible/module_utils/basic.py
Including module_utils file ansible/module_utils/_text.py
Including module_utils file ansible/module_utils/common/_collections_compat.py
Including module_utils file ansible/module_utils/common/__init__.py
Including module_utils file ansible/module_utils/common/_json_compat.py
Including module_utils file ansible/module_utils/common/_utils.py
Including module_utils file ansible/module_utils/common/arg_spec.py
Including module_utils file ansible/module_utils/common/file.py
Including module_utils file ansible/module_utils/common/locale.py
Including module_utils file ansible/module_utils/common/parameters.py
Including module_utils file ansible/module_utils/common/collections.py
Including module_utils file ansible/module_utils/common/process.py
Including module_utils file ansible/module_utils/common/sys_info.py
Including module_utils file ansible/module_utils/common/text/converters.py
Including module_utils file ansible/module_utils/common/text/__init__.py
Including module_utils file ansible/module_utils/common/text/formatters.py
Including module_utils file ansible/module_utils/common/validation.py
Including module_utils file ansible/module_utils/common/warnings.py
Including module_utils file ansible/module_utils/compat/selectors.py
Including module_utils file ansible/module_utils/compat/__init__.py
Including module_utils file ansible/module_utils/compat/_selectors2.py
Including module_utils file ansible/module_utils/compat/selinux.py
Including module_utils file ansible/module_utils/distro/__init__.py
Including module_utils file ansible/module_utils/distro/_distro.py
Including module_utils file ansible/module_utils/errors.py
Including module_utils file ansible/module_utils/parsing/convert_bool.py
Including module_utils file ansible/module_utils/parsing/__init__.py
Including module_utils file ansible/module_utils/pycompat24.py
Including module_utils file ansible/module_utils/six/__init__.py
Including module_utils file ansible_collections/community/okd/plugins/module_utils/k8s.py
Including module_utils file ansible_collections/__init__.py
Including module_utils file ansible_collections/community/__init__.py
Including module_utils file ansible_collections/community/okd/__init__.py
Including module_utils file ansible_collections/community/okd/plugins/__init__.py
Including module_utils file ansible_collections/community/okd/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/community/okd/plugins/module_utils/openshift_common.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/args_common.py
Including module_utils file ansible_collections/kubernetes/__init__.py
Including module_utils file ansible_collections/kubernetes/core/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/client.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/client/discovery.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/client/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/client/resource.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/core.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/exceptions.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/resource.py
Including module_utils file ansible/module_utils/urls.py
Including module_utils file ansible/module_utils/compat/typing.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/runner.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/service.py
Including module_utils file ansible/module_utils/common/dict_transformations.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/apply.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/common.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/exceptions.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/hashes.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/waiter.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8sdynamicclient.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/selector.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/version.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/_version.py
Using module file /home/user1/.ansible/collections/ansible_collections/community/okd/plugins/modules/k8s.py
<localhost> PUT /home/user1/.ansible/tmp/ansible-local-295419_8a9imt/tmp278xio2s TO /home/user1/.ansible/tmp/ansible-tmp-1712586762.9948385-29764-140730930417156/AnsiballZ_k8s.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/user1/.ansible/tmp/ansible-tmp-1712586762.9948385-29764-140730930417156/ /home/user1/.ansible/tmp/ansible-tmp-1712586762.9948385-29764-140730930417156/AnsiballZ_k8s.py && sleep 0'
<localhost> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-jboicwidygywbifurduwsuvajbcobivp ; /usr/bin/python3 /home/user1/.ansible/tmp/ansible-tmp-1712586762.9948385-29764-140730930417156/AnsiballZ_k8s.py'"'"' && sleep 0'

At the end of this output is when the playbook hangs. In the above output, I suspect the WARNINGS are a clue as to what’s wrong? Furthermore, the line,

redirecting (type: action) community.okd.k8s to kubernetes.core.k8s_info

shows that kubernetes.core.k8s_info is being used in the background instead. Is that a clue?

Using kubernetes.core.k8s

In the above playbook, replacing community.okd.k8s with kubernetes.core.k8s, I get the following output for that task:

TASK [Create a k8s namespace] **************************************************************************************************************************************************************************************************
task path: /home/user1/ansible_project/ansible/playbooks/okd_deploy.yml:16
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: user1
<localhost> EXEC /bin/sh -c 'echo ~user1 && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user1/.ansible/tmp `"&& mkdir "` echo /home/user1/.ansible/tmp/ansible-tmp-1712587473.9163046-30288-168059330956874 `" && echo ansible-tmp-1712587473.9163046-30288-168059330956874="` echo /home/user1/.ansible/tmp/ansible-tmp-1712587473.9163046-30288-168059330956874 `" ) && sleep 0'
Loading collection cloud.common from /home/user1/.ansible/collections/ansible_collections/cloud/common
[WARNING]: Collection cloud.common does not support Ansible version 2.13.10
Including module_utils file ansible/__init__.py
Including module_utils file ansible/module_utils/__init__.py
Including module_utils file ansible/module_utils/basic.py
Including module_utils file ansible/module_utils/_text.py
Including module_utils file ansible/module_utils/common/_collections_compat.py
Including module_utils file ansible/module_utils/common/__init__.py
Including module_utils file ansible/module_utils/common/_json_compat.py
Including module_utils file ansible/module_utils/common/_utils.py
Including module_utils file ansible/module_utils/common/arg_spec.py
Including module_utils file ansible/module_utils/common/file.py
Including module_utils file ansible/module_utils/common/locale.py
Including module_utils file ansible/module_utils/common/parameters.py
Including module_utils file ansible/module_utils/common/collections.py
Including module_utils file ansible/module_utils/common/process.py
Including module_utils file ansible/module_utils/common/sys_info.py
Including module_utils file ansible/module_utils/common/text/converters.py
Including module_utils file ansible/module_utils/common/text/__init__.py
Including module_utils file ansible/module_utils/common/text/formatters.py
Including module_utils file ansible/module_utils/common/validation.py
Including module_utils file ansible/module_utils/common/warnings.py
Including module_utils file ansible/module_utils/compat/selectors.py
Including module_utils file ansible/module_utils/compat/__init__.py
Including module_utils file ansible/module_utils/compat/_selectors2.py
Including module_utils file ansible/module_utils/compat/selinux.py
Including module_utils file ansible/module_utils/distro/__init__.py
Including module_utils file ansible/module_utils/distro/_distro.py
Including module_utils file ansible/module_utils/errors.py
Including module_utils file ansible/module_utils/parsing/convert_bool.py
Including module_utils file ansible/module_utils/parsing/__init__.py
Including module_utils file ansible/module_utils/pycompat24.py
Including module_utils file ansible/module_utils/six/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/ansiblemodule.py
Including module_utils file ansible_collections/__init__.py
Including module_utils file ansible_collections/cloud/common/plugins/module_utils/turbo/module.py
Including module_utils file ansible_collections/cloud/__init__.py
Including module_utils file ansible_collections/cloud/common/__init__.py
Including module_utils file ansible_collections/cloud/common/plugins/__init__.py
Including module_utils file ansible_collections/cloud/common/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/cloud/common/plugins/module_utils/turbo/__init__.py
Including module_utils file ansible_collections/cloud/common/plugins/module_utils/turbo/common.py
Including module_utils file ansible_collections/cloud/common/plugins/module_utils/turbo/exceptions.py
Including module_utils file ansible_collections/cloud/common/plugins/module_utils/turbo/server.py
Including module_utils file ansible_collections/kubernetes/__init__.py
Including module_utils file ansible_collections/kubernetes/core/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/args_common.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/core.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/exceptions.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/runner.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/client.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/client/discovery.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/client/__init__.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/client/resource.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/resource.py
Including module_utils file ansible/module_utils/urls.py
Including module_utils file ansible/module_utils/compat/typing.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/service.py
Including module_utils file ansible/module_utils/common/dict_transformations.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/apply.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/common.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/exceptions.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/hashes.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8s/waiter.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/k8sdynamicclient.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/selector.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/version.py
Including module_utils file ansible_collections/kubernetes/core/plugins/module_utils/_version.py
Using module file /home/user1/.ansible/collections/ansible_collections/kubernetes/core/plugins/modules/k8s.py
<localhost> PUT /home/user1/.ansible/tmp/ansible-local-30070o6x3avdo/tmp1ljrlm_y TO /home/user1/.ansible/tmp/ansible-tmp-1712587473.9163046-30288-168059330956874/AnsiballZ_k8s.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/user1/.ansible/tmp/ansible-tmp-1712587473.9163046-30288-168059330956874/ /home/user1/.ansible/tmp/ansible-tmp-1712587473.9163046-30288-168059330956874/AnsiballZ_k8s.py && sleep 0'
<localhost> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-uooxpivyspevqswieidyovsyorucsaws ; /usr/bin/python3 /home/user1/.ansible/tmp/ansible-tmp-1712587473.9163046-30288-168059330956874/AnsiballZ_k8s.py'"'"' && sleep 0'

I’ve tried removing common module’s directory as well but no luck. I’m not sure what further information I can provide but please feel free to let me know if any. Really appreciate any help.

Thanks,

Can you try with a newer version of Ansible?

2 Likes

Hi,

Thanks for reply. I’m on the latest version available now and unfortunately the issue is persistent.

[WARNING]: Collection community.okd does not support Ansible version 2.13.13
[WARNING]: Collection kubernetes.core does not support Ansible version 2.13.13

I expect you have more than one version of Ansible installed and you are still using the old version, what does the following return?

which -a ansible

Then check the version for each version returned, eg:

/usr/bin/ansible --version

If you have installed ansible in a virtual environment then you might need to add that directory to your $PATH.

I’d suggest using pipx to install ansible as it creates the venv for you, however you also probably need to add additional libraries into the venv it creates.

which -a ansible output:

/home/user1/ansible_project/.venv/bin/ansible
/home/user1/.local/bin/ansible

/home/user1/ansible_project/.venv/bin/ansible --version output:

ansible [core 2.13.13]
  config file = None
  configured module search path = ['/home/user1/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user1/ansible_project/.venv/lib/python3.8/site-packages/ansible
  ansible collection location = /home/user1/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user1/ansible_project/.venv/bin/ansible
  python version = 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

/home/user1/.local/bin/ansible --version output:

ansible [core 2.13.6]
  config file = None
  configured module search path = ['/home/user1/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user1/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/user1/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user1/.local/bin/ansible
  python version = 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

I certainly have two versions of ansible installed but I’m using ansible2.13.13 within a virtual environment so doubt that the other version is being used.

I checked and the virtual environment directory is already in $PATH. I’d give pipx a try.

I reinstalled community.okd and kubernetes.core and on the first run, I got the following error:

{
  "changed": false,
  "module_stderr": "/usr/lib/python3/dist-packages/kubernetes/config/kube_config.py:434: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.\n  config_dict=yaml.load(f),\nTraceback (most recent call last):\n  File \"/home/user1/.ansible/tmp/ansible-tmp-1712652899.1646488-422-100298754495323/AnsiballZ_k8s.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/user1/.ansible/tmp/ansible-tmp-1712652899.1646488-422-100298754495323/AnsiballZ_k8s.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/user1/.ansible/tmp/ansible-tmp-1712652899.1646488-422-100298754495323/AnsiballZ_k8s.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.okd.plugins.modules.k8s', init_globals=dict(_module_fqn='ansible_collections.community.okd.plugins.modules.k8s', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/community/okd/plugins/modules/k8s.py\", line 323, in <module>\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/community/okd/plugins/modules/k8s.py\", line 314, in main\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/community/okd/plugins/module_utils/k8s.py\", line 44, in __init__\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/community/okd/plugins/module_utils/openshift_common.py\", line 49, in __init__\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/client.py\", line 352, in get_api_client\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/client.py\", line 246, in wrapper\n  File \"/tmp/ansible_community.okd.k8s_payload_j5r7uimp/ansible_community.okd.k8s_payload.zip/ansible_collections/kubernetes/core/plugins/module_utils/k8s/client.py\", line 259, in create_api_client\nNameError: name 'k8sdynamicclient' is not defined\n",
  "module_stdout": "",
  "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
  "rc": 1
}

This error didn’t appear again on next runs and playbook run went back to being stuck.

I also noticed jsonpatch wasn’t installed which is mentioned as a dependency to kubernetes.core.k8s here: kubernetes.core.k8s module – Manage Kubernetes (K8s) objects — Ansible Community Documentation
that also didn’t make a difference

2 Likes

I’d suggest deleting the two existing venv’s and creating a new one with pipx and installing the latest ansible and additional libraries, like jsonpatch into it, for example:

pipx install ansible
pipx inject ansible ansible-lint dnspython lxml jc jmespath jsonpatch netaddr psycopg pymysql

@chris thanks for the suggestion. I’ve tried using pipx and that didn’t make a difference.

That how I used pipx:

pipx install --include-deps ansible
pipx inject ansible ansible-lint dnspython lxml jc jmespath jsonpatch netaddr psycopg pymysql

Still received the warning:

[WARNING]: Collection community.okd does not support Ansible version 2.13.13
[WARNING]: Collection kubernetes.core does not support Ansible version 2.13.13

and playbook still got stuck unfortunately.

It sounds like you are not using the pipx installed version, what does this return?

pipx list

Hi @chris, I’ve checked and I seem to be using the pipx installed version. I cleaned up ansible binaries before installing through pipx. I checked after cleanup that ansible is not available and then installed with pipx. Here is the pipx list output:

pipx list
venvs are in /home/user1/.local/pipx/venvs
binaries are exposed on your $PATH at /home/user1/.local/bin
   package ansible 6.7.0, Python 3.8.10
    - __init__.py
    - ansible
    - ansible-community
    - ansible-config
    - ansible-connection
    - ansible-console
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
    - ansible-playbook
    - ansible-pull
    - ansible-test
    - ansible-vault
    - ansible_connection_cli_stub.py

Sorry I should have noticed this sooner — you will need a newer version of Python for the latest version of Ansible, see the Version / Control Node Python table here.

@chris that alright, unfortunately I’ve already tried this with python 3.10.14 with no progress.

pipx install ansible --include-deps --python /usr/bin/python3.10
WARNING: There was an error checking the latest version of pip.
  installed package ansible 9.4.0, Python 3.10.14
  These binaries are now globally available
    - __init__.py
    - ansible
    - ansible-community
    - ansible-config
    - ansible-connection
    - ansible-console
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
    - ansible-playbook
    - ansible-pull
    - ansible-test
    - ansible-vault
    - ansible_connection_cli_stub.py
    - bootstrap-project.sh
    - cleanup-project.sh
    - integration-test-files.sh
    - syslog.log
    - syslog_server.py
    - vendor.py

I get the same stuck up error.

You still get these errors with the latest version of Ansible?

[WARNING]: Collection community.okd does not support Ansible version 2.13.10
[WARNING]: Collection kubernetes.core does not support Ansible version 2.13.10

Or perhaps I misunderstood, are you saying that with the latest version of Ansible you don’t have these errors but are still getting the same behaviour when running the playbook?

@chris apologies I wasn’t clear enough. I don’t see the collection warnings with python3.10.14 but the playbook still gets stuck at community.okd.k8s task.

1 Like

Thanks for clarifying, sorry I’ve not used Ansible with Kubernetes so I’m not best placed to help further with this issue.

@chris that’s alright. thank you for your support. can you please mention any other support folks that are best suited for this problem?

1 Like

Is that output with verbosity turned up to 4? -vvvv

I’ve had issues with OCP auth, and just ended up retrieving a login token with the oc tool and saving it to an AWX k8s credential.

@Denney-tech thanks for responding. The original post includes output with verbosity -vvvvv however the latest one doesn’t. please let me know which test you’d like me to do with -vvvv. I don’t think it’s an issue with auth since I’ve tried logging in with ansible.builtin.command: oc login -u user -p password --server=example.com as well (which has worked for me in the past). I think my issue of community.okd.k8s started when I updated ansible which updated ansible-core. This ansible-core update has not been very nice for community.okd.k8s and kubernetes.core.k8s module and leads to module hanging up/getting stuck. I’ve tried installing previous versions of ansible but they still seem to be installed with latest ansible-core versions, resulting in the issue being persistent.

Right, it wasn’t necessarily the authentication itself, but reusing it for subsequent steps that I had issues with. Implicit auth using the kube config always worked for me, but had to come up with something different for AWX.

I’ll have to wait untill tomorrow to take a closer look.

Have you made sure the kubernetes.core pip requirements.txt are installed? You mentioned the jsonpatch was missing, but does kubernetes meet the minimum requirement?

@Denney-tech yes I checked and all requirements were present (except jsonpatch at that time which I installed and tried again but no luck). That being said, I could use the module even without having the jsonpatch package before I had the ansible-core update so I don’t think jsonpatch is the issue.