From b79c0615a0a00e1d4adaf8e11b62e20676389fbe Mon Sep 17 00:00:00 2001 From: John Dewey Date: Fri, 17 Feb 2017 16:20:03 -0800 Subject: [PATCH] Use a virtualenv The instructions require a minimum version of Ansible and netaddr. Enforce these dependencies through a venv. Particularly useful when switching between other projects. Also, useful for the future as Kargo expands, and may require additional dependencies. --- .gitignore | 1 + Makefile | 11 +++++++++++ README.md | 1 + 3 files changed, 13 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 074dd431d..9d9c02554 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ temp /ssh-bastion.conf **/*.sw[pon] vagrant/ +venv/ diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..a47d45abe --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +venv: venv/bin/activate + +venv/bin/activate: requirements.txt + test -d venv || virtualenv --no-setuptools -p `which python` venv + . venv/bin/activate; pip install -r requirements.txt + +clean: + $(RM) -rf venv + find . -name "*.pyc" -exec $(RM) -rf {} \; + +.PHONY:clean venv diff --git a/README.md b/README.md index eb896255d..68a1a9ecc 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ in order to avoid any issue during deployment you should disable your firewall. * The target servers are configured to allow **IPv4 forwarding**. * **Copy your ssh keys** to all the servers part of your inventory. * **Ansible v2.2 (or newer) and python-netaddr** + * Build and source a venv `make && venv/bin/activate` ## Network plugins