Browse Source

ansible: add list groups in an inventory example (#5755)

Adam Herst 3 years ago
parent
commit
f72f348a03
1 changed files with 4 additions and 0 deletions
  1. 4 0
      pages/common/ansible.md

+ 4 - 0
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()}}'`