summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-03-26 14:32:57 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-04-10 10:55:35 +0000
commit60995d3a8c9f9809da789a1115637a9a3b01a009 (patch)
treef1071f7b17b85744d4babf4623a4de1e74f6205a
parent375653fac801ae8264696b7e6111daac75b0c697 (diff)
downloaddefinitions-60995d3a8c9f9809da789a1115637a9a3b01a009.tar.gz
Add open-iscsi to openstack-services
This is required by Cinder to communicate with the iscsi daemon and the run the iscsiadm app.
-rw-r--r--strata/openstack-services.morph5
-rw-r--r--strata/openstack-services/open-iscsi.morph45
2 files changed, 50 insertions, 0 deletions
diff --git a/strata/openstack-services.morph b/strata/openstack-services.morph
index 553da724..d29e796a 100644
--- a/strata/openstack-services.morph
+++ b/strata/openstack-services.morph
@@ -708,6 +708,11 @@ chunks:
build-depends:
- configshell-fb
- rtslib-fb
+- name: open-iscsi
+ morph: strata/openstack-services/open-iscsi.morph
+ repo: upstream:open-iscsi
+ ref: 8da14e6f9eeeb4fd03938d40fe1126fe0d110b68
+ unpetrify-ref: master
- name: nova
morph: strata/openstack-services/nova.morph
repo: upstream:openstack/nova
diff --git a/strata/openstack-services/open-iscsi.morph b/strata/openstack-services/open-iscsi.morph
new file mode 100644
index 00000000..9d135ab2
--- /dev/null
+++ b/strata/openstack-services/open-iscsi.morph
@@ -0,0 +1,45 @@
+name: open-iscsi
+kind: chunk
+build-commands:
+- make
+install-commands:
+# Rewrite prefix and exec_prefix which are set to "/usr" and "/" respectively
+- make prefix="$PREFIX" exec_prefix="$PREFIX" DESTDIR="$DESTDIR" install
+# Install iscsistart app which is not listed by default in PROGRAMS
+- make prefix="$PREFIX" exec_prefix="$PREFIX" DESTDIR="$DESTDIR" PROGRAMS="usr/iscsistart" install
+post-install-commands:
+# Configure iscsi daemon
+# Point the startup to the installed binary
+- |
+ sed -i -e "s|iscsid.startup = \/sbin\/iscsid|iscsid.startup = "$PREFIX"/sbin/iscsid|" \
+ etc/iscsid.conf
+# Start up a session automatically
+- sed -i -e 's|node.startup = manual|node.startup = automatic|' etc/iscsid.conf
+# Install config file
+- install -D -m 644 etc/iscsid.conf "$DESTDIR"/etc/iscsi
+# Install custom systemd unit file
+- |
+ install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR$PREFIX"/lib/systemd/system/iscsid.service
+ [Unit]
+ Description=Open iSCSI Daemon
+ After=network.target
+
+ [Service]
+ Type=forking
+ ExecStart=/usr/sbin/iscsid
+
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+# Install iscsi socket unit
+- |
+ install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR$PREFIX"/lib/systemd/system/iscsid.socket
+ [Unit]
+ Description=Open-iSCSI iscsid Socket
+
+ [Socket]
+ ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
+
+ [Install]
+ WantedBy=sockets.target
+ EOF