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

User locking is not idempotent #43670

Closed
gaddman opened this issue Aug 5, 2018 · 2 comments · Fixed by #43671
Closed

User locking is not idempotent #43670

gaddman opened this issue Aug 5, 2018 · 2 comments · Fixed by #43671
Assignees
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@gaddman
Copy link
Contributor

gaddman commented Aug 5, 2018

SUMMARY

When locking an already locked user Ansible reports a change.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

user.py

ANSIBLE VERSION
ansible 2.6.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/chris/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]

Bug introduced by PR #37962

CONFIGURATION

N/A

OS / ENVIRONMENT

Tested on Ubuntu 16.04, but applicable to other *nix platforms.

STEPS TO REPRODUCE

Run the following playbook multiple times.

---
- hosts: localhost
  tasks:
  - user: name=testuser password_lock=yes
    become: true
EXPECTED RESULTS

The first time this is run the module reports changed. Subsequent runs shouldn't report any change, in order to remain idempotent.

ACTUAL RESULTS

Repeated runs of locking or unlocking the password always report changed.

@ansibot
Copy link
Contributor

ansibot commented Aug 5, 2018

Files identified in the description:

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

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Aug 5, 2018

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 5, 2018
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Aug 6, 2018
@samdoran samdoran self-assigned this Aug 13, 2018
jikamens added a commit to jikamens/ansible-usenet-mod-relay that referenced this issue Oct 26, 2018
Avoid spurious "changed:" messages when creating / locking users that
already exist and are locked.
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants