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