Files
ansible-role-auth-duo/molecule/default/verify.yml

29 lines
778 B
YAML
Raw Normal View History

2020-04-01 11:20:57 +13:00
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
2020-04-02 09:37:46 +13:00
pre_tasks:
- name: Create test user
shell:
cmd: adduser "auth_duo_test" && echo "password" | passwd "auth_duo_test" --stdin
2020-04-01 11:20:57 +13:00
tasks:
2020-04-02 09:37:46 +13:00
- 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?
2020-04-01 11:20:57 +13:00
assert:
2023-10-10 23:24:47 +13:00
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"