-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from migibert/psk_support
Psk support
- Loading branch information
Showing
6 changed files
with
83 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
# tasks to use psk | ||
- name: sanity check for psk existence | ||
fail: | ||
msg: If you have stunnel_use_psk you should provide at least one key | ||
when: not (stunnel_psks|default(false)) | ||
|
||
- name: Generate psk file | ||
template: | ||
src: psk.txt.j2 | ||
owner: root | ||
group: root | ||
mode: u=rw,g=,o= | ||
dest: /etc/stunnel/psk.txt | ||
register: stunnel_psk_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% for psk in stunnel_psks %} | ||
{{ psk.name }}:{{ psk.key }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
pid=/var/run/stunnel.pid | ||
output = /var/log/stunnel.log | ||
|
||
{% if stunnel_use_certificate %} | ||
cert=/etc/stunnel/stunnel.pem | ||
output=/var/log/stunnel.log | ||
{% endif %} | ||
|
||
{% for service in stunnel_services %} | ||
[{{service.name}}] | ||
accept = {{service.accept}} | ||
connect= {{service.connect}} | ||
connect = {{service.connect}} | ||
{% if stunnel_use_psk %} | ||
ciphers = PSK | ||
PSKsecrets = /etc/stunnel/psk.txt | ||
{% endif %} | ||
|
||
{% endfor %} |