forked from XSCE/xsce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runansible
executable file
·53 lines (41 loc) · 976 Bytes
/
runansible
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
50
51
52
53
#!/bin/bash
# copy var files to /etc/xsce for subsequent use
./install-init
# if not the first run, repo location is here
if [ -f /etc/xsce/xsce.env ]
then
. /etc/xsce/xsce.env
cd $XSCE_DIR
fi
if [ ! -f xsce.yml ]
then
echo "XSCE Playbook not found."
echo "Please run this command from the top level of the git repo."
echo "Exiting."
exit
fi
PLAYBOOK="xsce.yml"
INVENTORY="ansible_hosts"
CWD=`pwd`
echo "Running local playbooks! "
XSDOMAIN=""
# Pass in Existing Domain
if [ -f /etc/sysconfig/xs_domain_name ]
then
XSDOMAIN=`cat /etc/sysconfig/xs_domain_name`
fi
# Or accept Domain on command line
if [ x"$1" != x ]
then
XSDOMAIN=$1
fi
# Pass in git location
if [ x"$XSDOMAIN" != x ]
then
ARGS="--extra-vars '{\"xsce_domain\":\"$XSDOMAIN\"}'"
else
ARGS=""
fi
export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-install.log"
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local