diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/cinder-volume')
5 files changed, 29 insertions, 12 deletions
diff --git a/deploy/adapters/ansible/roles/cinder-volume/handlers/main.yml b/deploy/adapters/ansible/roles/cinder-volume/handlers/main.yml index ad917ce5..55fbc2c9 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/handlers/main.yml +++ b/deploy/adapters/ansible/roles/cinder-volume/handlers/main.yml @@ -1,3 +1,4 @@ --- -- name: restart cinder-volume - service: name=cinder-volume state=restarted enabled=yes +- name: restart cinder-volume services + service: name={{ item }} state=restarted enabled=yes + with_items: services | union(services_noarch) diff --git a/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml b/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml index d727b66b..3700bcdd 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml +++ b/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml @@ -2,24 +2,24 @@ - include_vars: "{{ ansible_os_family }}.yml" - name: install cinder-volume and lvm2 packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" - with_items: packages + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + with_items: packages | union(packages_noarch) - name: generate cinder volume service list shell: echo {{ item }} >> /opt/service - with_items: services + with_items: services | union(services_noarch) - name: check if physical device exists stat: path={{ physical_device }} - register: st + register: status -- name: repace physical_device if st is false +- name: replace physical_device if st is false local_action: copy src=loop.yml dest=/tmp/loop.yml - when: st.stat.exists == False + when: status.stat.exists == False - name: load loop.yml include_vars: /tmp/loop.yml - when: st.stat.exists == False + when: status.stat.exists == False - name: check if cinder-volumes is mounted shell: ls /mnt @@ -35,7 +35,7 @@ when: cindervolumes.stdout != 'cinder-volumes' - name: get first lo device - shell: ls /dev/loop* | egrep 'loop[0-9]+'|sed -n 1p + shell: losetup -f register: first_lo when: cindervolumes.stdout != 'cinder-volumes' @@ -51,4 +51,4 @@ template: src=cinder.conf dest=/etc/cinder/cinder.conf backup=yes notify: - - restart cinder-volume + - restart cinder-volume services diff --git a/deploy/adapters/ansible/roles/cinder-volume/vars/Debian.yml b/deploy/adapters/ansible/roles/cinder-volume/vars/Debian.yml index e68868cd..a66ba184 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/cinder-volume/vars/Debian.yml @@ -1,7 +1,6 @@ --- packages: - cinder-volume - - lvm2 services: - cinder-volume diff --git a/deploy/adapters/ansible/roles/cinder-volume/vars/RedHat.yml b/deploy/adapters/ansible/roles/cinder-volume/vars/RedHat.yml new file mode 100644 index 00000000..123d4570 --- /dev/null +++ b/deploy/adapters/ansible/roles/cinder-volume/vars/RedHat.yml @@ -0,0 +1,11 @@ +--- +packages: + - openstack-cinder + - targetcli + - python-oslo-db + - MySQL-python + - lvm2 + +services: + - openstack-cinder-volume + - lvm2-lvmetad diff --git a/deploy/adapters/ansible/roles/cinder-volume/vars/main.yml b/deploy/adapters/ansible/roles/cinder-volume/vars/main.yml new file mode 100644 index 00000000..036740c0 --- /dev/null +++ b/deploy/adapters/ansible/roles/cinder-volume/vars/main.yml @@ -0,0 +1,6 @@ +--- +packages_noarch: + - lvm2 + +services_noarch: [] + |