aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters
diff options
context:
space:
mode:
authorgrakiss <grakiss.wanglei@huawei.com>2016-01-28 10:51:39 +0800
committergrakiss <grakiss.wanglei@huawei.com>2016-01-28 20:27:22 +0800
commitd3ba758592ea7aa07931667fb265b574de0dfb80 (patch)
treeb03c05b11b4358b1e1a60f7ddf1b88d7c08b8635 /deploy/adapters
parent9d9b4c1aaaee795e93b07331645ed8589152d03e (diff)
FIX:storage volume invalid after reboot
JIRA:COMPASS-287 - losetup device will be invalid after reboot,need rebuild Change-Id: Ie9046495954cc371a61d1c9f2e1aaa901cb20b42 Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
Diffstat (limited to 'deploy/adapters')
-rwxr-xr-xdeploy/adapters/ansible/roles/storage/files/storage3
-rwxr-xr-xdeploy/adapters/ansible/roles/storage/tasks/main.yml22
2 files changed, 25 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/storage/files/storage b/deploy/adapters/ansible/roles/storage/files/storage
new file mode 100755
index 00000000..9ef9a65b
--- /dev/null
+++ b/deploy/adapters/ansible/roles/storage/files/storage
@@ -0,0 +1,3 @@
+#! /bin/bash
+loop_dev=`sh /opt/setup_storage/losetup.sh`
+vgcreate --force storage-volumes $loop_dev
diff --git a/deploy/adapters/ansible/roles/storage/tasks/main.yml b/deploy/adapters/ansible/roles/storage/tasks/main.yml
index 4185dc91..50ddd0d2 100755
--- a/deploy/adapters/ansible/roles/storage/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/storage/tasks/main.yml
@@ -17,4 +17,26 @@
tags:
- storage
+- name: make setup_storage directory
+ file: path=/opt/setup_storage state=directory mode=0755
+ tags:
+ - storage
+
+- name: copy setup storage scripts
+ copy: src={{ item }} dest=/opt/setup_storage mode=0755
+ with_items:
+ - losetup.sh
+ tags:
+ - storage
+
+- name: set autostart file
+ copy: src=storage dest=/etc/init.d/storage mode=0755
+ tags:
+ - storage
+
+- name: enable service
+ service: name=storage enabled=yes
+ tags:
+ - storage
+
- meta: flush_handlers