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

Add netbox_user module #1303

Merged
merged 17 commits into from
Sep 5, 2024
Merged

Conversation

dchiquito
Copy link
Contributor

@dchiquito dchiquito commented Aug 26, 2024

Related Issue

#1043

New Behavior

Add support for admin objects under /api/users:

  • users
  • groups
  • permissions
  • tokens

Discussion: Benefits and Drawbacks

These entities have existed in Netbox for several major versions now, and it would be useful to manage them with Ansible.

Changes to the Documentation

Just the docs for the new endpoints.

When I ran make-docs.sh it generated some unrelated changes, which I assume are from past commits that neglected to run it.

Proposed Release Note Entry

  • Add the netbox_user, netbox_user_group, netbox_permission, and netbox_token to manage the various Admin entities.

The CI changelog fragment checker is failing, but since I'm only adding new modules I don't think it's necessary. This should be the module descriptions required for the changelog:

    modules:
    - description: Creates or removes users from NetBox
      name: netbox_user
      namespace: ''
    - description: Creates or removes user groups from NetBox
      name: netbox_user_group
      namespace: ''
    - description: Creates or removes permissions from NetBox
      name: netbox_permission
      namespace: ''
    - description: Creates or removes tokens from NetBox
      name: netbox_token
      namespace: ''

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR targets the devel branch.

@dchiquito
Copy link
Contributor Author

dchiquito commented Aug 27, 2024

netbox-community/netbox#17279 is interfering with the expected behavior for tokens. Whenever a token would be updated, the key field is used to look up the id of the token and is stripped out of the body of the PATCH request. When key is not present in the body, netbox will automatically regenerate a default value, which is unexpected and undesired since we are using the key as an identifier.

I'm not sure of the best way to proceed with that, so for now I have simply disabled the update test pending a resolution upstream. Merging this as-is would cause unexpected behavior for anyone updating a token.

@dchiquito dchiquito marked this pull request as ready for review August 27, 2024 17:18
@pchiquit
Copy link

pchiquit commented Sep 3, 2024

@rodvand any idea when this PR can be merged? It looks like the changelog is not required:
[2024-08-28 23:50:37,866] - Missing changelog fragment. This is not required only if PR adds new modules and plugins or contain only documentation changes.

@rodvand rodvand merged commit 48bdaef into netbox-community:devel Sep 5, 2024
44 of 47 checks passed
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

Successfully merging this pull request may close these issues.

3 participants