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

Proxmox_task_info api_password required along with api_user #6201

Closed
1 task done
Jurka007 opened this issue Mar 16, 2023 · 5 comments · Fixed by #6554
Closed
1 task done

Proxmox_task_info api_password required along with api_user #6201

Jurka007 opened this issue Mar 16, 2023 · 5 comments · Fixed by #6554
Labels
cloud feature This issue/PR relates to a feature request module module plugins plugin (any type) traceback

Comments

@Jurka007
Copy link

Jurka007 commented Mar 16, 2023

Summary

Cannot use the module with token id and secret only:

        module = AnsibleModule(
        argument_spec=module_args,
        required_together=[('api_token_id', 'api_token_secret'),
                           ('api_user', 'api_password')],
        required_one_of=[('api_password', 'api_token_id')],
        supports_check_mode=True)
        result = dict(changed=False)

Issue Type

Feature Request

Component Name

proxmox_tasks_info

Ansible Version

  config file = /opt/git/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible 
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]

Community.general Version

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 1.3.6

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 6.3.0

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

- name: Check proxmox task
  community.general.proxmox_tasks_info:
    api_host: "{{ api_host }}"
    api_user: "{{ api_user }}"
    api_token_id: "{{ api_token_id }}"
    api_token_secret: "{{ api_token_secret }}"
    node: "{{ node }}"
    task: "{{ task }}"

"msg": "parameters are required together: api_user, api_password"

Expected Results

If I comment out the required_together part for api_password and api_host the task is successful.

Actual Results

The full traceback is:
  File "/tmp/ansible_community.general.proxmox_tasks_info_payload_j17m_215/ansible_community.general.proxmox_tasks_info_payload.zip/ansible/module_utils/basic.py", line 1626, in _check_required_together
    check_required_together(spec, param)
  File "/tmp/ansible_community.general.proxmox_tasks_info_payload_j17m_215/ansible_community.general.proxmox_tasks_info_payload.zip/ansible/module_utils/common/validation.py", line 128, in check_required_together
    raise TypeError(to_native(msg))

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug cloud module module plugins plugin (any type) traceback labels Mar 16, 2023
@felixfontein
Copy link
Collaborator

I don't think this is a bug, but a feature request. Just because something doesn't work as you expect it is not necessarily a bug.

@felixfontein felixfontein removed the bug This issue/PR relates to a bug label Mar 19, 2023
@ansibullbot ansibullbot added the feature This issue/PR relates to a feature request label Mar 19, 2023
@tovoro
Copy link

tovoro commented Apr 20, 2023

Wouldn't the benefit of a token be to not have to use a password?

@felixfontein
Copy link
Collaborator

From the argument spec I would suspect that you should supply either a token ID + token secret, or a username and password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud feature This issue/PR relates to a feature request module module plugins plugin (any type) traceback
Projects
None yet
4 participants