Use the new pkg module, to avoid having 2 tasks

This commit is contained in:
Michael Scherer 2016-08-06 20:16:34 +02:00 committed by Kevin Fenzi
parent e09dc582a3
commit 69914396b4

View file

@ -34,22 +34,14 @@
# Install needed packages
#
- name: Install needed nfs packages
yum: pkg={{ item }} state=present
pkg:
name: "{{ item }}"
state: present
with_items:
- nfs-utils
- rpcbind
tags:
- nfs/client
when: ansible_distribution_major_version|int < 22
#
- name: Install needed nfs packages
dnf: pkg={{ item }} state=present
with_items:
- nfs-utils
- rpcbind
tags:
- nfs/client
when: ansible_distribution_major_version|int > 21
- name: enable nfs-related services and run them (fedora20 only)
service: name={{ item }} enabled=true state=started