Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s_info - async is not supported for this task. #678

Open
wmlynch opened this issue Feb 13, 2024 · 0 comments
Open

k8s_info - async is not supported for this task. #678

wmlynch opened this issue Feb 13, 2024 · 0 comments
Labels
needs_verify type/bug Something isn't working

Comments

@wmlynch
Copy link

wmlynch commented Feb 13, 2024

SUMMARY

I see differences between indirect and direct references to k8s_info and the async task option. I don't know if this a bug or working as designed. Or if this a builtin redirect isssue?

This works...

  - name: built-in redirect example (works)
    k8s_info:
   ...
    async: "120"
    poll: "1"

This doesn't work...

 - name: direct example (doesn't work)
    kubernetes.core.k8s_info:
   ...
    async: "120"
    poll: "1"

and fails with

task path: /root/molecule/async-recreate.yml:25
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NoneType: None
fatal: [localhost]: FAILED! => {"changed": false, "msg": "async is not supported for this task."}
ISSUE TYPE
  • Bug Report
COMPONENT NAME

kubernetes.core.k8s_info

ANSIBLE VERSION
ansible --version
ansible [core 2.14.14]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /root/.venv/bin/ansible
  python version = 3.9.17 (main, Jun 13 2023, 16:05:09) [GCC 8.3.0] (/root/.venv/bin/python)
  jinja version = 3.1.3
  libyaml = True

COLLECTION VERSION
ansible-galaxy [core 2.14.14]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /root/.venv/bin/ansible-galaxy
  python version = 3.9.17 (main, Jun 13 2023, 16:05:09) [GCC 8.3.0] (/root/.venv/bin/python)
  jinja version = 3.1.3
  libyaml = True
No config file found; using defaults

# /root/.ansible/collections/ansible_collections
Collection      Version
--------------- -------
kubernetes.core 3.0.0  

CONFIGURATION
ansible-config [core 2.14.14]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /root/.venv/bin/ansible-config
  python version = 3.9.17 (main, Jun 13 2023, 16:05:09) [GCC 8.3.0] (/root/.venv/bin/python)
  jinja version = 3.1.3
  libyaml = True
No config file found; using defaults
CONFIG_FILE() = None
DEFAULT_VERBOSITY(env: ANSIBLE_VERBOSITY) = 2

OS / ENVIRONMENT
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
STEPS TO REPRODUCE
  1. export a KUBECONFIG of a kubernetes cluster
  2. run ansible-playbook async-recreate.yml

async-crecreate.yml playbook

---
- name: Show the differences between direct and indirect
  hosts: localhost
  become: no
  tasks:
  - name: built-in redirect example (works)
    k8s_info:
      api_version: v1
      kind: Pod
      namespace: default
    register: _indirect_k8s_info
    until: _indirect_k8s_info is successful
    delay: "15"
    retries: "10"
    async: "120"
    poll: "1"

  - name: direct example (doesn't work)
    kubernetes.core.k8s_info:
      api_version: v1
      kind: Pod
      namespace: default
    register: _direct_k8s_info
    until: _direct_k8s_info is successful
    delay: "15"
    retries: "10"
    async: "120"
    poll: "1"
EXPECTED RESULTS
See TASK [built-in redirect example (works)]  below
ACTUAL RESULTS
ansible-playbook [core 2.14.14]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /root/.venv/bin/ansible-playbook
  python version = 3.9.17 (main, Jun 13 2023, 16:05:09) [GCC 8.3.0] (/root/.venv/bin/python)
  jinja version = 3.1.3
  libyaml = True
No config file found; using defaults
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
redirecting (type: modules) ansible.builtin.k8s_info to kubernetes.core.k8s_info
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: async-recreate.yml ***************************************************************************************************************************************************************************************
1 plays in async-recreate.yml

PLAY [Show the differences between direct and indirect] ************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************************************************
task path: /root/molecule/async-recreate.yml:2
ok: [localhost]

TASK [built-in redirect example (works)] ***************************************************************************************************************************************************************************
task path: /root/molecule/async-recreate.yml:6
redirecting (type: modules) ansible.builtin.k8s_info to kubernetes.core.k8s_info
redirecting (type: modules) ansible.builtin.k8s_info to kubernetes.core.k8s_info
ASYNC OK on localhost: jid=j996967061524.31767
ok: [localhost] => {"ansible_job_id": "j996967061524.31767", "api_found": true, "attempts": 1, "changed": false, "finished": 1, "resources": [], "results_file": "/root/.ansible_async/j996967061524.31767", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

TASK [direct example (doesn't work)] *******************************************************************************************************************************************************************************
task path: /root/molecule/async-recreate.yml:18
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NoneType: None
fatal: [localhost]: FAILED! => {"changed": false, "msg": "async is not supported for this task."}

PLAY RECAP *********************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0  

@gravesm gravesm added type/bug Something isn't working needs_verify jira labels Feb 20, 2024
@gravesm gravesm removed the jira label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_verify type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants