Skip to content

feat: add gpo_link module for managing GPO links#228

Closed
stevefulme1 wants to merge 2 commits into
ansible-collections:mainfrom
stevefulme1:feat/gpo-link-module
Closed

feat: add gpo_link module for managing GPO links#228
stevefulme1 wants to merge 2 commits into
ansible-collections:mainfrom
stevefulme1:feat/gpo-link-module

Conversation

@stevefulme1
Copy link
Copy Markdown
Contributor

Summary

  • Adds microsoft.ad.gpo_link module for declarative management of Group Policy Object links on AD sites, domains, and OUs
  • Wraps New-GPLink, Set-GPLink, and Remove-GPLink PowerShell cmdlets from the GroupPolicy module
  • Supports: link/unlink (state), enable/disable, enforce, link ordering, check mode, and diff mode
  • Eliminates the need for win_powershell with inline Set-GPLink scripts

Files

  • plugins/modules/gpo_link.yml — Full DOCUMENTATION, EXAMPLES, and RETURN definitions
  • plugins/modules/gpo_link.ps1 — PowerShell implementation using Ansible.Basic

Test plan

  • ansible-test sanity --docker passes
  • Verify module loads and argument validation works on a Windows target
  • Test link creation (state=present) on an OU
  • Test link removal (state=absent)
  • Test idempotency (run twice, second run shows no change)
  • Test check mode (--check shows changes without applying)
  • Test diff mode (--diff shows before/after)
  • Test link_enabled toggle (enable/disable without removing)
  • Test enforced flag
  • Test order parameter
  • Test with gpo_name vs gpo_guid

Ref: AAP-44072

🤖 Generated with Claude Code

stevefulme1 and others added 2 commits April 10, 2026 13:07
Adds a new module that wraps New-GPLink, Set-GPLink, and Remove-GPLink
PowerShell cmdlets to manage Group Policy Object links declaratively.
Replaces the need for win_powershell with inline Set-GPLink scripts.

Supports linking/unlinking, enable/disable, enforce, and link ordering.

Ref: AAP-44072

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When gpo_guid is provided, use -Guid directly instead of trying -Name
first. Prevents unnecessary error handling and makes the lookup
deterministic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@softwarefactory-project-zuul
Copy link
Copy Markdown

@ronger4
Copy link
Copy Markdown
Contributor

ronger4 commented May 26, 2026

I think this one can be closed as I created duplicate
#245

@jborean93 jborean93 closed this May 26, 2026
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