Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
908a1927
Commit
908a1927
authored
Feb 23, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation updates
parent
582f088e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
docsite/rst/playbooks2.rst
+14
-15
No files found.
docsite/rst/playbooks2.rst
View file @
908a1927
...
...
@@ -580,7 +580,7 @@ It is quite possible that you may need to get package updates through a proxy, o
updates through a proxy and access other packages not through a proxy. Ansible makes it easy for you
to configure your environment by using the 'environment' keyword. Here is an example::
- hosts: all
- hosts: all
user: root
tasks:
...
...
@@ -591,21 +591,30 @@ to configure your environment by using the 'environment' keyword. Here is an ex
The environment can also be stored in a variable, and accessed like so::
- hosts: all
- hosts: all
user: root
# here we make a variable named "env" that is a dictionary
vars:
env:
proxy_
env:
http_proxy=http://proxy.example.com:8080
tasks:
- apt: name=cobbler state=installed
environment: $
env
environment: $proxy_
env
While just proxy settings were shown above, any number of settings can be supplied.
While just proxy settings were shown above, any number of settings can be supplied. The most logical place
to define an environment hash might be a group_vars file, like so::
----
# file: group_vars/boston
ntp_server: ntp.bos.example.com
backup: bak.bos.example.com
proxy_env:
http_proxy=http://proxy.bos.example.com:8080
https_proxy=http://proxy.bos.example.com:8080
Getting values from files
`````````````````````````
...
...
@@ -630,16 +639,6 @@ Because Ansible uses lazy evaluation, a "$PIPE" macro will be executed each time
example, it will be executed separately for each host, and if it is used in a variable definition,
it will be executed each time the variable is evaluated.
.. versionadded:: 1.1
The "$PIPE_ONCE" macro is an alternative that uses a caching strategy: it is executed only once, and
subsequent accesses use the cached value. One use case is for computing a timestamp that is intended
to be the same across all tasks and hosts that use it::
vars:
timestamp: $PIPE_ONCE(date +%Y%m%d-%H%M%S)
Selecting Files And Templates Based On Variables
````````````````````````````````````````````````
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment