From db66327da15391a95ef8b879398178b1dafd8a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 13 Jul 2021 19:33:11 +0200 Subject: Spice up run script. --- run | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'run') diff --git a/run b/run index b267ab7..c9e150c 100755 --- a/run +++ b/run @@ -1,4 +1,20 @@ #!/bin/bash -sudo /opt/puppetlabs/bin/puppet apply manifests \ - --modulepath=/etc/puppetlabs/code/environments/production/modules:modules +# Needed on ubuntu, since this path is not set for root +# Arch installs puppet in /usr/bin/puppet. +export PATH="/opt/puppetlabs/bin/puppet:$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 + +sudo puppet apply manifests \ + --modulepath="${modpath}:modules" -- cgit v1.2.3