Ansible notes: group_names - DEV Community
dev.to › mjace › ansible-notes-groupnames-2jb5Dec 30, 2019 · In ansible, group_names is a list (array) of all the groups the current host is in. This can be used in templates using Jinja2 syntax to make template source files that vary based on the group membership (or role) of the host: {% if 'webserver' in group_names %} # some part of a configuration file that only applies to webservers {% endif %}
Special Variables — Ansible Documentation
docs.ansible.com › ansible › latestDec 21, 2021 · ansible_verbosity. Current verbosity setting for Ansible. ansible_version. Dictionary/map that contains information about the current running version of ansible, it has the following keys: full, major, minor, revision and string. group_names. List of groups the current host is part of. groups