2012-10-27 17:47:47 +00:00
|
|
|
# -*- mode: python -*-
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
---
|
|
|
|
module: group_by
|
|
|
|
short_description: Create Ansible groups based on facts
|
|
|
|
description:
|
|
|
|
- Use facts to create ad-hoc groups that can be used later in a playbook.
|
2013-03-30 19:44:34 +00:00
|
|
|
version_added: "0.9"
|
2012-10-27 17:47:47 +00:00
|
|
|
options:
|
|
|
|
key:
|
|
|
|
description:
|
|
|
|
- The variables whose values will be used as groups
|
|
|
|
required: true
|
|
|
|
author: Jeroen Hoekx
|
|
|
|
notes:
|
|
|
|
- Spaces in group names are converted to dashes '-'.
|
|
|
|
'''
|
2013-06-14 09:53:43 +00:00
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
# Create groups based on the machine architecture
|
2013-07-19 13:43:27 +00:00
|
|
|
- group_by: key=machine_{{ ansible_machine }}
|
2013-06-14 09:53:43 +00:00
|
|
|
# Create groups like 'kvm-host'
|
2013-07-19 13:43:27 +00:00
|
|
|
- group_by: key=virt_{{ ansible_virtualization_type }}_{{ ansible_virtualization_role }}
|
2013-06-14 09:53:43 +00:00
|
|
|
'''
|