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

Expose more password_profile options in azure_rm_aduser #1376

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

pluto00987
Copy link

  • Normalize 'password' vs 'password_profile' variable and option names
  • Add options for 'force password change on next logon'
SUMMARY

This adds two additional ansible options mapping to existing options within a user's passwordProfile attribute. Specifically for my use case, I needed to be able to set forceChangePasswordNextSignIn=False.

passwordProfile resource type reference

Additionally, it normalizes the option and variable names so that 'password' is a password and 'password_profile' is a PasswordProfile object.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm_aduser

ADDITIONAL INFORMATION

@Fred-sun Fred-sun added medium_priority Medium priority work in In trying to solve, or in working with contributors labels Dec 25, 2023
@Fred-sun
Copy link
Collaborator

kindly ping!

@Fred-sun
Copy link
Collaborator

@pluto00987 Why do you have to redefine parameters that already exist? This has a large impact on the current user -- ‘password_profile'. You are advised not to change the previous parameter names. There is also a slight problem with the documentation. Thank you!

@Fred-sun Fred-sun added the question Further information is requested label Feb 18, 2024
@pluto00987
Copy link
Author

@Fred-sun
I opted to change the parameter name because 'password_profile' is a misnomer IMO. I did however leave it as an alias for 'password' which should prevent breaking any existing ansible jobs.
This was my same thought with the code. 'Password' is a thing and 'password profile' is also a thing but the existing variable names were mismatched with what they actually contained.
What issue with the documentation?

@Fred-sun
Copy link
Collaborator

@pluto00987 This will affect the current user. In this case, please fix the problem described in the above document. As for changing the parameter name, we will discuss it internally. Thank you!

@Fred-sun
Copy link
Collaborator

Fred-sun commented Mar 4, 2024

@pluto00987 There are no other questions, please make changes to the above part of the document. Thank you!

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

Small change requests!

plugins/modules/azure_rm_aduser.py Outdated Show resolved Hide resolved
@Fred-sun
Copy link
Collaborator

Fred-sun commented Apr 9, 2024

kindly ping!

@Fred-sun
Copy link
Collaborator

Kindly ping!

pluto00987 added a commit to pluto00987/azure that referenced this pull request Apr 29, 2024
…ns#1376)

* Normalize 'password' vs 'password_profile' variable and option names
* Add options for 'force password change on next logon'
@pluto00987
Copy link
Author

Hello Fred-sun.
I applied your change and rebased to current upstream. Please let me know if anything further is needed.
Thank you!

pluto00987 added a commit to pluto00987/azure that referenced this pull request Apr 30, 2024
…ns#1376)

* Normalize 'password' vs 'password_profile' variable and option names
* Add options for 'force password change on next logon'
@pluto00987
Copy link
Author

Fred-sun, I made an error with the first rebase but have corrected it now.

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels May 5, 2024
@Fred-sun
Copy link
Collaborator

Fred-sun commented May 5, 2024

@xuzhang3 ready_for_review!

@pluto00987
Copy link
Author

@Fred-sun I see a problem. The password option is in fact already used elsewhere, in azure_rm_common.py. I didn't realize this before but happened to be looking at the module documentation page today, where it is listed. So I can't rename password_profile to password after all.

So I will need to refactor this patch. I still don't like the name password_profile but I suppose leaving the original name alone is easiest. I'm open to other suggestions though. It's unfortunate that whomever implemented the global ad_user/password options didn't use ad_password instead for consistency, but such is life.

@Fred-sun
Copy link
Collaborator

@pluto00987 Yes, you are right that it should not duplicate the integrated parameter name. After you resubmit, I will review and promote the merger as soon as possible! Thank you!

@Fred-sun Fred-sun added work in In trying to solve, or in working with contributors and removed ready_for_review The PR has been modified and can be reviewed and merged labels May 16, 2024
…1376)

* Add options for 'force password change on next logon' with or without
  MFA
* Update some variable names from  'password' to 'password_profile'
  to improve code clarity
@pluto00987
Copy link
Author

Hi @Fred-sun. I've updated the change. Please take a look now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority question Further information is requested work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants