File tree 1 file changed +7
-2
lines changed
roles/StackStorm.st2web/tasks
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 49
49
# RedHat 7 comes with openssl 1.0.2k-fips which requires an extra openssl.conf to specify the SAN
50
50
become : yes
51
51
block :
52
+ - name : Check if there is already an existing key file
53
+ stat :
54
+ path : /etc/ssl/st2/st2.key
55
+ register : keyfile
52
56
- name : Render openssl.cnf
53
57
ansible.builtin.template :
54
58
src : openssl.cnf.j2
55
59
dest : /tmp/openssl.cnf
56
60
mode : ' 0644'
61
+ when : not keyfile.stat.exists
57
62
- name : Generate self-signed SSL certificate on RedHat 7
58
63
shell : openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/st2/st2.key -out /etc/ssl/st2/st2.crt -days 365 -nodes -subj "/C=US/ST=California/L=Palo Alto/O=StackStorm/OU=Information Technology/CN=$(hostname)" -config /tmp/openssl.cnf
59
- args :
60
- creates : /etc/ssl/st2/st2.key
61
64
notify :
62
65
- restart nginx
66
+ when : not keyfile.stat.exists
63
67
- name : Delete the openssl.cnf
64
68
ansible.builtin.file :
65
69
path : /tmp/openssl.cnf
66
70
state : absent
71
+ when : not keyfile.stat.exists
67
72
when :
68
73
- not st2web_ssl_certificate
69
74
- not st2web_ssl_certificate_key
You can’t perform that action at this time.
0 commit comments