fix the Makefile and a shell script
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
26a31c5d63
commit
37b4e558b2
15
Makefile
15
Makefile
|
@ -2,8 +2,8 @@ OS = $(strip $(shell uname -s))
|
||||||
ARCH = linux_amd64
|
ARCH = linux_amd64
|
||||||
PLATFORM = linux
|
PLATFORM = linux
|
||||||
ifeq ($(OS),Darwin)
|
ifeq ($(OS),Darwin)
|
||||||
ARCH = darwin_amd64
|
ARCH = darwin_amd64
|
||||||
PLATFORM = darwin
|
PLATFORM = darwin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PLUGIN_DIR = ~/.terraform.d/plugins
|
PLUGIN_DIR = ~/.terraform.d/plugins
|
||||||
|
@ -31,11 +31,6 @@ install-provisioner:
|
||||||
init-terraform:
|
init-terraform:
|
||||||
terraform init -upgrade=true
|
terraform init -upgrade=true
|
||||||
|
|
||||||
ssh-config: export SSH_CONFIG_DIR := ~/.ssh/config.d
|
|
||||||
ssh-config: export SSH_CONFIG_FILE := infra-nimbus
|
|
||||||
ssh-config: export SSH_USERNAME := $$(whoami)
|
|
||||||
scripts/create-ssh-config.sh
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
@echo "Saving Consul certificates: ansible/files/consul*"
|
@echo "Saving Consul certificates: ansible/files/consul*"
|
||||||
pass services/consul/ca-crt > ansible/files/consul-ca.crt
|
pass services/consul/ca-crt > ansible/files/consul-ca.crt
|
||||||
|
@ -45,3 +40,9 @@ secrets:
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
rm -r $(PLUGIN_DIR)/$(ARCHIVE)
|
rm -r $(PLUGIN_DIR)/$(ARCHIVE)
|
||||||
|
|
||||||
|
ssh-config: export SSH_CONFIG_DIR ?= $(HOME)/.ssh/config.d
|
||||||
|
ssh-config: export SSH_CONFIG_FILE ?= infra-nimbus
|
||||||
|
ssh-config: export SSH_USERNAME ?= $(USER)
|
||||||
|
ssh-config:
|
||||||
|
scripts/create-ssh-config.sh
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/usr/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
cd $(dirname "$0")
|
cd $(dirname "$0")/..
|
||||||
|
|
||||||
if [[ "${SSH_CONFIG_DIR}" == "" ]]; then
|
if [[ "${SSH_CONFIG_DIR}" == "" ]]; then
|
||||||
echo Please specify the SSH_CONFIG_DIR environment variable
|
echo Please specify the SSH_CONFIG_DIR environment variable
|
||||||
|
@ -19,9 +19,8 @@ INFRA_NIMBUS_SSH_CONFIG="${SSH_CONFIG_DIR}/${SSH_CONFIG_FILE}"
|
||||||
mkdir -p "${SSH_CONFIG_DIR}" && chmod 700 "${SSH_CONFIG_DIR}"
|
mkdir -p "${SSH_CONFIG_DIR}" && chmod 700 "${SSH_CONFIG_DIR}"
|
||||||
rm -f "${INFRA_NIMBUS_SSH_CONFIG}"
|
rm -f "${INFRA_NIMBUS_SSH_CONFIG}"
|
||||||
|
|
||||||
for host in $(ansible all -i ../ansible/inventory/test --list-hosts | grep -v 'hosts')
|
for host in $(ansible all -i ansible/inventory/test --list-hosts | grep -v 'hosts'); do
|
||||||
do
|
cat << EOF >> "${INFRA_NIMBUS_SSH_CONFIG}"
|
||||||
cat << EOF >> "${INFRA_NIMBUS_SSH_CONFIG}"
|
|
||||||
Host nimbus-$host
|
Host nimbus-$host
|
||||||
Hostname $host.statusim.net
|
Hostname $host.statusim.net
|
||||||
User ${SSH_USERNAME}
|
User ${SSH_USERNAME}
|
||||||
|
|
Loading…
Reference in New Issue