From e3feb6d3f715849c47752471b3f6778581128442 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sun, 3 Oct 2021 12:32:42 -0400 Subject: [PATCH] [WIP] Begin adding packer config for centralized ssl termination --- prod/nginx/packer/nginx.json | 26 +++++++++++++++++++++++ prod/nginx/packer/scripts/dependencies.sh | 6 ++++++ prod/nginx/packer/scripts/nginx.sh | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 prod/nginx/packer/nginx.json create mode 100644 prod/nginx/packer/scripts/dependencies.sh create mode 100644 prod/nginx/packer/scripts/nginx.sh diff --git a/prod/nginx/packer/nginx.json b/prod/nginx/packer/nginx.json new file mode 100644 index 0000000..75ad389 --- /dev/null +++ b/prod/nginx/packer/nginx.json @@ -0,0 +1,26 @@ +{ + "builders": [ + { + "type": "digitalocean", + "image": "ubuntu-18-04-x64", + "region": "nyc1", + "size": "s-1vcpu-1gb", + "snapshot_name": "packer-nginx-{{timestamp}}", + "ssh_username": "root" + } + ], + "provisioners": [ + { + "type": "shell", + "script": "scripts/dependencies.sh" + }, + { + "type": "file", + "source": "files/nginx.conf" + }, + { + "type": "shell", + "script": "scripts/nginx.sh" + } + ] +} diff --git a/prod/nginx/packer/scripts/dependencies.sh b/prod/nginx/packer/scripts/dependencies.sh new file mode 100644 index 0000000..83696df --- /dev/null +++ b/prod/nginx/packer/scripts/dependencies.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -xe + +sudo apt-get update +sudo apt-get install -y nginx diff --git a/prod/nginx/packer/scripts/nginx.sh b/prod/nginx/packer/scripts/nginx.sh new file mode 100644 index 0000000..aaa2e54 --- /dev/null +++ b/prod/nginx/packer/scripts/nginx.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -xe + +sudo systemctl enable nginx