-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Local users with an expiry date cannot be created #71942
Labels
affects_2.9
This issue/PR affects Ansible v2.9
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
P3
Priority 3 - Approved, No Time Limitation
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
system
System category
Comments
Files identified in the description: If these files are incorrect, please update the |
ansibot
added
affects_2.9
This issue/PR affects Ansible v2.9
bug
This issue/PR relates to a bug.
needs_triage
Needs a first human triage before being processed.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
labels
Sep 25, 2020
!component =lib/ansible/modules/user.py |
Files identified in the description: If these files are incorrect, please update the |
Option three seems like the best fix. |
samdoran
added
P3
Priority 3 - Approved, No Time Limitation
and removed
needs_triage
Needs a first human triage before being processed.
labels
Sep 29, 2020
rpluem-vf
added a commit
to rpluem-vf/ansible
that referenced
this issue
Sep 30, 2020
The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: ansible#71942
samdoran
pushed a commit
that referenced
this issue
Oct 2, 2020
The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: #71942 In Python3 math.floor returns an integer whereas Python2 returns a float. Hence always convert the result of math.floor to an int to ensure that lexpires is an integer. Move local expires tests in a separate file and import the tasks to the main.yml to keep main.yml smaller.
rpluem-vf
added a commit
to rpluem-vf/ansible
that referenced
this issue
Oct 2, 2020
…2022) The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: ansible#71942 In Python3 math.floor returns an integer whereas Python2 returns a float. Hence always convert the result of math.floor to an int to ensure that lexpires is an integer. Move local expires tests in a separate file and import the tasks to the main.yml to keep main.yml smaller. (cherry picked from commit a7170da)
rpluem-vf
added a commit
to rpluem-vf/ansible
that referenced
this issue
Oct 2, 2020
…2022) The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: ansible#71942 In Python3 math.floor returns an integer whereas Python2 returns a float. Hence always convert the result of math.floor to an int to ensure that lexpires is an integer. Move local expires tests in a separate file and import the tasks to the main.yml to keep main.yml smaller. (cherry picked from commit a7170da)
heiderich
pushed a commit
to heiderich/ansible
that referenced
this issue
Oct 4, 2020
…2022) The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: ansible#71942 In Python3 math.floor returns an integer whereas Python2 returns a float. Hence always convert the result of math.floor to an int to ensure that lexpires is an integer. Move local expires tests in a separate file and import the tasks to the main.yml to keep main.yml smaller.
relrod
pushed a commit
that referenced
this issue
Oct 21, 2020
…72085) The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: #71942 In Python3 math.floor returns an integer whereas Python2 returns a float. Hence always convert the result of math.floor to an int to ensure that lexpires is an integer. Move local expires tests in a separate file and import the tasks to the main.yml to keep main.yml smaller. (cherry picked from commit a7170da)
relrod
pushed a commit
that referenced
this issue
Oct 23, 2020
…72086) The luseradd / lusermod commands do not support the -e option. Set the expiry time in this case via lchage after the user was created / modified. Fixes: #71942 In Python3 math.floor returns an integer whereas Python2 returns a float. Hence always convert the result of math.floor to an int to ensure that lexpires is an integer. Move local expires tests in a separate file and import the tasks to the main.yml to keep main.yml smaller. (cherry picked from commit a7170da)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.9
This issue/PR affects Ansible v2.9
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
P3
Priority 3 - Approved, No Time Limitation
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
system
System category
SUMMARY
Local users with an expiry date cannot be created
ISSUE TYPE
COMPONENT NAME
ansible.builtin.user
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
User
test_user
gets created locally with an expiry time of 1601093139ACTUAL RESULTS
Playbook fails
This is caused by the fact that
luseradd
/lusermod
at least on RedHat / Centos 6, 7, 8 and on Ubuntu 20 LTS do not support the-e
option. I see the following options to fix this:expires
in caselocal
isyes
or print a warning like the one if the user is not found in/etc/passwd
for the local case whenexpires
andlocal
are set.expires
andlocal
are set.expires
is set andlocal
isyes
executelchage
after the user was created / modified to fix the expiry date.Let me know if one of the above options would be acceptable (or another option) and I try to have a look for a patch / PR.
The text was updated successfully, but these errors were encountered: