summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xedit-secrets4
-rw-r--r--global/overlay/etc/cosmos/keys/leifj-0AD478D6.pub57
-rw-r--r--global/overlay/etc/puppet/cosmos-rules.yaml2
-rw-r--r--global/overlay/etc/puppet/manifests/cosmos-site.pp6
-rw-r--r--global/overlay/etc/puppet/puppet.conf1
-rwxr-xr-xglobal/post-tasks.d/018packages98
l---------sto-tug-kvm-lab1.swamid.se/README (renamed from sto-tug-kvm2.swamid.se/README)0
l---------sto-tug-kvm-lab2.swamid.se/README1
-rw-r--r--wp.sunet.se/overlay/etc/hiera/data/secrets.yaml.asc23
9 files changed, 178 insertions, 14 deletions
diff --git a/edit-secrets b/edit-secrets
index 08ec257..2c05197 100755
--- a/edit-secrets
+++ b/edit-secrets
@@ -32,8 +32,8 @@ if [ "x$1" != "x-l" ]; then
trap "rm -f $TMPFILE $TMPFILE2" EXIT
- ssh -t $host /var/cache/cosmos/repo/edit-secrets -l
- scp -q $host:$LAST_OUTPUT_FILENAME $TMPFILE
+ ssh -t root@$host /var/cache/cosmos/repo/edit-secrets -l
+ scp -q root@$host:$LAST_OUTPUT_FILENAME $TMPFILE
if grep ^"STATUS=UPDATED" $TMPFILE > /dev/null; then
# extract the path of the file that should be updated in the Cosmos repo
diff --git a/global/overlay/etc/cosmos/keys/leifj-0AD478D6.pub b/global/overlay/etc/cosmos/keys/leifj-0AD478D6.pub
new file mode 100644
index 0000000..de47bd1
--- /dev/null
+++ b/global/overlay/etc/cosmos/keys/leifj-0AD478D6.pub
@@ -0,0 +1,57 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.14 (GNU/Linux)
+
+mQENBFJK9qIBCACypED81H1N4YmhMJrb4uOtTDzo+lFZDVVOcK11+NhTFl+AZZFn
+WH/7UPn+q5ZZBd/IhONfb5QGw5FzTyBWHsbAteXgCvHAIyumwhQzhZnow6myyC6/
+MwDhomT5rb3MkCKCyQMNfj/yMgL6ZRsX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+AgNCtRmgSc3HQWINbIE2pLpurfU=
+=P2xq
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/global/overlay/etc/puppet/cosmos-rules.yaml b/global/overlay/etc/puppet/cosmos-rules.yaml
index 2244c7a..137bd28 100644
--- a/global/overlay/etc/puppet/cosmos-rules.yaml
+++ b/global/overlay/etc/puppet/cosmos-rules.yaml
@@ -4,3 +4,5 @@
'^cdr\d+\.sunet\.se$':
sunet-cdr:
sunet:
+'\.swamid\.se$':
+ swamid:
diff --git a/global/overlay/etc/puppet/manifests/cosmos-site.pp b/global/overlay/etc/puppet/manifests/cosmos-site.pp
index 1e4e857..8b161a2 100644
--- a/global/overlay/etc/puppet/manifests/cosmos-site.pp
+++ b/global/overlay/etc/puppet/manifests/cosmos-site.pp
@@ -13,7 +13,7 @@ Exec {
#include cosmos::preseed
include ufw
include apt
-include cosmos
+#include cosmos
# you need a default node
@@ -275,3 +275,7 @@ class sunet-cdr {
class { 'sunet-dhcp-hosts': }
}
+
+class swamid {
+ sunet::server { 'sunet_server': }
+}
diff --git a/global/overlay/etc/puppet/puppet.conf b/global/overlay/etc/puppet/puppet.conf
index 0ba85f4..a269892 100644
--- a/global/overlay/etc/puppet/puppet.conf
+++ b/global/overlay/etc/puppet/puppet.conf
@@ -7,6 +7,7 @@ factpath=$vardir/lib/facter
templatedir=$confdir/templates
node_terminus = exec
external_nodes = /etc/puppet/cosmos_enc.py
+modulepath = /etc/puppet/modules:/etc/puppet/cosmos-modules:/usr/share/puppet/modules
[master]
# These are needed when the puppetmaster is run by passenger
diff --git a/global/post-tasks.d/018packages b/global/post-tasks.d/018packages
index 9e25e69..57dff1a 100755
--- a/global/post-tasks.d/018packages
+++ b/global/post-tasks.d/018packages
@@ -1,16 +1,92 @@
-#!/bin/sh
+#!/bin/bash
+
+CONFIG=${CONFIG:=/etc/puppet/cosmos-modules.conf}
+CACHE_DIR=/var/cache/puppet-modules
+MODULES_DIR=${MODULES_DIR:=/etc/puppet/cosmos-modules}
+GIT_TAG_PATTERN=${COSMOS_UPDATE_VERIFY_GIT_TAG_PATTERN:-multiverse*}
+export GNUPGHOME=/etc/cosmos/gnupg
python -c "import yaml" 2>/dev/null || apt-get -y install python-yaml
-if [ -f /etc/puppet/cosmos-modules.conf ]; then
- grep -E -v "^#" /etc/puppet/cosmos-modules.conf | (
- cd /etc/puppet/modules && while read module src update; do
- if [ ! -d /etc/puppet/modules/$module ]; then
- echo $src | grep -q "://" && git clone $src $module || puppet module install $src
- else
- if [ "x$update" = "xyes" ]; then
- echo $src | grep -q "://" && (cd /etc/puppet/modules/$module && git pull -q) || puppet module upgrade $src
+
+stage_module() {
+ rm -rf $CACHE_DIR/staging/$1
+ git archive --format=tar --prefix=$1/ $2 | (cd $CACHE_DIR/staging/ && tar xf -)
+}
+
+if [ -f $CONFIG ]; then
+ if [ ! -d $MODULES_DIR ]; then
+ mkdir -p $MODULES_DIR
+ fi
+ if [ ! -d $CACHE_DIR ]; then
+ mkdir -p $CACHE_DIR/{scm,staging}
+ fi
+
+ # First pass to clone any new modules, and update those marked for updating.
+ grep -E -v "^#" $CONFIG | (
+ while read module src update; do
+ # We only support git:// urls atm
+ if [ "${src:0:6}" = "git://" ]; then
+ if [ ! -d $CACHE_DIR/scm/$module ]; then
+ git clone -q $src $CACHE_DIR/scm/$module
+ elif [ -d $CACHE_DIR/scm/$module/.git ]; then
+ if [ "$update" = "yes" ]; then
+ cd $CACHE_DIR/scm/$module
+ git pull -q
+ else
+ continue
fi
- fi
- done)
+ else
+ echo "ERROR: Ignoring non-git repository"
+ continue
+ fi
+ fi
+ done
+ )
+
+ # Second pass to verify the signatures on all modules and stage those that
+ # have good signatures.
+ grep -E -v "^#" $CONFIG | (
+ while read module src update; do
+ # We only support git:// urls atm
+ if [ "${src:0:6}" = "git://" ]; then
+ # Verify git tag
+ cd $CACHE_DIR/scm/$module
+ TAG=$(git tag -l $GIT_TAG_PATTERN | sort | tail -1)
+ if [ "$COSMOS_VERBOSE" = "y" ]; then
+ echo ""
+ echo "Checking signature on tag ${TAG} for puppet-module $module"
+ fi
+ if [ -z "$TAG" ]; then
+ echo "ERROR: No git tag found for pattern '$GIT_TAG_PATTERN' on puppet-module $module"
+ continue
+ fi
+ fail=1
+ git tag -v $TAG > /dev/null 2>&1 && fail=0
+ if [ $fail == 0 ]; then
+ if [ "$COSMOS_VERBOSE" = "y" ]; then
+ # short output on good signature
+ git tag -v $TAG 2>&1 | grep "gpg: Good signature"
+ fi
+ # Put archive in staging since tag verified OK
+ stage_module $module $TAG
+ else
+ echo "################################################################"
+ echo "FAILED signature check on puppet-module $module"
+ echo "################################################################"
+ git tag -v $TAG
+ fi
+ fi
+ done
+ )
+
+ # Cleanup removed puppet modules from CACHE_DIR
+ for MODULE in $(ls -1 $CACHE_DIR/staging/); do
+ if ! grep -E -q "^$MODULE\s+" $CONFIG; then
+ rm -rf $CACHE_DIR/{scm,staging}/$MODULE
+ fi
+ done
+
+ # Installing verified puppet modules
+ rsync --archive --delete $CACHE_DIR/staging/ $MODULES_DIR/
fi
diff --git a/sto-tug-kvm2.swamid.se/README b/sto-tug-kvm-lab1.swamid.se/README
index 59a23c4..59a23c4 120000
--- a/sto-tug-kvm2.swamid.se/README
+++ b/sto-tug-kvm-lab1.swamid.se/README
diff --git a/sto-tug-kvm-lab2.swamid.se/README b/sto-tug-kvm-lab2.swamid.se/README
new file mode 120000
index 0000000..59a23c4
--- /dev/null
+++ b/sto-tug-kvm-lab2.swamid.se/README
@@ -0,0 +1 @@
+../README \ No newline at end of file
diff --git a/wp.sunet.se/overlay/etc/hiera/data/secrets.yaml.asc b/wp.sunet.se/overlay/etc/hiera/data/secrets.yaml.asc
new file mode 100644
index 0000000..bc1cd32
--- /dev/null
+++ b/wp.sunet.se/overlay/etc/hiera/data/secrets.yaml.asc
@@ -0,0 +1,23 @@
+STATUS=UPDATED
+SAVE_TO=wp.sunet.se/overlay/etc/hiera/data/secrets.yaml.asc
+
+-----BEGIN PGP MESSAGE-----
+Version: GnuPG v2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