summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-04-09 11:05:24 (GMT)
committerRichard Ipsum <richardipsum@fastmail.co.uk>2015-04-10 19:17:48 (GMT)
commit7559282bd18274c4235572bdd51a7dde5fee1401 (patch)
treed27b254df9e0712a6646ecf3a0c2075332965de4
parent445e06774364a2ca732b58e1c66157ce82e991e7 (diff)
downloaddefinitions-7559282bd18274c4235572bdd51a7dde5fee1401.tar.gz
cinder: Configure cinder dependencies when configuring cinder
-rw-r--r--openstack/usr/share/openstack/cinder.yml55
1 files changed, 51 insertions, 4 deletions
diff --git a/openstack/usr/share/openstack/cinder.yml b/openstack/usr/share/openstack/cinder.yml
index 9a1930b..7752ba8 100644
--- a/openstack/usr/share/openstack/cinder.yml
+++ b/openstack/usr/share/openstack/cinder.yml
@@ -3,6 +3,57 @@
vars_files:
- "/etc/openstack/cinder.conf"
tasks:
+
+# Configure iscsid, this can go in a separate script
+ - name: Update kernel module dependencies
+ command: depmod -a
+
+ - name: generate InitiatorName for iscsi
+ shell: iscsi-iname
+ register: initiator_name
+
+ - lineinfile:
+ dest: /etc/iscsi/initiatorname.iscsi
+ regexp: '^InitiatorName=$'
+ line: 'InitiatorName={{ initiator_name.stdout }}'
+ backrefs: yes
+
+ - name: Enable and start iscsid
+ service:
+ name: "{{ item }}"
+ enabled: yes
+ state: started
+ with_items:
+ - iscsid
+
+# Configure LVM and target for Cinder
+ - name: Check that CINDER_DEVICE exists
+ stat:
+ path: "{{ CINDER_DEVICE }}"
+ register: cinder_device_stats
+ failed_when: cinder_device_stats.stat.exists == false
+
+ - name: Configure LVM group for cinder
+ lvg:
+ vg: cinder-volumes
+ pvs: "{{ CINDER_DEVICE }}"
+
+ - lineinfile:
+ dest: /etc/lvm/lvm.conf
+ regexp: '# filter = \[ \"a\/\.\*/\" \]'
+ line: ' filter = [ "a|{{ CINDER_DEVICE }}|", "r/.*/" ]'
+ backrefs: yes
+
+ - name: Enable and start lvm2-lvmetad and target services
+ service:
+ name: "{{ item }}"
+ enabled: yes
+ state: started
+ with_items:
+ - lvm2-lvmetad
+ - target
+
+# Configure cinder
- name: Create the cinder user.
user:
name: cinder
@@ -100,7 +151,3 @@
- openstack-cinder-scheduler
- openstack-cinder-volume
- openstack-cinder-backup
-
- - lvg:
- vg: cinder-volumes
- pvs: "{{ CINDER_DEVICE }}"