From 8da48b1a4059ed5b62b1dedb86c7838890590872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Sun, 11 Aug 2019 11:17:47 +0200 Subject: [PATCH] inventory: cloudscale: extend examples (#60306) --- lib/ansible/plugins/inventory/cloudscale.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/inventory/cloudscale.py b/lib/ansible/plugins/inventory/cloudscale.py index 442799c884f..3eb77a2939c 100644 --- a/lib/ansible/plugins/inventory/cloudscale.py +++ b/lib/ansible/plugins/inventory/cloudscale.py @@ -15,6 +15,7 @@ author: short_description: cloudscale.ch inventory source description: - Get inventory hosts from cloudscale.ch API + - Uses an YAML configuration file ending with either I(cloudscale.yml) or I(cloudscale.yaml) to set parameter values (also see examples). version_added: '2.8' extends_documentation_fragment: - constructed @@ -62,10 +63,22 @@ options: ''' EXAMPLES = r''' -# cloudscale_inventory.yml file in YAML format -# Example command line: ansible-inventory --list -i cloudscale_inventory.yml +# cloudscale.yml name ending file in YAML format +# Example command line: ansible-inventory --list -i inventory_cloudscale.yml plugin: cloudscale + +# Example grouping by tag key "project" +plugin: cloudscale +keyed_groups: + - prefix: project + key: cloudscale.tags.project + +# Example grouping by key "operating_system" lowercased and prefixed with "os" +plugin: cloudscale +keyed_groups: + - prefix: os + key: cloudscale.image.operating_system | lower ''' from collections import defaultdict