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
971dd536
Commit
971dd536
authored
Oct 12, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added documentation on looping over with_* like fileglob
parent
dd3beb84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
examples/playbooks/loop_plugins.yml
+27
-0
No files found.
examples/playbooks/loop_plugins.yml
0 → 100644
View file @
971dd536
---
# in addition to loop_with_items, the loop that works over a variable, ansible can do more sophisticated looping.
# developer types: these are powered by 'lookup_plugins' should you ever decide to write your own
# see lib/ansible/runner/lookup_plugins/fileglob.py
-
hosts
:
all
gather_facts
:
False
tasks
:
# this will copy every file in /etc to the directory /tmp/fuzz
# note the directory must be created first
-
file
:
dest=/tmp/fuzz state=directory
-
copy
:
src=$item dest=/tmp/fuzz/
with_fileglob
:
/etc/*
# think about what other kinds of variables you would like to use in ansible. It's easy to write lookup
# plugins and the name of the plugin will make "with_(PLUGIN)" available for use in the task syntax.
# for instance, writing a plugin named "weather" would make "with_weather" available, and you could
# write a lookup plugin to query the weather forecast.
# note with_items and with_* are currently incompatible, and you can use only one of these per task.
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