From 297e4f02c53fa9865d93b156fbcc8802eb560d5f Mon Sep 17 00:00:00 2001 From: Shane O'Grady Date: Tue, 15 Mar 2016 14:01:56 -0300 Subject: [PATCH] Move scripts to a shared directory --- terraform/aws/consul.tf | 8 ++++---- terraform/{aws => shared}/scripts/debian_upstart.conf | 2 +- terraform/{aws => shared}/scripts/install.sh | 4 ++-- terraform/{aws => shared}/scripts/ip_tables.sh | 0 terraform/{aws => shared}/scripts/rhel_consul.service | 0 terraform/{aws => shared}/scripts/rhel_upstart.conf | 0 terraform/{aws => shared}/scripts/service.sh | 0 7 files changed, 7 insertions(+), 7 deletions(-) rename terraform/{aws => shared}/scripts/debian_upstart.conf (96%) rename terraform/{aws => shared}/scripts/install.sh (94%) rename terraform/{aws => shared}/scripts/ip_tables.sh (100%) rename terraform/{aws => shared}/scripts/rhel_consul.service (100%) rename terraform/{aws => shared}/scripts/rhel_upstart.conf (100%) rename terraform/{aws => shared}/scripts/service.sh (100%) diff --git a/terraform/aws/consul.tf b/terraform/aws/consul.tf index ce5d6f0a7..3deeb4f51 100644 --- a/terraform/aws/consul.tf +++ b/terraform/aws/consul.tf @@ -16,7 +16,7 @@ resource "aws_instance" "server" { } provisioner "file" { - source = "${path.module}/scripts/${lookup(var.service_conf, var.platform)}" + source = "${path.module}/../shared/scripts/${lookup(var.service_conf, var.platform)}" destination = "/tmp/${lookup(var.service_conf_dest, var.platform)}" } @@ -30,9 +30,9 @@ resource "aws_instance" "server" { provisioner "remote-exec" { scripts = [ - "${path.module}/scripts/install.sh", - "${path.module}/scripts/service.sh", - "${path.module}/scripts/ip_tables.sh", + "${path.module}/../shared/scripts/install.sh", + "${path.module}/../shared/scripts/service.sh", + "${path.module}/../shared/scripts/ip_tables.sh", ] } } diff --git a/terraform/aws/scripts/debian_upstart.conf b/terraform/shared/scripts/debian_upstart.conf similarity index 96% rename from terraform/aws/scripts/debian_upstart.conf rename to terraform/shared/scripts/debian_upstart.conf index 7c57a0efc..eb52354a7 100644 --- a/terraform/aws/scripts/debian_upstart.conf +++ b/terraform/shared/scripts/debian_upstart.conf @@ -15,7 +15,7 @@ script # Make sure to use all our CPUs, because Consul can block a scheduler thread export GOMAXPROCS=`nproc` - # Get the public IP + # Get the local IP BIND=`ifconfig eth0 | grep "inet addr" | awk '{ print substr($2,6) }'` exec /usr/local/bin/consul agent \ diff --git a/terraform/aws/scripts/install.sh b/terraform/shared/scripts/install.sh similarity index 94% rename from terraform/aws/scripts/install.sh rename to terraform/shared/scripts/install.sh index 9c392606b..08e2fdffb 100644 --- a/terraform/aws/scripts/install.sh +++ b/terraform/shared/scripts/install.sh @@ -36,7 +36,7 @@ then echo "Installing Upstart service..." sudo mkdir -p /etc/consul.d sudo mkdir -p /etc/service - sudo chown root:root /tmp/upstart.conf + sudo chown root:root /tmp/upstart.conf sudo mv /tmp/upstart.conf /etc/init/consul.conf sudo chmod 0644 /etc/init/consul.conf sudo mv /tmp/consul_flags /etc/service/consul @@ -44,7 +44,7 @@ then else echo "Installing Systemd service..." sudo mkdir -p /etc/systemd/system/consul.d - sudo chown root:root /tmp/consul.service + sudo chown root:root /tmp/consul.service sudo mv /tmp/consul.service /etc/systemd/system/consul.service sudo chmod 0644 /etc/systemd/system/consul.service sudo mv /tmp/consul_flags /etc/sysconfig/consul diff --git a/terraform/aws/scripts/ip_tables.sh b/terraform/shared/scripts/ip_tables.sh similarity index 100% rename from terraform/aws/scripts/ip_tables.sh rename to terraform/shared/scripts/ip_tables.sh diff --git a/terraform/aws/scripts/rhel_consul.service b/terraform/shared/scripts/rhel_consul.service similarity index 100% rename from terraform/aws/scripts/rhel_consul.service rename to terraform/shared/scripts/rhel_consul.service diff --git a/terraform/aws/scripts/rhel_upstart.conf b/terraform/shared/scripts/rhel_upstart.conf similarity index 100% rename from terraform/aws/scripts/rhel_upstart.conf rename to terraform/shared/scripts/rhel_upstart.conf diff --git a/terraform/aws/scripts/service.sh b/terraform/shared/scripts/service.sh similarity index 100% rename from terraform/aws/scripts/service.sh rename to terraform/shared/scripts/service.sh