2021-04-15 16:24:51 +02:00
|
|
|
---
|
|
|
|
- name: Install the PAM lib
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- libpam-oath
|
|
|
|
state: latest
|
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
|
|
|
- name: Add the totp secret for users
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/users.oath
|
|
|
|
regexp: "{{ item.name }}"
|
2021-04-15 17:10:35 +02:00
|
|
|
line: "HOTP/T{{ totp_periode }}/{{ totp_digits }} {{ item.name }} - {{item.totp}}"
|
2021-04-15 16:24:51 +02:00
|
|
|
create: true
|
|
|
|
group: root
|
|
|
|
owner: root
|
|
|
|
mode: '600'
|
|
|
|
loop: "{{ uservault_users }}"
|
|
|
|
no_log: true
|