Skip to content

Add RADIUS authentication modules#501

Merged
TerryHowe merged 5 commits into
mainfrom
copilot/add-radius-modules
Dec 16, 2025
Merged

Add RADIUS authentication modules#501
TerryHowe merged 5 commits into
mainfrom
copilot/add-radius-modules

Conversation

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Implements Ansible modules for HashiCorp Vault RADIUS authentication using the hvac library's Radius API.

Modules

  • hashivault_radius_config: Configure RADIUS backend (host, secret, port, dial_timeout, nas_port, unregistered_user_policies)
  • hashivault_radius_user: Manage RADIUS users and policy assignments (create/update/delete)

Both modules implement idempotency via configuration comparison and support check mode.

Integration

  • Added RADIUS to hashivault_auth() for credential-based authentication
  • Updated VAULT_AUTHTYPE documentation to include radius

Example Usage

# Configure RADIUS backend
- hashivault_radius_config:
    host: radius.example.com
    secret: "{{ radius_shared_secret }}"
    port: 1812

# Manage user policies
- hashivault_radius_user:
    name: alice
    policies:
      - default
      - app-read
    state: present

Authenticate via environment:

export VAULT_AUTHTYPE=radius
export VAULT_USER=alice
export VAULT_PASSWORD=secret

Test Coverage

  • test_radius_config.yml: Configuration idempotency and policy assignments
  • test_radius_user.yml: User CRUD operations and policy updates
Original prompt

This section details on the original issue you should resolve

<issue_title>Add RADIUS modules</issue_title>
<issue_description>Create ansible modules to support RADIUS using https://python-hvac.org/en/stable/source/hvac_api_auth_methods.html#hvac.api.auth_methods.Radius</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 18, 2025 19:55
Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com>
Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Ansible modules to support RADIUS Add RADIUS authentication modules Nov 18, 2025
Copilot AI requested a review from TerryHowe November 18, 2025 20:02

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fix broken tests

@itsphoebe

Copy link
Copy Markdown
Contributor

@copilot fix bug to write a config when the current state is empty. In hashivault_radius_config if Radius auth is newly enabled, it wont write the config to Vault.

… empty

The module was not configuring RADIUS when no existing config was present.
Added check to set changed=True when current_state is empty, ensuring
configuration is written on first run after enabling RADIUS auth method.
@itsphoebe

Copy link
Copy Markdown
Contributor

Sorry if I'm doing this incorrectly!
I was testing out this PR and it wasnt properly adding the config after radius auth was enabled so added that change into this PR 503
Tested locally and it was able to config to my lab radius server!

Fix: hashivault_radius_config now writes config when current_state is…
@drewmullen

Copy link
Copy Markdown
Contributor

@itsphoebe was able to show me that these changes worked for adding the mount and a user role

image image

@TerryHowe

Copy link
Copy Markdown
Owner

Is that an approval/lgtm?

@drewmullen drewmullen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but legit this time ✌️

yes and tyvm! nice working with ya again!

@TerryHowe TerryHowe merged commit eaecb98 into main Dec 16, 2025
3 checks passed
@TerryHowe

Copy link
Copy Markdown
Owner

Available with 5.6.0

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.

Add RADIUS modules

4 participants