From 1c8f5c7db5012cbf8b9e6e26326b09d99a7bbeb0 Mon Sep 17 00:00:00 2001 From: Petr Ruzicka Date: Fri, 14 Dec 2018 18:13:32 +0100 Subject: [PATCH] with_items should not be used any more - using loop instead (#47364) --- lib/ansible/modules/cloud/vmware/vmware_category_facts.py | 2 +- lib/ansible/modules/cloud/vmware/vmware_host_datastore.py | 4 ++-- lib/ansible/modules/cloud/vmware/vmware_host_feature_facts.py | 2 +- lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_category_facts.py b/lib/ansible/modules/cloud/vmware/vmware_category_facts.py index 366d2b061f9..31d8fc6be2c 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_category_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_category_facts.py @@ -55,7 +55,7 @@ EXAMPLES = r''' - set_fact: category_id: "{{ item.category_id }}" - with_items: "{{ tag_category_results.tag_category_facts|json_query(query) }}" + loop: "{{ tag_category_results.tag_category_facts|json_query(query) }}" vars: query: "[?category_name==`Category0001`]" - debug: var=category_id diff --git a/lib/ansible/modules/cloud/vmware/vmware_host_datastore.py b/lib/ansible/modules/cloud/vmware/vmware_host_datastore.py index f8f707f6195..1d15985e8b7 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_host_datastore.py +++ b/lib/ansible/modules/cloud/vmware/vmware_host_datastore.py @@ -112,7 +112,7 @@ EXAMPLES = r''' esxi_hostname: '{{ inventory_hostname }}' state: present delegate_to: localhost - with_items: + loop: - { 'name': 'NasDS_vol01', 'server': 'nas01', 'path': '/mnt/vol01', 'type': 'nfs'} - { 'name': 'NasDS_vol02', 'server': 'nas01', 'path': '/mnt/vol02', 'type': 'nfs'} @@ -129,7 +129,7 @@ EXAMPLES = r''' esxi_hostname: '{{ inventory_hostname }}' state: present delegate_to: localhost - with_items: + loop: - { 'name': 'NasDS_vol03', 'server': 'nas01,nas02', 'path': '/mnt/vol01', 'type': 'nfs41'} - { 'name': 'NasDS_vol04', 'server': 'nas01,nas02', 'path': '/mnt/vol02', 'type': 'nfs41'} diff --git a/lib/ansible/modules/cloud/vmware/vmware_host_feature_facts.py b/lib/ansible/modules/cloud/vmware/vmware_host_feature_facts.py index e3c8189dcac..62ac38b4c68 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_host_feature_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_host_feature_facts.py @@ -58,7 +58,7 @@ EXAMPLES = r''' register: features_set - set_fact: ssbd : "{{ item.value }}" - with_items: "{{ features_set.host_feature_facts[esxi_hostname] |json_query(name) }}" + loop: "{{ features_set.host_feature_facts[esxi_hostname] |json_query(name) }}" vars: name: "[?key=='cpuid.SSBD']" - assert: diff --git a/lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py b/lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py index a4446600afe..223f251acbf 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py +++ b/lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py @@ -54,7 +54,7 @@ EXAMPLES = ''' password: "{{ site_password }}" cluster_uuid: "{{ vsan_cluster.cluster_uuid }}" delegate_to: localhost - with_items: "{{ groups['esxi'][1:] }}" + loop: "{{ groups['esxi'][1:] }}" ''' try: