Created
February 26, 2016 16:13
-
-
Save knakayama/fd387cd0f058668031df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
tasks: | |
- name: Create a group of all hosts by operating system | |
group_by: key={{ansible_distribution}}-{{ansible_distribution_version}} | |
# the following host group does not exist in inventory and was created by the group_by | |
# module. | |
- hosts: CentOS-6.2 | |
tasks: | |
- name: ping all CentOS 6.2 hosts | |
ping: | |
- hosts: CentOS-6.3 | |
tasks: | |
- name: ping all CentOS 6.3 hosts | |
ping: | |
- hosts: MacOSX-10.11.3 | |
tasks: | |
- name: ping all MacOSX-10.11.3 hosts | |
ping: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment