summaryrefslogtreecommitdiff
path: root/global/pre-tasks.d
diff options
context:
space:
mode:
Diffstat (limited to 'global/pre-tasks.d')
-rwxr-xr-xglobal/pre-tasks.d/020common-tools4
-rwxr-xr-xglobal/pre-tasks.d/040hiera-gpg7
2 files changed, 8 insertions, 3 deletions
diff --git a/global/pre-tasks.d/020common-tools b/global/pre-tasks.d/020common-tools
index eaca6ea..563fab2 100755
--- a/global/pre-tasks.d/020common-tools
+++ b/global/pre-tasks.d/020common-tools
@@ -5,10 +5,10 @@
set -e
-stamp="$COSMOS_BASE/stamps/common-tools-v01.stamp"
+stamp="$COSMOS_BASE/stamps/common-tools-v02.stamp"
if ! test -f $stamp; then
- apt-get -y install vim traceroute tcpdump molly-guard less rsync git-core unattended-upgrades ntp
+ apt-get -y update && apt-get -y upgrade && apt-get -y install vim traceroute tcpdump molly-guard less rsync git-core unattended-upgrades ntp wget
update-alternatives --set editor /usr/bin/vim.basic
mkdir -p `dirname $stamp`
diff --git a/global/pre-tasks.d/040hiera-gpg b/global/pre-tasks.d/040hiera-gpg
index e5de6da..0ef2d86 100755
--- a/global/pre-tasks.d/040hiera-gpg
+++ b/global/pre-tasks.d/040hiera-gpg
@@ -14,8 +14,12 @@ if [ ! -f /usr/lib/ruby/vendor_ruby/gpgme.rb ]; then
apt-get -y install ruby-gpgme
fi
+# this is useful to make the cmdline hiera tool work
+if [ -f /etc/hiera/data/secrets.yaml.asc -a ! -f /etc/hiera/data/secrets.yaml.gpg ]; then
+ (cd /etc/hiera/data && ln -s secrets.yaml.asc secrets.yaml.gpg)
+fi
-if [ ! -s $GNUPGHOME/secring.gpg ]; then
+if [ ! -s $GNUPGHOME/secring.gpg -a ! -s /etc/hiera/gpg/pubring.kbx ]; then
if [ "x$1" != "x--force" ]; then
echo ""
@@ -44,6 +48,7 @@ Name-Comment: Hiera GPG key
Name-Email: root@`hostname --fqdn`
Expire-Date: 0
# Do a commit here, so that we can later print "done" :-)
+%no-protection
%commit
%echo done
EOF