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

ipauser: Make return value depending on users parameter #1053

Conversation

t-woerner
Copy link
Member

@t-woerner t-woerner commented Mar 2, 2023

The way how randompasswords are returned by the ipauser module depends so far on the number of users that are handled by the module.

This is unexpected if for example a json file is provided with the users parameter. As it might be unknown how many users are in the json file, this behaviour is unexpected. The return should not vary in this case.

This chamge makes the return simply depend on the use of the users paramater. As soon as this parameter is used, the return will always be:

"user": { "<the user >": { "randompassword": "<the user random password>" } }

In the simply case with one user it will be still

"user": { "randompassword": "<the user random password>" }

Fixes: #1052 (ipauser should consitently return randompasswords when
used with users)

The way how randompasswords are returned by the ipauser module depends
so far on the number of users that are handled by the module.

This is unexpected if for example a json file is provided with the users
parameter. As it might be unknown how many users are in the json file,
this behaviour is unexpected. The return should not vary in this case.

This chamge makes the return simply depend on the use of the users
paramater. As soon as this parameter is used, the return will always be:

"user": { "<the user>": { "randompassword": "<the user random password>" } }

In the simply case with one user it will be still

"user": { "randompassword": "<the user random password>" }

Fixes: freeipa#1052 (ipauser should consitently return randompasswords when
              used with users)
@t-woerner
Copy link
Member Author

It should be possible to return additionally "randompassword": "<the user random password>" if the users parameter is used with a single user only.

@t-woerner
Copy link
Member Author

Additionally fix "Ensure users pinky and brain are present with a generated random password and print the random passwords:" in README-user.md. This is missing random:true completely.

Copy link
Collaborator

@varunmylaraiah varunmylaraiah left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.
The existing downstream tests passed with this PR.

Copy link
Member

@rjeffman rjeffman left a comment

Choose a reason for hiding this comment

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

lgtm

@rjeffman rjeffman merged commit b05aec9 into freeipa:master Mar 10, 2023
t-woerner added a commit to t-woerner/ansible-freeipa that referenced this pull request Mar 14, 2023
The way how randompasswords are returned by the ipahost module depends
so far on the number of hosts that are handled by the module.

This is unexpected if for example a json file is provided with the hosts
parameter. As it might be unknown how many hosts are in the json file,
this behaviour is unexpected. The return should not vary in this case.

This chamge makes the return simply depend on the use of the hosts
paramater. As soon as this parameter is used, the return will always be:

"host": { "<the host>": { "randompassword": "<the host random password>" } }

In the simply case with one host it will be still

"host": { "randompassword": "<the host random password>" }

This change for ipahost is related to the ipauser PR freeipa#1053.

Related: freeipa#1052 (ipauser should consitently return randompasswords when
                used with users)
t-woerner added a commit to t-woerner/ansible-freeipa that referenced this pull request Mar 14, 2023
The way how randompasswords are returned by the ipahost module depends
so far on the number of hosts that are handled by the module.

This is unexpected if for example a json file is provided with the hosts
parameter. As it might be unknown how many hosts are in the json file,
this behaviour is unexpected. The return should not vary in this case.

This chamge makes the return simply depend on the use of the hosts
paramater. As soon as this parameter is used, the return will always be:

"host": { "<the host>": { "randompassword": "<the host random password>" } }

In the simply case with one host it will be still

"host": { "randompassword": "<the host random password>" }

This change for ipahost is related to the ipauser PR freeipa#1053.
t-woerner added a commit to t-woerner/ansible-freeipa that referenced this pull request Mar 25, 2023
The way how randompasswords are returned by the ipahost module depends
so far on the number of hosts that are handled by the module.

This is unexpected if for example a json file is provided with the hosts
parameter. As it might be unknown how many hosts are in the json file,
this behaviour is unexpected. The return should not vary in this case.

This chamge makes the return simply depend on the use of the hosts
paramater. As soon as this parameter is used, the return will always be:

"host": { "<the host>": { "randompassword": "<the host random password>" } }

In the simply case with one host it will be still

"host": { "randompassword": "<the host random password>" }

This change for ipahost is related to the ipauser PR freeipa#1053.
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.

ipauser should consitently return randompasswords when used with users
3 participants