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

ansible.builtin.user: add option for initial-only password-lock #79381

Open
1 task done
abelbabel opened this issue Nov 15, 2022 · 3 comments
Open
1 task done

ansible.builtin.user: add option for initial-only password-lock #79381

abelbabel opened this issue Nov 15, 2022 · 3 comments
Labels
affects_2.15 docs_only All changes are to files within the docs/docsite/ directory docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. waiting_on_contributor This would be accepted but there are no plans to actively work on it.

Comments

@abelbabel
Copy link
Contributor

abelbabel commented Nov 15, 2022

Summary

Hi,

it would be nice if it would be possible to initially-only lock a password for a user (like the possibility to only create a random password for a user initially), but to not lock it afterwards / in following runs when the user already exists - since it might be possible that a user logs in (via ssh for example) and changes his/her password and unlocks password-authentication.

Like possible with update_password, I would suggest either a third value for password_lock (on_create, resulting in three choices: yes, no, on_create) or a new option update_password_lock with choices always and on_create.

Regards
abelbabel

Issue Type

Feature Idea
Docs Issue

Component Name

user

Additional Information

  - name: create user
    user:
      name: test123
      comment: test user
      uid: 1100
      group: users
      shell: /bin/bash
      password_lock: on_create
      update_password: on_create
      state: present

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot
Copy link
Contributor

ansibot commented Nov 15, 2022

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.15 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Nov 15, 2022
@abelbabel
Copy link
Contributor Author

Actually this can be already achieved on Linux and OpenBSD - for example on Linux systems

  password: '!'
  update_password: on_create

If this fulfilles all use-cases the proposed feature request could have, it might be a good idea to add this case in documentation somewhere (as an example or as a note for password_lock).

@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Nov 15, 2022
@bcoca
Copy link
Member

bcoca commented Nov 15, 2022

You can also just use a getent and make it conditional, both can be examples in the module, making this a 'docs' issue.

@bcoca bcoca added docs This issue/PR relates to or includes documentation. and removed feature This issue/PR relates to a feature request. labels Nov 15, 2022
@s-hertel s-hertel added the docs_only All changes are to files within the docs/docsite/ directory label May 24, 2023
@bcoca bcoca added the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.15 docs_only All changes are to files within the docs/docsite/ directory docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. waiting_on_contributor This would be accepted but there are no plans to actively work on it.
Projects
None yet
Development

No branches or pull requests

4 participants