From a8a89b7102a5170ec8ee764f9be27e59fd88452f Mon Sep 17 00:00:00 2001 From: Matt Warren Date: Tue, 11 Feb 2020 14:03:28 -0500 Subject: [PATCH] Update yum.py (#67252) Move the simpler name list example to the top of EXAMPLES. Those with v2.11 loop deprecation warnings will be looking for a solution. --- lib/ansible/modules/packaging/os/yum.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/packaging/os/yum.py b/lib/ansible/modules/packaging/os/yum.py index 0b17c22cbe7..0d2fd926271 100644 --- a/lib/ansible/modules/packaging/os/yum.py +++ b/lib/ansible/modules/packaging/os/yum.py @@ -246,7 +246,15 @@ EXAMPLES = ''' name: httpd state: latest -- name: ensure a list of packages installed +- name: install a list of packages (suitable replacement for 2.11 loop deprecation warning) + yum: + name: + - nginx + - postgresql + - postgresql-server + state: present + +- name: install a list of packages with a list variable yum: name: "{{ packages }}" vars: @@ -316,14 +324,6 @@ EXAMPLES = ''' name: sos disablerepo: "epel,ol7_latest" -- name: Install a list of packages - yum: - name: - - nginx - - postgresql - - postgresql-server - state: present - - name: Download the nginx package but do not install it yum: name: