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

Support missing for Content-Type: application/x-www-form-urlencoded in dcnm_rest module #366

Open
sandkum5 opened this issue Jan 29, 2025 · 0 comments

Comments

@sandkum5
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Ansible Version and collection version

ansible --version

ansible [core 2.16.3]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True

ansible-galaxy collection list | grep dcnm

cisco.dcnm 3.6.0

DCNM version

Nexus Dashboard: 3.2.1e

Affected module(s)

  • dcnm_rest

Ansible Playbook

---
- hosts: dcnm_controllers
  gather_facts: false
  connection: ansible.netcommon.httpapi

  tasks:
    - name: Set Default Credentials
      cisco.dcnm.dcnm_rest:
        method: POST
        path: /appcenter/cisco/ndfc/api/v1/lan-fabric/rest/lanConfig/saveRobotCredentials
        json_data: '{"password": "password","confirmPassword": "password","isRobot":true,"username": "admin"}'
      register: result
    - debug:
        var: result

Inventory File

[dcnm_controllers]
x.x.x.x

[dcnm_controllers:vars]
ansible_user=admin
ansible_ssh_pass=password
ansible_network_os=cisco.dcnm.dcnm
ansible_httpapi_validate_certs=False
ansible_httpapi_use_ssl=True
ansible_httpapi_login_domain=local

Debug Output

Expected Behavior

We should be able to make changes to NDFC using the dcnm_rest module for API paths which support "Content-Type: application/x-wwww-form-urlencoded"

Actual Behavior

Getting a 500 error.

Steps to Reproduce

Only 1 step i.e. run the playbook.

ansible-playbook -i inventory default_creds.yml

References

NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant