Trying to fix when file does not exist
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
replace: dest='/etc/default/haproxy'
|
||||
regexp='ENABLED=0'
|
||||
replace='ENABLED=1'
|
||||
when: haproxy_init|failed
|
||||
when: not haproxy_init.exists
|
||||
|
||||
- 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|failed
|
||||
when: not ssl.exists
|
||||
|
||||
- name: Create pem file
|
||||
shell: cat /root/server.crt /root/server.key > /root/server.pem
|
||||
when: ssl|failed
|
||||
when: not ssl.exists
|
||||
|
||||
- name: Restart haproxy
|
||||
service: name=haproxy state=restarted
|
||||
|
||||
Reference in New Issue
Block a user