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

Allow local users with an expiry date to be created #72022

Merged
merged 15 commits into from
Oct 2, 2020

Conversation

rpluem-vf
Copy link
Contributor

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.

SUMMARY

Fixes: #71942

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

user

ADDITIONAL INFORMATION

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
@ansibot ansibot added affects_2.11 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. system System category labels Sep 30, 2020
@ansibot
Copy link
Contributor

ansibot commented Sep 30, 2020

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/user.py:687:44: undefined-variable: Undefined variable 'module'
lib/ansible/modules/user.py:836:52: undefined-variable: Undefined variable 'module'

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 30, 2020
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Sep 30, 2020
@rpluem-vf rpluem-vf marked this pull request as draft September 30, 2020 11:54
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 30, 2020
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Sep 30, 2020
@ansibot
Copy link
Contributor

ansibot commented Sep 30, 2020

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

test/integration/targets/user/tasks/main.yml:1165:7: key-duplicates: duplication of key "name" in mapping

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 30, 2020
This reverts commit b3bf798.
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.
@rpluem-vf rpluem-vf marked this pull request as ready for review September 30, 2020 15:05
@rpluem-vf
Copy link
Contributor Author

ready_for_review

@bcoca bcoca requested a review from samdoran October 1, 2020 19:32
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Oct 1, 2020
Copy link
Contributor

@samdoran samdoran left a comment

Choose a reason for hiding this comment

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

The change is good overall. Just a few minor changes are needed.

changelogs/fragments/fix_ansible_issue_71942.yaml Outdated Show resolved Hide resolved
lib/ansible/modules/user.py Outdated Show resolved Hide resolved
lib/ansible/modules/user.py Outdated Show resolved Hide resolved
lib/ansible/modules/user.py Outdated Show resolved Hide resolved
lib/ansible/modules/user.py Outdated Show resolved Hide resolved
test/integration/targets/user/tasks/main.yml Show resolved Hide resolved
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 2, 2020
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 2, 2020
rpluem-vf and others added 4 commits October 2, 2020 17:59
Move local expires tests in a separate file and import the tasks to the
main.yml to keep main.yml smaller.
Copy link
Contributor Author

@rpluem-vf rpluem-vf left a comment

Choose a reason for hiding this comment

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

Hopefully things are fine now.

@rpluem-vf rpluem-vf requested a review from samdoran October 2, 2020 16:32
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 2, 2020
Copy link
Contributor

@samdoran samdoran left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments so quickly.

@samdoran samdoran merged commit a7170da into ansible:devel Oct 2, 2020
@samdoran
Copy link
Contributor

samdoran commented Oct 2, 2020

Please create a backport PR against stable-2.9 and stable-2.10.

rpluem-vf added a commit to rpluem-vf/ansible that referenced this pull request 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 pull request 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
Copy link
Contributor Author

stable-2.10: #72085
stable-2.9: #72086

heiderich pushed a commit to heiderich/ansible that referenced this pull request 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 pull request 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)
@rpluem-vf rpluem-vf deleted the fix_ansible_issue_71942 branch October 22, 2020 18:15
relrod pushed a commit that referenced this pull request 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)
@ansible ansible locked and limited conversation to collaborators Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.11 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. system System category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local users with an expiry date cannot be created
4 participants