Pass list of packages instead of with_items

Modern versions of Ansible can handle a list of packages passed
directly to the package modules. This patch optimizes the package
install process by passing the list of packages directly to the
module.
pull/2030/head
Major Hayden 2017-10-11 12:18:12 -05:00
parent b561252da8
commit 9d62630303
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
1 changed files with 2 additions and 4 deletions

View File

@ -1,17 +1,15 @@
--- ---
- name: install redhat dependencies - name: install redhat dependencies
package: package:
name: "{{ item }}" name: "{{ redhat_package_dependencies }}"
state: present state: present
with_items: "{{ redhat_package_dependencies }}"
when: when:
- ansible_distribution == 'RedHat' - ansible_distribution == 'RedHat'
- name: install centos dependencies - name: install centos dependencies
yum: yum:
name: "{{ item }}" name: "{{ centos_package_dependencies }}"
state: present state: present
with_items: "{{ centos_package_dependencies }}"
when: when:
- ansible_distribution == 'CentOS' - ansible_distribution == 'CentOS'