Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of an Ansible playbook that uses group_by
---
- hosts: all
tasks:
- group_by: key="{{ 'using_letsencrypt' if letsencrypt_certs|default([]) else 'not_using_letsencrypt' }}"
changed_when: no
tags: always
- group_by: key="{{ ansible_distribution.lower() ~ '_' ~ ansible_distribution_release }}"
changed_when: no
tags: always
- hosts: using_letsencrypt:&ubuntu_xenial
roles:
- deadsnakes
- hosts: using_letsencrypt
roles:
- letsencrypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment