-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·49 lines (44 loc) · 774 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·49 lines (44 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
function usage() {
echo "$0 -d <home dir> -u <user> [-g <group=eng>] help|install|test " && exit $1
}
group=sam
while getopts ':d:g:u:' opt; do
case ${opt} in
d)
home=${OPTARG}
;;
g)
group=${OPTARG}
;;
u)
user=${OPTARG}
;;
?)
usage 1
;;
esac
done
shift $((OPTIND - 1))
if [ -z "${user}" ] || [ -z "${home}" ]; then
usage 1
fi
case $1 in
install)
FACTER_user=${user} FACTER_group=${group} FACTER_home=${home} puppet apply \
--modulepath=modules \
manifests/site.pp
;;
test)
FACTER_user=${user} FACTER_group=${group} FACTER_home=${home} puppet apply \
--modulepath=modules \
--noop \
manifests/site.pp
;;
help)
usage 0
;;
*)
usage 1
;;
esac