Merge "Add an element to configure iBFT network interfaces"
This commit is contained in:
commit
56c72a0139
5
diskimage_builder/elements/ibft-interfaces/README.rst
Normal file
5
diskimage_builder/elements/ibft-interfaces/README.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
===============
|
||||||
|
ibft-interfaces
|
||||||
|
===============
|
||||||
|
|
||||||
|
Initialize network interfaces with information provided through iBFT.
|
4
diskimage_builder/elements/ibft-interfaces/element-deps
Normal file
4
diskimage_builder/elements/ibft-interfaces/element-deps
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
dib-init-system
|
||||||
|
install-static
|
||||||
|
package-installs
|
||||||
|
pkg-map
|
@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Initialize iBFT network interfaces
|
||||||
|
After=network.target
|
||||||
|
Before=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
User=root
|
||||||
|
ExecStart=/usr/local/sbin/init-ibft-interfaces.sh
|
||||||
|
RemainAfterExit=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: init-ibft-interfaces
|
||||||
|
# Required-Start: $local_fs networking
|
||||||
|
# Required-Stop: $local_fs
|
||||||
|
# Default-Start: S
|
||||||
|
# Default-Stop: 0 6
|
||||||
|
# X-Start-Before:
|
||||||
|
# Short-Description: Initialize iBFT interfaces
|
||||||
|
# Description: Initialize iBFT network interfaces
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
NAME=init-ibft-interfaces
|
||||||
|
INIT_NAME=/etc/init.d/${NAME}
|
||||||
|
SCRIPT_NAME=/usr/local/sbin/${NAME}.sh
|
||||||
|
|
||||||
|
[ -x $SCRIPT_NAME ] || exit 0
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
$SCRIPT_NAME
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $INIT_NAME {start|stop}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
@ -0,0 +1,16 @@
|
|||||||
|
# init-ibft-interfaces - Initialize iBFT network interfaces
|
||||||
|
|
||||||
|
description "Initialize iBFT network interfaces"
|
||||||
|
|
||||||
|
start on runlevel [2345]
|
||||||
|
stop on runlevel [!2345]
|
||||||
|
|
||||||
|
respawn
|
||||||
|
respawn limit 10 5
|
||||||
|
umask 022
|
||||||
|
|
||||||
|
expect stop
|
||||||
|
|
||||||
|
console output
|
||||||
|
|
||||||
|
exec /usr/local/sbin/init-ibft-interfaces.sh
|
@ -0,0 +1 @@
|
|||||||
|
iscsi_package:
|
13
diskimage_builder/elements/ibft-interfaces/pkg-map
Normal file
13
diskimage_builder/elements/ibft-interfaces/pkg-map
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"family": {
|
||||||
|
"redhat": {
|
||||||
|
"iscsi_package": "iscsi-initiator-utils"
|
||||||
|
},
|
||||||
|
"gentoo": {
|
||||||
|
"iscsi_package": "sys-block/open-iscsi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"iscsi_package": "open-iscsi"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
set -eu
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
case "$DIB_INIT_SYSTEM" in
|
||||||
|
upstart)
|
||||||
|
;;
|
||||||
|
systemd)
|
||||||
|
systemctl enable init-ibft-interfaces.service
|
||||||
|
;;
|
||||||
|
sysv)
|
||||||
|
update-rc.d init-ibft-interfaces.init defaults
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported init system $DIB_INIT_SYSTEM"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
@ -0,0 +1,3 @@
|
|||||||
|
iscsi_boot_sysfs
|
||||||
|
iscsi_ibft
|
||||||
|
iscsi_tcp
|
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# dib-lint: disable=dibdebugtrace
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# iscsistart is a part of the dependencies, but check just in case.
|
||||||
|
if ! iscsistart -v; then
|
||||||
|
echo "iscsistart not found, iBFT devices won't be connected"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if iscsistart -f; then
|
||||||
|
if ! iscsistart -N; then
|
||||||
|
echo "Could not configure iBFT devices"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Make sure the events for new devices are processed
|
||||||
|
udevadm settle
|
||||||
|
else
|
||||||
|
echo "No iBFT devices to configure, exiting"
|
||||||
|
fi
|
@ -1,4 +1,5 @@
|
|||||||
dhcp-all-interfaces
|
dhcp-all-interfaces
|
||||||
|
ibft-interfaces
|
||||||
install-static
|
install-static
|
||||||
no-final-image
|
no-final-image
|
||||||
package-installs
|
package-installs
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Adds a new element ``init-ibft-interfaces`` to initialize network
|
||||||
|
interfaces with configuration provided via iBFT. The new element is now
|
||||||
|
a dependency of the ``ironic-agent`` element.
|
Loading…
Reference in New Issue
Block a user