test-setup-swifthosts: Optimize xfsprogs installation

The 'xfsprogs' package is common across all distributions so improve
the playbook by using the 'package' Ansible module to install the
package on every distribution.

Change-Id: I86e5080e75b06f6252858978eaa62b5aa83cd87c
This commit is contained in:
Markos Chandras 2017-07-11 18:29:19 +01:00
parent 13efd53df5
commit 01444b18c8
1 changed files with 4 additions and 22 deletions

View File

@ -21,34 +21,16 @@
vars_files:
- test-vars.yml
tasks:
- name: Ensure xfsprogs is installed on localhost (Ubuntu)
apt:
- name: Ensure xfsprogs is installed on localhost
package:
name: xfsprogs
state: present
delegate_to: "{{ physical_host }}"
run_once: true
when:
- ansible_pkg_mgr == 'apt'
- name: Ensure xfsprogs is installed on localhost (CentOS)
yum:
- name: Ensure xfsprogs is installed on containers
package:
name: xfsprogs
state: present
delegate_to: "{{ physical_host }}"
run_once: true
when:
- ansible_pkg_mgr == 'yum'
- name: Ensure xfsprogs is installed on containers (Ubuntu)
apt:
name: xfsprogs
state: present
when:
- ansible_pkg_mgr == 'apt'
- name: Ensure xfsprogs is installed on containers (CentOS)
yum:
name: xfsprogs
state: present
when:
- ansible_pkg_mgr == 'yum'
- name: Openstack directory Create
file:
state: directory