Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Latest commit

 

History

History
147 lines (101 loc) · 3.87 KB

wrapper-install.mkd

File metadata and controls

147 lines (101 loc) · 3.87 KB

If you haven't installed pre-requisistes yet. Please return to Pre-requisites (all methods).

Table of contents


VirtualenvWrapper installation [▲](#top-page "back to top") ==============================

Debian GNU/Linux Wheezy

$ sudo apt-get install virtualenvwrapper

CentOS Linux 6

$ 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

Using bash

$ cat <<EOF >> ~/.bashrc
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
EOF
$ source ~/.bashrc

Using zsh

$ 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