Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add virtualenv to ansible directory #1389

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ setup/*/host_vars/release-*
ansible/host_vars/*
!ansible/host_vars/README.md
!ansible/host_vars/*-template

# python virtualenv
virtualenv/
20 changes: 20 additions & 0 deletions ansible/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: ENV

virtualenv_path = ./virtualenv

ENV: Makefile
virtualenv2 --distribute $(virtualenv_path)

CHECK_ENV:
ifndef VIRTUAL_ENV
$(error PLEASE ENTER THE VIRTUALENV BEFORE FUN THE COMMAND)

This comment was marked as off-topic.

This comment was marked as off-topic.

endif

UPDATE_ENV: requirements.txt
$(virtualenv_path)/bin/pip install --upgrade setuptools
$(virtualenv_path)/bin/pip install --upgrade pip
$(virtualenv_path)/bin/pip install -r requirements.txt

FLAKE8: CHECK_ENV
flake8

This comment was marked as off-topic.

27 changes: 20 additions & 7 deletions ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@

## Getting started

1. Follow the [instructions to install the latest version of Ansible][ansible-install].
* In most cases, using pip: `pip install ansible`.
* If you use brew, then `brew install python2 ansible`, and then run
`export PYTHONPATH=$(pip2 show pyyaml | grep Location | awk '{print $2}') `
before you use `ansible-playbook`.
2. Read this document.
3. For SSH access, see the [SSH guide](../doc/ssh.md).
1. Read this document.
2. For SSH access, see the [SSH guide](../doc/ssh.md).

### Install ansible system wide

This comment was marked as off-topic.


Follow the [instructions to install the latest version of Ansible][ansible-install].
* In most cases, using pip: `pip install ansible`.

This comment was marked as off-topic.

* If you use brew, then `brew install python2 ansible`, and then run
`export PYTHONPATH=$(pip2 show pyyaml | grep Location | awk '{print $2}') `
before you use `ansible-playbook`.

### Install ansible in virtualenv

This comment was marked as off-topic.


From the `ansible` directory:

1. Run `make && make UPDATE_ENV`
2. Run `source ./virtualenv/bin/activate` to activate the virtualenv
3. You can now use `ansible-playbook`
4. When done you can quit the virtualenv with `deactivate`

**NOTE**: Virtualenv is now set to use _ansible 2.4.0_

## Getting things done

Expand Down
5 changes: 5 additions & 0 deletions ansible/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ansible==2.4.0
flake8==2.3.0
flake8-blind-except==0.1.0
flake8-import-order==0.5.1
pep8==1.7.0
4 changes: 4 additions & 0 deletions ansible/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
exclude=virtualenv
max-line-length=110
import-order-style=google