Skip to content

Commit

Permalink
do not evaluate bare variable as it is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
migibert committed Aug 27, 2019
1 parent 3bc4eb8 commit 5648cec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tasks/certificate.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- name: Generate key
command: openssl genrsa -out {{stunnel_key_file}} 2048
when: stunnel_certificate_generation
when: stunnel_certificate_generation | bool

- name: Generate certificate
command: openssl req -new -x509 -key {{stunnel_key_file}} -newkey rsa:4096 -keyout {{stunnel_certificate_domain}} -out {{stunnel_certificate_file}} -days {{stunnel_certificate_duration}} -nodes -subj "/C={{stunnel_certificate_country}}/ST={{stunnel_certificate_state_name}}/L={{stunnel_certificate_locality}}/O={{stunnel_certificate_organization}}/CN={{stunnel_certificate_domain}}"
when: stunnel_certificate_generation
when: stunnel_certificate_generation | bool

- name: Copy certificate
shell: cat {{stunnel_key_file}} {{stunnel_certificate_file}} >> /etc/stunnel/stunnel.pem
Expand Down
10 changes: 9 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@
dest: /etc/stunnel/stunnel.conf
register: stunnel_configuration

- name: Enable stunnel
lineinfile:
dest: /etc/default/stunnel4
state: present
regexp: ENABLED=
line: ENABLED=1
register: enable_stunnel

- name: Start stunnel service
service:
name: stunnel4
state: restarted
enabled: true
when: install_stunnel_4 is changed or stunnel_configuration is changed
when: install_stunnel_4 is changed or enable_stunnel is changed or stunnel_configuration is changed

0 comments on commit 5648cec

Please sign in to comment.