aboutsummaryrefslogtreecommitdiff
path: root/share/hydra
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-03-21 11:28:12 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-03-21 11:28:12 -0300
commit6ebba3b8240d58ae749216ffa6254b9f7d2a2b9d (patch)
tree4e9745c0c73d74cb85fe91e1113f20652bb9c4f8 /share/hydra
parente40b3514e041a4bb2aac962b639c947333365b4b (diff)
parent8addf3ea71f50050a791e618bd4511860264c0de (diff)
downloadhydra-6ebba3b8240d58ae749216ffa6254b9f7d2a2b9d.tar.gz
hydra-6ebba3b8240d58ae749216ffa6254b9f7d2a2b9d.tar.bz2
Merge branch 'master' into develop
Conflicts: TODO.md share/hydra/install share/hydra/mass share/hydractl/bootstrap share/hydractl/puppet-enable share/hydractl/system-upgrade
Diffstat (limited to 'share/hydra')
-rwxr-xr-xshare/hydra/install15
-rw-r--r--share/hydra/inventory0
-rwxr-xr-xshare/hydra/list-sites38
-rwxr-xr-xshare/hydra/mass4
l---------share/hydra/mass-update1
-rwxr-xr-xshare/hydra/puppet-finger26
-rwxr-xr-xshare/hydra/puppet-trigger32
-rwxr-xr-xshare/hydra/whereis25
8 files changed, 14 insertions, 127 deletions
diff --git a/share/hydra/install b/share/hydra/install
index 6a3c07f..00154b7 100755
--- a/share/hydra/install
+++ b/share/hydra/install
@@ -28,15 +28,14 @@ if [ -z "$NODES" ]; then
NODES="`hydra $HYDRA nodes`"
fi
-# Validation
-if [ -z "$ORIGIN" ]; then
- ORIGIN="git://git.fluxo.info/hydra.git"
-else
- ORIGIN_CONFIG="`hydra $HYDRA config git`"
+# Get origin
+ORIGIN_CONFIG="`hydra $HYDRA config git`"
- if [ ! -z "$ORIGIN_CONFIG" ]; then
- ORIGIN="$ORIGIN_CONFIG/hydra.git"
- fi
+# Validate origin
+if [ ! -z "$ORIGIN_CONFIG" ]; then
+ ORIGIN="$ORIGIN_CONFIG/hydra.git"
+else
+ ORIGIN="git://git.fluxo.info/hydra.git"
fi
# Deploy
diff --git a/share/hydra/inventory b/share/hydra/inventory
deleted file mode 100644
index e69de29..0000000
--- a/share/hydra/inventory
+++ /dev/null
diff --git a/share/hydra/list-sites b/share/hydra/list-sites
deleted file mode 100755
index 3778e8b..0000000
--- a/share/hydra/list-sites
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/>.
-
-# Load.
-source $APP_BASE/lib/hydra/functions || exit 1
-hydra_config_load
-
-# Parameters
-BASENAME="`basename $0`"
-LAYER="$1"
-DOMAIN="`hydra $HYDRA config domain`"
-
-# Checks
-if [ -z "$LAYER" ]; then
- echo "usage: $BASENAME <node>"
- exit 1
-elif [ -z "$DOMAIN" ]; then
- echo "Please set 'domain' at $HYDRA hydra config."
- exit 1
-fi
-
-# This is crude but we're in a hurry!
-if [ -e "$PUPPET/manifests/classes/websites.pp" ]; then
- cat $PUPPET/manifests/classes/websites.pp | perl -pe 's/[,:]\n$//;' | grep $LAYER | grep apache::site | cut -d '"' -f 2
-fi
diff --git a/share/hydra/mass b/share/hydra/mass
index 928836f..a716bae 100755
--- a/share/hydra/mass
+++ b/share/hydra/mass
@@ -61,9 +61,7 @@ BASEDIR="/tmp"
set_nodes
# Validation
-if [ "$BASENAME" == "mass-update" ]; then
- COMMAND="apt-get update"
-elif [ "$BASENAME" == "mass-upgrade" ]; then
+if [ "$BASENAME" == "mass-upgrade" ]; then
COMMAND="DEBIAN_FRONTEND=noninteractive hydractl upgrade clean"
elif [ "$BASENAME" == "mass-web" ]; then
set_nodes web
diff --git a/share/hydra/mass-update b/share/hydra/mass-update
deleted file mode 120000
index 698f7d4..0000000
--- a/share/hydra/mass-update
+++ /dev/null
@@ -1 +0,0 @@
-mass \ No newline at end of file
diff --git a/share/hydra/puppet-finger b/share/hydra/puppet-finger
deleted file mode 100755
index a96800b..0000000
--- a/share/hydra/puppet-finger
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-#
-# Check puppet fingerprints, hydra perspective.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/>.
-
-# Load
-source $APP_BASE/lib/hydra/functions || exit 1
-hydra_config_load
-
-# Command line arguments
-BASENAME="`basename $0`"
-
-hydra $HYDRA mass hydractl puppet-finger
diff --git a/share/hydra/puppet-trigger b/share/hydra/puppet-trigger
deleted file mode 100755
index eba1996..0000000
--- a/share/hydra/puppet-trigger
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Execute commands in a single remote node.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/>.
-
-# Load
-source $APP_BASE/lib/hydra/functions || exit 1
-hydra_config_load
-
-# Parameters
-NODO="$1"
-
-# Connect
-if [ ! -z "$NODO" ]; then
- $HYDRA_CONNECT $NODO sudo hydractl puppet-trigger
-else
- echo "No node given."
- exit 1
-fi
diff --git a/share/hydra/whereis b/share/hydra/whereis
index 687b280..515218b 100755
--- a/share/hydra/whereis
+++ b/share/hydra/whereis
@@ -38,31 +38,18 @@ echo "--------------------------------------------------------------------------
echo ""
# Is it a node?
-if [ -e "$PUPPET/manifests/nodes/$LAYER.pp" ]; then
- echo "Defined as a node at $PUPPET/manifests/nodes/$LAYER.pp"
-
- if [ -e "$PUPPET/hiera/production/domain/$DOMAIN/node/$LAYER.$DOMAIN.yaml" ]; then
- echo "Configuration:"
- echo ""
- grep "nodo::role:" $PUPPET/hiera/production/domain/$DOMAIN/node/$LAYER.$DOMAIN.yaml
- grep "nodo::location:" $PUPPET/hiera/production/domain/$DOMAIN/node/$LAYER.$DOMAIN.yaml
- fi
-fi
-
-# Is it a website?
-if [ -e "$PUPPET/modules/site_websites" ] && \
- grep -R -e "apache::site" "$PUPPET/modules/site_websites/manifests/" | grep -q "$LAYER" ; then
- MANIFEST="$(cd $PUPPET && grep -R -e "apache::site" "modules/site_websites/manifests/" | grep "$LAYER" | cut -d : -f 1)"
-
- echo "Defined as a website on $MANIFEST:"
+if [ -e "$PUPPET/hiera/node/$LAYER.$DOMAIN.yaml" ]; then
+ echo "Defined as a node at hiera/node/$LAYER.$DOMAIN.yaml"
+ echo "Configuration:"
echo ""
- sed -n -e "/apache::site { \"$LAYER\":/,/ }/ p" $PUPPET/$MANIFEST
+ grep "nodo::role:" $PUPPET/hiera/node/$LAYER.$DOMAIN.yaml
+ grep "nodo::location:" $PUPPET/hiera/node/$LAYER.$DOMAIN.yaml
fi
# DNS config
if [ -e "$HYDRA_FOLDER/dns/$DOMAIN.conf" ]; then
echo ""
- echo "DNS configuration at $HYDRA_FOLDER/dns/$DOMAIN.conf"
+ echo "DNS configuration at dns/$DOMAIN.conf"
echo "----------------------------------------------------------------------------------"
echo ""