From 79c246e768af87308dfdc331d1a77ecfb6b4efed Mon Sep 17 00:00:00 2001 From: Aleksaner Cynarski Date: Mon, 29 May 2017 11:43:57 +0200 Subject: [PATCH] Initial commit --- LICENSE | 8 ++++++++ README.md | 3 +++ consul/conf/bootstrap.json | 9 +++++++++ consul/install.sh | 13 +++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 consul/conf/bootstrap.json create mode 100755 consul/install.sh diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1f4f761 --- /dev/null +++ b/LICENSE @@ -0,0 +1,8 @@ +MIT License +Copyright (c) 2017 Aleksander Cynarski + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fdb3ada --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Swarm init devops + +![xeno](https://xenomorph.tk/img/logo.png) diff --git a/consul/conf/bootstrap.json b/consul/conf/bootstrap.json new file mode 100644 index 0000000..00e9951 --- /dev/null +++ b/consul/conf/bootstrap.json @@ -0,0 +1,9 @@ +{ + "bootstrap": true, + "server": true, + "datacenter": "swarm", + "data_dir": "/opt/swarm", + "log_level": "INFO", + "enable_syslog": true, + "encrypt": "##key##" +} diff --git a/consul/install.sh b/consul/install.sh new file mode 100755 index 0000000..4db2eea --- /dev/null +++ b/consul/install.sh @@ -0,0 +1,13 @@ +#!/bin/bash +URL="https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_arm.zip" +FILE="consul_0.8.3_linux_arm.zip" +UNZIP=`which unzip` +CURL=`which curl` +$CURL $URL -o $FILE +$UNZIP $FILE +mv consul /usr/bin/ +rm $FILE +mkdir -p /etc/consul.d/{bootstrap,server,client} +#cp conf/bootstrap.json /etc/consul.d/bootstrap/config.json +KEY=`consul keygen` +sed -i -e 's/##key##/$KEY/g' conf/bootstrap.json > /etc/consul.d/bootstrap/config.json