From f72f348a0368676b52b3d5ccad4bcb70b1805343 Mon Sep 17 00:00:00 2001 From: Adam Herst Date: Thu, 15 Apr 2021 14:30:12 -0400 Subject: [PATCH] ansible: add list groups in an inventory example (#5755) --- pages/common/ansible.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/common/ansible.md b/pages/common/ansible.md index 6ead52e92f..0895b53600 100644 --- a/pages/common/ansible.md +++ b/pages/common/ansible.md @@ -27,3 +27,7 @@ - Execute a command using a custom inventory file: `ansible {{group}} -i {{inventory_file}} -m command -a '{{my_command}}'` + +- List the groups in an inventory: + +`ansible localhost -m debug -a '{{var=groups.keys()}}'`