You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/user/tasks/test_expires_warn.yml

37 lines
957 B
YAML

# https://github.com/ansible/ansible/issues/79882
- name: Test setting warning days
when: ansible_facts.os_family in ['RedHat', 'Debian', 'Suse']
block:
- name: create user
user:
name: ansibulluser
state: present
- name: add warning days for password
user:
name: ansibulluser
password_expire_warn: 28
register: pass_warn_1_0
- name: again add warning days for password
user:
name: ansibulluser
password_expire_warn: 28
register: pass_warn_1_1
- name: validate result for warning days
assert:
that:
- pass_warn_1_0 is changed
- pass_warn_1_1 is not changed
- name: Get shadow data for ansibulluser
getent:
database: shadow
key: ansibulluser
- name: Ensure number of warning days was set properly
assert:
that:
- ansible_facts.getent_shadow['ansibulluser'][4] == '28'