rsyslog_install.sh
1.05 KB
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
54
55
#! /bin/bash
#source /home/master/ansible/ansible/hacking/env-setup
work_path=$(dirname $(readlink -f $0))
module=''
inventory=${work_path}/hosts
ssh_key=''
user=''
usage(){
echo " sh rsyslog_install.sh -m module -i hosts -u user -s private_key
this command will install rsyslog on module in hosts , ssh hosts with user and private_key
"
}
install(){
ansible-playbook -i ${inventory} -u ${user} --private-key ${ssh_key} -s --extra-vars "src_path=${work_path} module=${module}" rsyslog.yaml
exit 0
}
while [ $# -gt 0 ];do
case $1 in
-m)
shift
module=$1
shift
;;
-i)
shift
inventory=$1
shift
;;
-s)
shift
ssh_key=$1
shift
;;
-u)
shift
user=$1
shift
;;
-h)
usage
exit 0
;;
\?)
usage
exit 1
;;
esac
done
install