-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit a shell script for quick installation and configuration of vPo…
…ller
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Bootstrap script for one-time setup of vPoller on Debian GNU/Linux systems | ||
|
||
set -e | ||
|
||
echo ">>> This script will install and configure vPoller" | ||
echo ">>> It installs packages and dependencies into system-wide locations" | ||
read -p ">>> Press ENTER to continue or CTRL-C to abort now ..." _answer | ||
|
||
apt-get update | ||
apt-get -y install gcc g++ git automake autoconf libtool python-pip python-dev | ||
apt-get -y autoremove | ||
|
||
# Install libzmq | ||
libzmq_dir=$( mktemp -d /tmp/libzmq.XXXXXX ) | ||
echo ">>> Installing libzmq ..." | ||
git clone https://github.com/zeromq/zeromq4-x.git ${libzmq_dir} | ||
cd ${libzmq_dir} | ||
./autogen.sh | ||
./configure | ||
make && make install && make clean | ||
ldconfig | ||
|
||
# Installing vPoller | ||
vpoller_dir=$( mktemp -d /tmp/vpoller.XXXXXX ) | ||
echo ">>> Installing vPoller ..." | ||
git clone https://github.com/dnaeon/py-vpoller.git ${vpoller_dir} | ||
cd ${vpoller_dir} | ||
python setup.py install | ||
|
||
echo ">>> Building vPoller C Client ..." | ||
cd src/vpoller-cclient | ||
make && install vpoller-cclient /usr/local/bin | ||
|
||
echo ">>> Setting up init.d scripts ..." | ||
cd ${vpoller_dir} | ||
install src/init.d/vpoller-proxy /etc/init.d | ||
install src/init.d/vpoller-worker /etc/init.d | ||
update-rc.d vpoller-proxy defaults | ||
update-rc.d vpoller-worker defaults | ||
|
||
# Configuring vPoller | ||
echo ">>> Configuring vPoller ..." | ||
mkdir -p /etc/vpoller /var/run/vpoller /var/log/vpoller /var/lib/vconnector | ||
|
||
cat > /etc/vpoller/vpoller.conf <<__EOF__ | ||
[proxy] | ||
frontend = tcp://*:10123 | ||
backend = tcp://*:10124 | ||
mgmt = tcp://*:9999 | ||
[worker] | ||
db = /var/lib/vconnector/vconnector.db | ||
proxy = tcp://localhost:10124 | ||
mgmt = tcp://*:10000 | ||
__EOF__ | ||
|
||
echo ">>> Initializing vConnector database ..." | ||
vconnector-cli init | ||
|
||
# Post-install | ||
echo ">>> Removing no longer needed directories ..." | ||
rm -rf ${libzmq_dir} | ||
rm -rf ${vpoller_dir} | ||
|
||
echo "" | ||
echo ">>> Install completed" | ||
echo ">>> vPoller has been installed and configured" | ||
echo "" | ||
echo ">>> In order to add and enable a vSphere host execute the command below:" | ||
echo " $ sudo vconnector-cli -H vc01.example.org -U username -P password add" | ||
echo " $ sudo vconnector-cli -H vc01.example.org enable" | ||
echo "" | ||
echo ">>> Start vPoller Proxy:" | ||
echo " $ sudo service vpoller-proxy start" | ||
echo "" | ||
echo ">>> Start vPoller Worker:" | ||
echo " $ sudo service vpoller-worker start" | ||
echo "" | ||
echo ">>> Example vPoller request to discover all ESXi hosts:" | ||
echo " $ vpoller-client -m host.discover -V vc01.example.org" | ||
echo "" | ||
echo ">>> Check the log files at /var/log/vpoller" | ||
echo "" | ||
echo ">>> For any issues or bugs please submit a ticket at the vPoller issue tracker:" | ||
echo " https://github.com/dnaeon/py-vpoller/issues" | ||
echo "" |