Difference between revisions of "Configuring proxy using environment variables"
From Notes_Wiki
(Created page with "<yambe:breadcrumb>Ansible_tips_and_tricks|Ansible tips and tricks</yambe:breadcrumb> =Configuring proxy using environment variables= To configure proxy using environment vari...") |
m |
||
| Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[Ansible|ansible]] > [[Ansible tips and tricks]] > [[Configuring proxy using environment variables]] | |||
To configure proxy using environment variables, esp for modules such as get_url or yum use: | To configure proxy using environment variables, esp for modules such as get_url or yum use: | ||
| Line 33: | Line 32: | ||
</pre> | </pre> | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[Ansible|ansible]] > [[Ansible tips and tricks]] > [[Configuring proxy using environment variables]] | |||
Latest revision as of 11:52, 28 July 2022
Home > CentOS > CentOS 6.x > System administration tools > ansible > Ansible tips and tricks > Configuring proxy using environment variables
To configure proxy using environment variables, esp for modules such as get_url or yum use:
vars:
proxy_env:
http_proxy: http://proxy.virtual-labs.ac.in:8080/
https_proxy: http://proxy.virtual-labs.ac.in:8080/
Then the same can be referred into various tasks as:
- name: Download GLPI from Internet
get_url: url="{{ glpi_download_url }}" dest="{{ glpi_local_path }}"
environment: proxy_env
- name: Install apache, mod_ssl, php, php-ldap, mysql-server, php-mysql, php-mbstring, php-gd
yum: name={{ item }} state=present
with_items:
- httpd
- mod_ssl
- php
- php-ldap
- mysql-server
- php-mysql
- php-mbstring
- php-gd
- MySQL-python
environment: proxy_env
notify:
- restart apache
Home > CentOS > CentOS 6.x > System administration tools > ansible > Ansible tips and tricks > Configuring proxy using environment variables