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

Getting Tunnel connection failed: 403 Forbidden #18

Open
racsoce opened this issue Mar 3, 2025 · 0 comments
Open

Getting Tunnel connection failed: 403 Forbidden #18

racsoce opened this issue Mar 3, 2025 · 0 comments

Comments

@racsoce
Copy link

racsoce commented Mar 3, 2025

I'm providing the user and password in my file:
group_vars/all.yml
ansible_user: "netengauto"
ansible_password: "xxxx"
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false

playbook:

  • name: Test get Facts
    hosts: all
    connection: httpapi
    gather_facts: false

    vars:
    ansible_network_os: opengear.om.om
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false

    tasks:

    • name: Debug
      ansible.builtin.debug:
      msg: "{{ hostvars }}"
    • name: Get port info
      opengear.om.om_facts:
      gather_subset: min
      gather_network_resources: ports
    • name: Display facts
      ansible.builtin.debug:
      msg: "{{ ansible_facts }}"

But I'm getting authentication errors:

task path: /local/opengear.yaml:17
The full traceback is:
File "/tmp/ansible_opengear.om.om_facts_payload_148ck5qu/ansible_opengear.om.om_facts_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/network.py", line 218, in get_capabilities
capabilities = Connection(module._socket_path).get_capabilities()
File "/tmp/ansible_opengear.om.om_facts_payload_148ck5qu/ansible_opengear.om.om_facts_payload.zip/ansible/module_utils/connection.py", line 200, in rpc
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [10.75.4.59]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"gather_network_resources": [
"ports"
],
"gather_subset": [
"min"
]
}
},
"msg": "Could not connect to https://10.75.4.59:22/api/v2/sessions/: Tunnel connection failed: 403 Forbidden"
}

Testing same user and password using Curl works fine

root@b98337f3a3da:/local# curl -k "https://10.75.4.59/api/v2/sessions/" -X POST -H 'Content-Type: application/json' -d '{"username":"netengauto","password":"xxxx"}'
{"message":"Redirecting to new session at /api/v2/sessions/self","sid":"xxx"}

What part is missing to get the facts for the Opengear?

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