Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryandaniels/ansible-role-install-ansible-venv
Ansible Role to install Ansible into Python virtual environments
https://github.com/ryandaniels/ansible-role-install-ansible-venv
ansible ansible-role venv virtual-environments
Last synced: 13 days ago
JSON representation
Ansible Role to install Ansible into Python virtual environments
- Host: GitHub
- URL: https://github.com/ryandaniels/ansible-role-install-ansible-venv
- Owner: ryandaniels
- License: mit
- Created: 2019-07-06T19:53:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-09T02:06:23.000Z (almost 5 years ago)
- Last Synced: 2024-11-29T19:46:36.118Z (2 months ago)
- Topics: ansible, ansible-role, venv, virtual-environments
- Homepage: https://galaxy.ansible.com/ryandaniels/install_ansible_venv
- Size: 2.93 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-role-install-ansible-venv
CentOS7 / RHEL7 - Install Ansible for different versions of Ansible inside "virtual environments" (using python-virtualenv) on localhost (Ansible control server).
This tasks can also remove old versions. Just make sure you aren't using the virtual environment you have configured to be removed.
To use: Type `ansible-activate` and use tab completion to pick the specific version.
To stop using venv, type: `deactivate`NOTE: You need ansible installed first for this to work.
Also, after running the playbook, logout and log in again to enable the bash completion aliases.Available versions can be found here:
from## Group Variables
./group_vars/centos-dev/proxy.yml
With a proxy:```yaml
proxy_env:
http_proxy: http://my.internal.proxy:80
https_proxy: https://my.internal.proxy:80
```With no proxy:
```yaml
proxy_env: []
```## Default Settings
```yaml
#Ansible control server is behind a proxy
install_ansiblev_proxy_enabled: true
install_ansiblev_virtualenv_basepath: /opt/virtualenvs
install_ansiblev_versions_add:
- "2.3.3"
- "2.4.6"
- "2.5.15"
- "2.6.18"
- "2.7.12"
- "2.8.2"
install_ansiblev_versions_remove:
- "2.6.5"
- "2.7"
```## Example Playbook install-ansible-venv.yml
```yaml
---
- hosts: '{{inventory}}'
become: yes
roles:
- install-ansible-venv
```## Usage
Install Ansible into virtual environments:
```bash
ansible-playbook install-ansible-venv.yml --extra-vars "inventory=localhost" -i hosts-dev
```After running the playbook, logout and log in again to enable the bash completion aliases.