Skip to content

Instantly share code, notes, and snippets.

@lanky
Created October 3, 2016 13:20
Show Gist options
  • Save lanky/641668dbeac0f51b3f3cbc90eb832f66 to your computer and use it in GitHub Desktop.
Save lanky/641668dbeac0f51b3f3cbc90eb832f66 to your computer and use it in GitHub Desktop.
---
# vim: set ft=ansible:
- hosts: all
tasks:
- name: group hosts with random var
group_by:
key: random_var
when: random_var is defined
- name: prove it did stuff
debug:
var: groups.random_var
run_once: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment