community.general/lib/ansible
James Cammarata 9a401e73a6 Adding support for role dependencies.
Fixes #3686

Dependencies are enabled by adding a new directory/file named
meta/main.yml to the role. The format of the dependencies are:

dependencies:
- { role: foo, x: 1, y: 2 }
- { role: bar, x: 3, y: 4 }
...

Dependencies inherit variables as they are seen at the time of the
dependency inclusion. For example, if foo(x=1, y=2) has a dependency
on bar(x=3,z=4), then bar will have variables (x=3,y=2,z=4).

Different roles can have dependencies on the same role, and this
variable inheritence allows for the reuse of generic roles quite easily.
For example:

Role 'car' has the following dependencies:
dependencies:
  - { role: wheel, n: 1 }
  - { role: wheel, n: 2 }
  - { role: wheel, n: 3 }
  - { role: wheel, n: 4 }

Role 'wheel' has the following dependencies:
dependencies:
- { role: tire }
- { role: brake }

The role 'car' is then used as follows:
- { role: car, type: honda }

And tasks/main.yml in each role simply contains the following:
- name: {{ type }} whatever {{ n }}
  command: echo ''

TASK: [honda tire 1]
TASK: [honda brake 1]
TASK: [honda wheel 1]
TASK: [honda tire 2]
TASK: [honda brake 2]
TASK: [honda wheel 2]
TASK: [honda tire 3]
TASK: [honda brake 3]
TASK: [honda wheel 3]
TASK: [honda tire 4]
TASK: [honda brake 4]
TASK: [honda wheel 4]
TASK: [I'm a honda]  <- (this is in roles/car/tasks/main.yml)
2013-08-15 09:29:51 -05:00
..
callback_plugins Renamed on_no_hosts_matched/on_no_hosts_remaining to correct names in noop callback, added methods to callback plugin examples. 2013-06-09 12:19:07 -04:00
inventory fix inventory.basedir is not absolute path when hostfile is startswith "./" 2013-08-11 10:50:47 +08:00
playbook Adding support for role dependencies. 2013-08-15 09:29:51 -05:00
runner Merge branch 'rsynctake2' into devel 2013-08-11 16:22:36 -04:00
utils Fix some typos discovered during casual reading 2013-08-11 18:41:23 +05:30
__init__.py Version bump and assorted things to start new development version. 2013-06-10 15:34:52 -04:00
callbacks.py These fields are booleans. 2013-08-10 18:16:01 -04:00
color.py These fields are booleans. 2013-08-10 18:16:01 -04:00
constants.py Enable error_on_undefined_vars by default 2013-08-15 09:28:34 -05:00
errors.py Introduce exception AnsibleFilterError and use it in Jinja filters. Ignore this exception when trying to find the name of a task for display (callback) purpose. 2013-07-07 19:18:32 +02:00
module_common.py Merge pull request #3706 from lorin/sudo_user_breakage 2013-08-01 17:15:26 -07:00