Merge "Fix ansible-lint test failures for cinder"
This commit is contained in:
commit
41ff58d5bc
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user