aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/cinder-volume
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-08-06 02:37:33 -0400
committerbaigk <baiguoku@huawei.com>2015-08-09 22:47:56 -0400
commit87612abc0e24cafd89a49e350165b08fe1608233 (patch)
tree07b156c0268fd189f92e8a0730118edc51b8073f /deploy/adapters/ansible/roles/cinder-volume
parent5aedf594112c0749b6e9039d15b9fe70d210a942 (diff)
support deployment openstack juno with ansible for compass in centos7.1
JIRA: COMPASS-6 Change-Id: I8ef865e8acfe29c3ff5c7e9030e4cebabed3457b Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/cinder-volume')
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/handlers/main.yml5
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml18
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/vars/Debian.yml1
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/vars/RedHat.yml11
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/vars/main.yml6
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: []
+