Skip to content

Commit

Permalink
microsoft.ad.user - Fix account_locked on creation
Browse files Browse the repository at this point in the history
Ensure that creating a new user with an explicit account_locked value
does not fail.
  • Loading branch information
jborean93 committed Mar 25, 2024
1 parent b66cdf4 commit 46faaff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/user-account-locked.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bugfixes:
- >-
microsoft.ad.user - Fix issue when creating a new user account with ``account_locked: false`` -
https://github.com/ansible-collections/microsoft.ad/issues/108
3 changes: 3 additions & 0 deletions plugins/modules/user.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ $setParams = @{
type = 'bool'
}
Attribute = 'LockedOut'
# We cannot lock a user and creating a user that is unlocked
# requires no action.
New = {}
Set = {
param($Module, $ADParams, $SetParams, $ADObject)

Expand Down
3 changes: 3 additions & 0 deletions tests/integration/targets/user/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@
user:
name: MyUser
state: present
account_locked: False
city: Brisbane
company: Red Hat
country: au
Expand Down Expand Up @@ -563,6 +564,7 @@
user:
name: MyUser
state: present
account_locked: False
city: Brisbane
company: Red Hat
country: au
Expand Down Expand Up @@ -685,6 +687,7 @@
user:
name: MyUser
state: present
account_locked: False
city: Brisbane
company: Red Hat
country: au
Expand Down

0 comments on commit 46faaff

Please sign in to comment.