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
8e2a8c92
Commit
8e2a8c92
authored
Nov 06, 2014
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed examples to not have a non working variable that gets confused
with directives as per #9264
parent
d25748b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
docsite/rst/playbooks_roles.rst
+6
-6
No files found.
docsite/rst/playbooks_roles.rst
View file @
8e2a8c92
...
...
@@ -61,19 +61,19 @@ For instance, if deploying multiple wordpress instances, I could
contain all of my wordpress tasks in a single wordpress.yml file, and use it like so::
tasks:
- include: wordpress.yml user=timmy
- include: wordpress.yml user=alice
- include: wordpress.yml user=bob
- include: wordpress.yml
wp_
user=timmy
- include: wordpress.yml
wp_
user=alice
- include: wordpress.yml
wp_
user=bob
If you are running Ansible 1.4 and later, include syntax is streamlined to match roles, and also allows passing list and dictionary parameters::
tasks:
- { include: wordpress.yml, user: timmy, ssh_keys: [ 'keys/one.txt', 'keys/two.txt' ] }
- { include: wordpress.yml,
wp_
user: timmy, ssh_keys: [ 'keys/one.txt', 'keys/two.txt' ] }
Using either syntax, variables passed in can then be used in the included files. We'll cover them in :doc:`playbooks_variables`.
You can reference them like this::
{{ user }}
{{
wp_
user }}
(In addition to the explicitly passed-in parameters, all variables from
the vars section are also available for use here as well.)
...
...
@@ -85,7 +85,7 @@ which also supports structured variables::
- include: wordpress.yml
vars:
remote
_user: timmy
wp
_user: timmy
some_list_variable:
- alpha
- beta
...
...
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