From fd828672a56779c14a1b50b5428ee0cc48f9c85f Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 6 May 2020 01:14:40 +0530 Subject: [PATCH] [2.9] constructed inventory plugin: correct example (#69189) Fixed 'intersect' filter name in constructed inventory plugin example. (cherry picked from commit 91d02e1c1fb16ac0fbb079334f9d3c239e57034a) Co-authored-by: Kenyon Ralph --- changelogs/fragments/69165_constructed.yml | 2 ++ lib/ansible/plugins/inventory/constructed.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/69165_constructed.yml diff --git a/changelogs/fragments/69165_constructed.yml b/changelogs/fragments/69165_constructed.yml new file mode 100644 index 00000000000..2ad301f12de --- /dev/null +++ b/changelogs/fragments/69165_constructed.yml @@ -0,0 +1,2 @@ +minor_changes: +- Fixed 'intersect' filter spelling in constructed inventory plugin example. diff --git a/lib/ansible/plugins/inventory/constructed.py b/lib/ansible/plugins/inventory/constructed.py index 7ab6dea588e..64b6c1446fd 100644 --- a/lib/ansible/plugins/inventory/constructed.py +++ b/lib/ansible/plugins/inventory/constructed.py @@ -45,7 +45,7 @@ EXAMPLES = r''' private_only: not (public_dns_name is defined or ip_address is defined) # complex group membership - multi_group: (group_names|intersection(['alpha', 'beta', 'omega']))|length >= 2 + multi_group: (group_names | intersect(['alpha', 'beta', 'omega'])) | length >= 2 keyed_groups: # this creates a group per distro (distro_CentOS, distro_Debian) and assigns the hosts that have matching values to it,