set locale for test

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
This commit is contained in:
Martin Schurz 2021-02-22 17:45:46 +01:00
parent 26d84b5f84
commit 3334000b97

View file

@ -9,6 +9,11 @@
set_fact:
test_pw: "myTest!pw"
- name: set locale for test
set_fact:
locale: "C.UTF-8"
when: ansible_facts.distribution in ['Debian', 'Ubuntu']
- name: create testuser
user:
name: testuser
@ -19,12 +24,14 @@
cmd: "pam-tester --user testuser --password {{ test_pw }}"
environment:
TMPDIR: /var/tmp
LC_ALL: "{{ locale | default('en_US.utf-8') }}"
- name: check unsuccessfull login with incorrect password
shell:
cmd: "pam-tester --user testuser --password {{ test_pw }}fail --expectfail"
environment:
TMPDIR: /var/tmp
LC_ALL: "{{ locale | default('en_US.utf-8') }}"
with_sequence: count=6
- name: check ussuccessfull login, with orrect password (lockout)
@ -32,6 +39,7 @@
cmd: "pam-tester --user testuser --password {{ test_pw }} --expectfail"
environment:
TMPDIR: /var/tmp
LC_ALL: "{{ locale | default('en_US.utf-8') }}"
- name: wait for account to unlock
pause:
@ -42,3 +50,4 @@
cmd: "pam-tester --user testuser --password {{ test_pw }}"
environment:
TMPDIR: /var/tmp
LC_ALL: "{{ locale | default('en_US.utf-8') }}"