A service to install diskimage-builder

Enabling service 'dib' will install the following repos:
* diskimage-builder
* tripleo-image-elements
* os-collect-config
* os-refresh-config
* os-apply-config

These repos are already pre-fetched in devstack-gate.

This will facilitate gating on changes in these projects by building
a custom image then running the heat-slow job against that image.

diskimage_builder is pip installed from the current git checkout
if the dib service is enabled. This allows devstack gating on
diskimage-builder changes while also allowing diskimage-builder to
be installed from releases for other scenarios (for example, ironic).

Change-Id: Ia911cdee86f5b2e2ba1557e5aa8bf392b92ef555
diff --git a/extras.d/40-dib.sh b/extras.d/40-dib.sh
new file mode 100644
index 0000000..fdae011
--- /dev/null
+++ b/extras.d/40-dib.sh
@@ -0,0 +1,27 @@
+# dib.sh - Devstack extras script to install diskimage-builder
+
+if is_service_enabled dib; then
+    if [[ "$1" == "source" ]]; then
+        # Initial source
+        source $TOP_DIR/lib/dib
+    elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+        echo_summary "Installing diskimage-builder"
+        install_dib
+    elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+        # no-op
+        :
+    elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
+        # no-op
+        :
+    fi
+
+    if [[ "$1" == "unstack" ]]; then
+        # no-op
+        :
+    fi
+
+    if [[ "$1" == "clean" ]]; then
+        # no-op
+        :
+    fi
+fi