You've already forked ansible-role-auth-duo
Update to support testing
This commit is contained in:
@@ -3,7 +3,26 @@
|
||||
|
||||
- name: Verify
|
||||
hosts: all
|
||||
pre_tasks:
|
||||
- name: Create test user
|
||||
shell:
|
||||
cmd: adduser "auth_duo_test" && echo "password" | passwd "auth_duo_test" --stdin
|
||||
tasks:
|
||||
- name: Example assertion
|
||||
- name: Try and Login as test user
|
||||
shell: |
|
||||
/usr/bin/sshpass -v -p password \
|
||||
/usr/bin/ssh -tt -o "UserKnownHostsFile=/dev/null" \
|
||||
-o "StrictHostKeyChecking=no" \
|
||||
auth_duo_test@localhost > /tmp/sshtest 2>&1 | tee /tmp/sshtest
|
||||
async: 20
|
||||
poll: 10
|
||||
ignore_errors: true
|
||||
|
||||
- name: Retrieve SSH login info from file
|
||||
slurp:
|
||||
src: /tmp/sshtest
|
||||
register: slurpfile
|
||||
|
||||
- name: Did duo prompt show?
|
||||
assert:
|
||||
that: true
|
||||
that: "'Duo two-factor login for auth_duo_test' in slurpfile['content'] | b64decode"
|
||||
|
||||
Reference in New Issue
Block a user