Skip to content

Instantly share code, notes, and snippets.

@alces
Created December 25, 2015 08:40
Show Gist options
  • Save alces/7c67e69474bba1216e35 to your computer and use it in GitHub Desktop.
Save alces/7c67e69474bba1216e35 to your computer and use it in GitHub Desktop.
Ansible playbook demonstrating easy_install, pip, and yum working via HTTP proxy
#!/usr/bin/env ansible-playbook
---
- name: test how easy_install, pip, and yum modules works via proxy
hosts: all
environment:
http_proxy: http://192.168.1.10:3128
https_proxy: http://192.168.1.10:3128
tasks:
- name: Install easy_install
yum:
name: python-setuptools
- name: Install virtualenv
easy_install:
name: virtualenv
- name: Install fabric binary dependencies
yum:
name: "{{ item }}"
with_items:
- gcc
- make
- python-devel
- name: install a package into virtualenv
pip:
name: fabric
virtualenv: /opt/python-env/test01
@michaellihs
Copy link

nice - thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment