Skip to content

[Bug]: NetBox modules silently fail with HTTP on HTTPS-enabled instance, falsely report 'changed' #1492

@thystips

Description

@thystips

Ansible NetBox Collection version

3.21.0

Ansible version

ansible [core 2.18.9]
  config file = /home/nothing/dev/weytop/ansible_vmfarm/ansible.cfg
  configured module search path = ['/home/nothing/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/nothing/dev/weytop/ansible_vmfarm/.venv/lib/python3.12/site-packages/ansible
  ansible collection location = /home/nothing/.ansible/collections:/usr/share/ansible/collections:/home/nothing/dev/weytop/ansible_vmfarm
  executable location = /home/nothing/dev/weytop/ansible_vmfarm/.venv/bin/ansible
  python version = 3.12.11 (main, Jul 23 2025, 00:34:44) [Clang 20.1.4 ] (/home/nothing/dev/weytop/ansible_vmfarm/.venv/bin/python3)
  jinja version = 3.1.6
  libyaml = True

NetBox version

v4.4.6-Docker-3.4.2 (with custom Dockerfile for plugins and SSO)

Python version

3.12

Steps to Reproduce

  1. Configure NetBox with SSL and HTTP→HTTPS redirect
  2. Use netbox.netbox module with HTTP URL:
    netbox.netbox.netbox_tenant:
      netbox_url: "http://netbox.example.com"  # HTTP instead of HTTPS
      netbox_token: "{{ token }}"
      data:
        name: "Test Tenant"
  3. Run the task

Expected Behavior

Module follows redirect and creates object, OR fails with clear error

Observed Behavior

  • Returns changed: true ✓
  • No error/warning
  • Object NOT created ✗
  • Not idempotent (always reports changed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions