Still trying to fix if server.pem does not exist

This commit is contained in:
2016-02-16 09:50:01 -05:00
parent bfae0a52a2
commit 2101d9e69a

View File

@@ -22,7 +22,7 @@
replace: dest='/etc/default/haproxy'
regexp='ENABLED=0'
replace='ENABLED=1'
when: haproxy_init.exists == False
when: haproxy_init.stat.exists == True
- name: ssl key exits
stat: path=/root/server.pem
@@ -31,11 +31,11 @@
- name: Generate self signed key
shell: openssl req -new -newkey rsa:4096 -sha256 -subj '/CN=home/O=home LTD./C=US' -x509 -nodes -keyout /root/server.key -out /root/server.crt
when: ssl.exists == False
when: ssl.stat.exists == False
- name: Create pem file
shell: cat /root/server.crt /root/server.key > /root/server.pem
when: ssl.exists == False
when: ssl.stat.exists == False
- name: Restart haproxy
service: name=haproxy state=restarted