summaryrefslogtreecommitdiff
path: root/salt/openbook/ansible/files/ssl.yaml
diff options
context:
space:
mode:
authorCarlos Konstanski <ckonstanski@pippiandcarlos.com>2018-01-16 11:57:33 -0700
committerCarlos Konstanski <ckonstanski@pippiandcarlos.com>2018-01-16 11:57:33 -0700
commita392d817352de0ea6c84ca0c2023ad1506830486 (patch)
tree141251cd93e6e540c9c8f09b19b68681f65d7e6c /salt/openbook/ansible/files/ssl.yaml
parentbaa361feff5a9952b7c43f33db4f2ae1d5e0e85d (diff)
Openbook CI: make new self-signed cert for CI/CD stack
Issue: IS-56
Diffstat (limited to 'salt/openbook/ansible/files/ssl.yaml')
-rw-r--r--salt/openbook/ansible/files/ssl.yaml24
1 files changed, 24 insertions, 0 deletions
diff --git a/salt/openbook/ansible/files/ssl.yaml b/salt/openbook/ansible/files/ssl.yaml
new file mode 100644
index 0000000..6330e87
--- /dev/null
+++ b/salt/openbook/ansible/files/ssl.yaml
@@ -0,0 +1,24 @@
+---
+- name: "Create self-signed SSL cert"
+ shell:
+ cmd: |
+ if [ ! -f "/etc/ssl/certs/{{ item }}.crt" ] && [ ! -f "/etc/ssl/private/{{ item }}.key" ]; then
+ openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:4096 -keyout "/tmp/{{ item }}.key" -out "/tmp/{{ item }}.crt" <<EOF
+ US
+ New Jersey
+ Basking Ridge
+ Verizon Wireless
+ Verizon Cloud Platform
+ {{ item }}
+ carlos.konstanski@verizonwireless.com
+ EOF
+ cp -f "/tmp/{{ item }}.crt" "/etc/ssl/certs/"
+ cp -f "/tmp/{{ item }}.key" "/etc/ssl/private/"
+ chmod 644 "/etc/ssl/certs/{{ item }}.crt"
+ chown root: "/etc/ssl/certs/{{ item }}.crt"
+ chmod 640 "/etc/ssl/private/{{ item }}.key"
+ chown root:ssl-cert "/etc/ssl/private/{{ item }}.key"
+ fi
+ executable: /bin/bash
+ with_items:
+ - "{{ inventory_hostname }}"