summaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 20:13:55 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 20:13:55 +0100
commitd04542e000b8f8fadce45af96d93fb904ca99115 (patch)
treee85ee2bb0472d9f83f051f31d2629bf4c96bb755 /run
parentSetup new site.pp. (diff)
parentMigrate stuff from ansible. (diff)
downloadwebdav_server-d04542e000b8f8fadce45af96d93fb904ca99115.tar.gz
webdav_server-d04542e000b8f8fadce45af96d93fb904ca99115.tar.xz
Merge branch 'master' of /home/hugo/puppet into production
Diffstat (limited to 'run')
-rwxr-xr-xrun26
1 files changed, 26 insertions, 0 deletions
diff --git a/run b/run
new file mode 100755
index 0000000..789d1b6
--- /dev/null
+++ b/run
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Needed on ubuntu, since this path is not set for root
+# Arch installs puppet in /usr/bin/puppet.
+export PATH="/opt/puppetlabs/bin/:$PATH"
+
+osid=$(awk -F= '/^ID=/ { print $2 }' /etc/os-release)
+
+# This is the WRONG way to do it, but it sholud work for now
+case $osid in
+ ubuntu)
+ modpath=/etc/puppetlabs/code/environments/production/modules
+ ;;
+ arch)
+ modpath=/etc/puppetlabs/code/modules/
+ ;;
+esac
+
+set -x
+
+sudo env PATH="/opt/puppetlabs/bin/:$PATH" \
+ puppet apply \
+ --modulepath="$PWD/modules:${modpath}" \
+ manifests \
+ --verbose \
+ "$@"