If you haven't installed pre-requisistes yet. Please return to Pre-requisites (all methods).
- VirtualenvWrapper installation
- VirtualenvWrapper configuration
- Virtualenv creation
- Install ansible dependencies
- Clone ansible repository
- Activate ansible environment
- Auto-activate ansible environment
- Exit from your virtualenv
- Each time you want to work with OBM-Deploy
VirtualenvWrapper installation [▲](#top-page "back to top") ==============================
$ sudo apt-get install virtualenvwrapper
$ sudo yum install python-virtualenvwrapper
VirtualenvWrapper configuration [▲](#top-page "back to top") ===============================
Note Path to virtualenvwrapper.sh may be different depending on your distribution. Commands bellow are for Centos (and probably RedHat based distros), Debian based distributions uses
/usr/share/virtualenvwrapper/virtualenvwrapper.sh
$ cat <<EOF >> ~/.bashrc
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
EOF
$ source ~/.bashrc
$ cat >> ~/.zshrc < 'EOF'
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
EOF
$ source ~/.zshrc
Virtualenv creation [▲](#top-page "back to top") ===================
Run following command from the directory where you cloned obm-deploy repository.
$ mkvirtualenv -p /usr/bin/python2 --no-site-packages obm-deploy
Install ansible dependencies [▲](#top-page "back to top") ============================
$ pip install paramiko PyYAML jinja2 pyasn1 pycrypto python-keyczar==0.71b
Clone ansible repository [▲](#top-page "back to top") ========================
$ git clone https://github.com/ansible/ansible -b stable-1.9
$ cd ansible
$ git submodule update --init --recursive
$ cd -
Activate ansible environment [▲](#top-page "back to top") ============================
$ . ansible/hacking/env-setup
Auto-activate ansible environment [▲](#top-page "back to top") =================================
$ cat > ~/.virtualenvs/obm-deploy/bin/postactivate << EOF
#!/bin/bash
cd $(pwd)
source ansible/hacking/env-setup
EOF
$ chmod +x ~/.virtualenvs/obm-deploy/bin/postactivate
Exit from your virtualenv [▲](#top-page "back to top") =========================
$ deactivate
Each time you want to work with OBM-Deploy [▲](#top-page "back to top") ==========================================
$ workon obm-deploy