Skip to content

Commit

Permalink
Merge pull request #41 from roumano/TOTP_Configuration
Browse files Browse the repository at this point in the history
Add TOTP Configuration
  • Loading branch information
roumano authored Jan 11, 2024
2 parents 5c9500e + 7d04781 commit 5b0b025
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ For any required Ansible roles, review:

[defaults/main.yml](defaults/main.yml)

### TOTP Configuration

To enable Two factor authentification, create a variable `guacamole_totp`:
```
guacamole_totp:
issuer: 'guacamole.exemple.com'
period: 60
```
## Dependencies

## Example Playbook
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@

- name: Manage Guacamole TOTP configurations
ansible.builtin.include_tasks: totp.yml
when: guacamole_totp | default(false) | bool
when: guacamole_totp is defined
15 changes: 15 additions & 0 deletions templates/etc/guacamole/guacamole.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,18 @@ ldap-max-referral-hops: {{ guacamole_ldap['max_referral_hops'] }}
ldap-operation-timeout: {{ guacamole_ldap['operation_timeout'] }}
{% endif %}
{% endif %}
{# TOTP Configuration #}
{% if guacamole_totp is defined %}
{% if guacamole_totp['issuer'] is defined %}
totp-issuer: {{ guacamole_totp['issuer'] }}
{% endif %}
{% if guacamole_totp['digits'] is defined %}
totp-digits: {{ guacamole_totp['digits'] }}
{% endif %}
{% if guacamole_totp['period'] is defined %}
totp-period: {{ guacamole_totp['period'] }}
{% endif %}
{% if guacamole_totp['mode'] is defined %}
totp-mode: {{ guacamole_totp['mode'] }}
{% endif %}
{% endif %}

0 comments on commit 5b0b025

Please sign in to comment.