summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorckonstanski <ckonstanski@pippiandcarlos.com>2018-01-16 22:06:55 +0000
committerckonstanski <ckonstanski@pippiandcarlos.com>2018-01-16 22:06:55 +0000
commita383390d27c496b7e33768914f0df19b80657d64 (patch)
treebb67dd08ab5127247d361bddb05a6017772b2d63
parenta263210661010e35542659e8ecd9fc8c2b779997 (diff)
autocommit Tue Jan 16 22:06:55 UTC 2018
-rw-r--r--playbooks/ssl.yaml49
1 files changed, 26 insertions, 23 deletions
diff --git a/playbooks/ssl.yaml b/playbooks/ssl.yaml
index fad5563..bc72779 100644
--- a/playbooks/ssl.yaml
+++ b/playbooks/ssl.yaml
@@ -1,24 +1,27 @@
---
-- 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 }}"
+- name: "SSl cert"
+ hosts: target
+ tasks:
+ - 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 }}"