From 7de51f4bc5507cc0c615cf51e30f168c658ae568 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Tue, 13 Mar 2018 23:21:10 -0500 Subject: [PATCH] dyngroups: Dynamic host classification The `dyngroups.yml` playbook groups hosts dynamically based on gathered facts. Currently, the `ansible_os_family` fact is used to group hosts by Linux distribution. --- dyngroups.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dyngroups.yml diff --git a/dyngroups.yml b/dyngroups.yml new file mode 100644 index 0000000..a0f8c5b --- /dev/null +++ b/dyngroups.yml @@ -0,0 +1,6 @@ +- hosts: all + gather_facts: true + tasks: + - name: group hosts by distribution + group_by: + key={{ ansible_os_family }}