aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-23 19:42:32 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-23 19:42:32 -0200
commit1bfffe2e0adff6e44ec33726988b64f95ea2f599 (patch)
treefaee925240714b633218448633c841f0de89dbe1 /bin
parent5512c493e13998d4c83d7eab3d89e5a1c0836566 (diff)
downloaddebian-1bfffe2e0adff6e44ec33726988b64f95ea2f599.tar.gz
debian-1bfffe2e0adff6e44ec33726988b64f95ea2f599.tar.bz2
Squashed 'puppet/' changes from 8f7043a..59b7f11
59b7f11 Rollback sshd::print_motd 29e15a3 Set sshd::print_motd to yes 8a13cb5 Post-receive: git submodule sync d0d65d6 Ignore ssl, unignore modules 662bf5a Exclude also .git at provision_rsync_opts 745b98a Configure provision_rsync_opts at kvmxfile 1434057 Set default backupninja::keystore 36de179 Use scripts from /etc/puppet at kvmxfile provision_command fe2d343 Fixes provision_command at kvmxfile 0a45a48 Use puppet hostname at kvmxfile e3a3408 Updates kvmxfile 8648b94 Adds kvmxfile 07b03c2 Deploy: check for sudo config c6414a8 Removes examples 6507997 Cleanup manifests e867618 Fetch submodules using https ee8938e Use projects.list on mrconfig 9e67e02 Support for compiled config ceddd20 Cleanup TODO 6dad16a Adds modules folder 6f98b51 Updates hiera mount location 48f2491 Removes templates 319bdcb Cleanup modules folder 84516c6 Updates TODO a43c2f9 Updates README ca1735f Updates TODO a67e9d4 TODO: vagrant issues 2838e86 Updates TODO 9662168 Updates TODO afa676d Rename default box 58b18e5 Updates TODO 20858dc Updates TODO cd876e6 Default eyaml extension 3645ef8 Adds eyaml backend into hiera config 158f12a Adds hiera-eyaml into DEVELOP_DEPENDENCIES ec33fd1 Adds keys into .gitignore 490f2e2 Adds hiera-eyaml into DEPLOY_DEPENDENCIES 7d1fc96 Fix site_users inheritance 80088c7 Remove usb-utils from deployment dependencies 03764c2 Deploy: check for rsync 5eb3983 Updates git vhost 739c79f Test deployment without git reset c8a14ca Preload HSTS e096f08 Deploy: setup DEPLOY_DEPENDENCIES 0a4a8cc Config cleanup ace1840 Do not install storedconfigs dependencies on provision b83d85a Check for puppet.conf on provision 54c68a0 Default SSH config 56e4bea Updates TODO 51c1763 Comment wheezy dependencies specifics 3cc7d47 Removes key folder 41b8ef0 Fix deploy dependencies 64b8d70 Deploy dependencies, TODO update 6051509 Cleanup storedconfigs dependencies 1cf6e4b TODO ordering 9de3634 Updates TODO 2cf2a3b Drop pear 4048095 Get rid of storedconfigs 2eeb10b Updates TODO e678885 Fix manifest lookup on deployment 9078cac Updates Vagrantfile with new config folder 0cb845b Updates TODO b75d0f3 Rename 'hiera' to 'config' ae7cfbd Updates TODO 28e3e25 Cleanup unused, old and broken submodules deaf0de Updates TODO c33d108 Updates TODO 15abd2e Removes post-update hook 8a14f6d Deploy: dependency: augeas-tools c71aa65 Updates TODO 4c5f117 Development dependencies 73d6006 Deploy: dependencies in a single place 364912a Adds examples 85d41ce Hiera cleanup e4d5f1b Updates TODO 08bd8b7 Deploy fixes 15c0293 TODO cleanup 51b910e Updates TODO 4580c2e Updates TODO 69d46bf More TODO cleanup 0c91d41 More TODO cleanup cee91df More TODO cleanup 082c901 Updates TODO cleanup d088390 Updates TODO d721391 Updates TODO 6ec4ac1 Updates TODO ebfed6b About collected resources patch 3529cff Updates TODO 701ed3b Removes post-update hook 4a684e7 Updates TODO 4b85c5e Updates TODO b50dbb6 Removes icecast module 907ffde Deploy: support for default.pp dc8de77 Cleanup proxy template git-subtree-dir: puppet git-subtree-split: 59b7f114e4db75aa3d134b8d2d8a3a36271f37d7
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dependencies33
-rwxr-xr-xbin/deploy14
-rwxr-xr-xbin/mrconfig7
-rwxr-xr-xbin/post-receive12
-rwxr-xr-xbin/post-update16
-rwxr-xr-xbin/provision11
6 files changed, 51 insertions, 42 deletions
diff --git a/bin/dependencies b/bin/dependencies
index 507145b..4330730 100755
--- a/bin/dependencies
+++ b/bin/dependencies
@@ -3,6 +3,26 @@
# Puppet bootstrap dependencies.
#
+# Parameters
+BASENAME="`basename $0`"
+DEPLOY_DEPENDENCIES="rsync puppet-common hiera-eyaml"
+DEVELOP_DEPENDENCIES="git mr whois hiera-eyaml"
+
+# Additional wheezy dependencies if not using puppet-common from wheezy-backports
+#if [ "`head -c 1 /etc/debian_version`" == '7' ]; then
+# DEPLOY_DEPENDENCIES="$DEPLOY_DEPENDENCIES ruby-hiera-puppet"
+#fi
+
+# Set sudo config
+if [ "`whoami`" != 'root' ]; then
+ SUDO="sudo"
+
+ if ! sudo -n true; then
+ echo "Please set passwordless sudo."
+ exit 1
+ fi
+fi
+
# Install a package, thanks to the Hydra Suite.
function provision_package {
if [ -z "$1" ]; then
@@ -17,12 +37,9 @@ function provision_package {
fi
}
-# Set sudo config
-if [ "`whoami`" != 'root' ]; then
- SUDO="sudo"
-fi
-
# Ensure basic packages are installed.
-for package in puppet git mr whois; do
- provision_package $package
-done
+if [ "$BASENAME" == "dependencies" ]; then
+ for package in $DEVELOP_DEPENDENCIES; do
+ provision_package $package
+ done
+fi
diff --git a/bin/deploy b/bin/deploy
index 5d3361b..22065dc 100755
--- a/bin/deploy
+++ b/bin/deploy
@@ -6,7 +6,6 @@
# Parameters
DIRNAME="`dirname $0`"
BASEDIR="$DIRNAME/.."
-DEPLOY_DEPENDENCIES="puppet ruby-sqlite3 ruby-activerecord ruby-activerecord-deprecated-finders"
# Determine hostname
if [ ! -z "$1" ]; then
@@ -15,10 +14,15 @@ else
FQDN="`cat /etc/hostname`"
fi
-# Check for manifest
-PUPPET_MANIFEST="$BASEDIR/puppet/manifests/nodes/$FQDN.pp"
+# Set manifest
+PUPPET_MANIFEST="$BASEDIR/manifests/nodes/$FQDN.pp"
if [ ! -e "$PUPPET_MANIFEST" ]; then
- echo "file not found: $PUPPET_MANIFEST"
+ PUPPET_MANIFEST="$BASEDIR/manifests/nodes/default.pp"
+fi
+
+# Check manifest
+if [ ! -e "$PUPPET_MANIFEST" ]; then
+ echo "No manifest found for $FQDN"
exit 1
fi
@@ -54,5 +58,5 @@ if [ -d "$BASEDIR/puppet/files/patches/$DIST" ]; then
fi
# Run puppet apply
-PUPPET_OPTS="--confdir=$BASEDIR/puppet --modulepath=$BASEDIR/puppet/modules"
+PUPPET_OPTS="--confdir=$BASEDIR --modulepath=$BASEDIR/modules"
LC_ALL=C $SUDO puppet apply $PUPPET_OPTS $PUPPET_MANIFEST
diff --git a/bin/mrconfig b/bin/mrconfig
index dc753ac..48815c1 100755
--- a/bin/mrconfig
+++ b/bin/mrconfig
@@ -5,7 +5,7 @@
# Parameters
GIT="git.fluxo.info"
-URL="https://$GIT/?a=project_index"
+URL="https://$GIT/projects.list"
CWD="`pwd`"
WORK="`dirname $0`/.."
@@ -15,13 +15,12 @@ rm -f .mrconfig
touch .mrconfig
# Fetch repository list and updtate mrconfig
-curl --stderr - $URL | grep "^puppet-" | cut -d ' ' -f 1 | while read module; do
+curl --stderr - $URL | grep "^puppet-" | cut -d ' ' -f 1 | sed -e 's/\.git$//' | while read module; do
folder="`echo $module | sed -e 's/^puppet-//'`"
- folder="`basename $folder .git`"
if [ "$folder" != "bootstrap" ]; then
echo "Processing $folder..."
- mr config puppet/modules/$folder checkout="git clone git://$GIT/$module $folder"
+ mr config puppet/modules/$folder checkout="git clone https://$GIT/$module $folder"
fi
done
diff --git a/bin/post-receive b/bin/post-receive
index 996189d..e6baa07 100755
--- a/bin/post-receive
+++ b/bin/post-receive
@@ -3,5 +3,15 @@
cd ..
unset GIT_DIR
-git checkout -f
+if [ -d ".git/annex" ]; then
+ git annex sync
+else
+ #git reset HEAD
+ git checkout -f
+fi
+
+git submodule sync --recursive
git submodule update --init --recursive
+
+cd -
+exec git update-server-info
diff --git a/bin/post-update b/bin/post-update
deleted file mode 100755
index 48a6a16..0000000
--- a/bin/post-update
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-cd ..
-unset GIT_DIR
-
-if [ -d ".git/annex" ]; then
- git annex sync
-else
- git reset HEAD
- git checkout -f
-fi
-
-git submodule update --init --recursive
-
-cd -
-exec git update-server-info
diff --git a/bin/provision b/bin/provision
index 16f102f..99cb862 100755
--- a/bin/provision
+++ b/bin/provision
@@ -13,23 +13,18 @@ source $DIRNAME/dependencies
$SUDO apt-get update && DEBIAN_FRONTEND=noninteractive $SUDO apt-get dist-upgrade -y && $SUDO apt-get autoremove -y && $SUDO apt-get clean
# Ensure additional dependencies are installed.
-for package in usbutils; do
- provision_package $package
-done
-
-# Storeconfigs support
-for package in ruby-sqlite3 ruby-activerecord ruby-activerecord-deprecated-finders; do
+for package in $DEPLOY_DEPENDENCIES; do
provision_package $package
done
# Link hiera configuration if needed.
if [ ! -h "/etc/puppet/hiera.yaml" ]; then
$SUDO rm -f /etc/puppet/hiera.yaml
- $SUDO ln -s $DIRNAME/../hiera/hiera.yaml /etc/puppet/hiera.yaml
+ $SUDO ln -s $DIRNAME/../config/hiera.yaml /etc/puppet/hiera.yaml
fi
# Link puppet configuration if needed.
-if [ ! -h "/etc/puppet/puppet.conf" ]; then
+if [ ! -h "/etc/puppet/puppet.conf" ] && [ -e "$DIRNAME/../puppet.conf" ]; then
$SUDO rm -f /etc/puppet/puppet.conf
$SUDO ln -s $DIRNAME/../puppet.conf /etc/puppet/puppet.conf
fi