Fix ansible-lint test failures for cinder

With the merge of https://review.openstack.org/520177 in the
tests repo some ansible-lint failures which previously were
not being picked up are now detected.

Change-Id: I90d6673316b836b99bf792dd4586c69fd65af39c
This commit is contained in:
Jesse Pretorius 2017-11-21 11:01:53 +00:00
parent 82f3ee80b7
commit 5308271fc9
1 changed files with 11 additions and 4 deletions

View File

@ -22,31 +22,38 @@
name: lvm2
when:
- ansible_pkg_mgr == 'apt'
- name: Install lvm2 package
package:
name: lvm2
when:
- ansible_pkg_mgr in ['yum', 'dnf']
- name: Create sparse Cinder file
shell: "truncate -s 10G /openstack/cinder.img"
command: "truncate -s 10G /openstack/cinder.img"
args:
creates: /openstack/cinder.img
register: cinder_create
- name: Get a loopback device for cinder file
shell: losetup -f
command: losetup -f
when: cinder_create | changed
register: cinder_losetup
- name: Create the loopback device
shell: "losetup {{ cinder_losetup.stdout }} /openstack/cinder.img"
command: "losetup {{ cinder_losetup.stdout }} /openstack/cinder.img"
when: cinder_create | changed
- name: Make LVM physical volume on the cinder device
shell: "{{ item }}"
command: "{{ item }}"
when: cinder_create | changed
with_items:
- "pvcreate {{ cinder_losetup.stdout }}"
- "pvscan"
- name: Add cinder-volumes volume group
lvg:
vg: cinder-volumes
pvs: "{{ cinder_losetup.stdout }}"
when: cinder_create | changed