Adds Ubuntu and Debian to ironic-python-agent Support-list

Adds support for Ubuntu and Debian to ironic-python-agent. This will
enable building ramdisk with Ubuntu and Debian as base OS.

Updated README to further clarify what the element does.

Change-Id: I194f85b051974d8ccb197a0993a67761046cfe98
This commit is contained in:
Om Kumar 2015-07-06 20:44:54 +05:30 committed by John Trowbridge
parent 9ac258f028
commit 9f46c3ba0c
8 changed files with 137 additions and 13 deletions

View File

@ -1,5 +1,17 @@
============ ============
ironic-agent ironic-agent
============ ============
Build ramdisk with ironic-python-agent. Builds a ramdisk with ironic-python-agent. More information can be found at:
Works only on Fedora, therefore fedora element is mandatory. https://github.com/openstack/ironic-python-agent/
Beyond installing the ironic-python-agent, this element does the following:
* Installs the ``dhcp-all-interfaces`` so the node, upon booting, attempts to
obtain an IP address on all available network interfaces.
* Disables the ``iptables`` service on SysV and systemd based systems.
* Disables the ``ufw`` service on Upstart based systems.
* Installs packages required for the operation of the ironic-python-agent::
``qemu-utils`` ``parted`` ``hdparm`` ``util-linux`` ``genisoimage``
* When installing from source, ``python-dev`` and ``gcc`` are also installed
in order to support source based installation of ironic-python-agent and its
dependencies.

View File

@ -6,6 +6,7 @@ fi
set -eu set -eu
set -o pipefail set -o pipefail
SCRIPTDIR=$(dirname $0)
install-packages python-dev qemu-utils parted hdparm util-linux genisoimage gcc install-packages python-dev qemu-utils parted hdparm util-linux genisoimage gcc
# Install the latest version of pip and setuptools which has some # Install the latest version of pip and setuptools which has some
@ -18,13 +19,24 @@ pip install -U setuptools
pip install -r /tmp/ironic-python-agent/requirements.txt pip install -r /tmp/ironic-python-agent/requirements.txt
pip install /tmp/ironic-python-agent pip install /tmp/ironic-python-agent
sudo echo $'[Unit] if [ ! -f /usr/bin/ironic-python-agent ]; then
Description=Ironic Python Agent\n ln -s /usr/local/bin/ironic-python-agent /usr/bin/ironic-python-agent
[Service] fi
ExecStart=/usr/bin/ironic-python-agent
Restart=always
RestartSec=30s\n
[Install]
WantedBy=multi-user.target\n' > /usr/lib/systemd/system/ironic-python-agent.service
sudo systemctl enable ironic-python-agent.service case "$DIB_INIT_SYSTEM" in
upstart)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
;;
systemd)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service
systemctl enable ironic-python-agent.service
;;
sysv)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init
update-rc.d ironic-python-agent.init defaults
;;
*)
echo "Unsupported init system"
exit 1
;;
esac

View File

@ -0,0 +1,20 @@
# ironic-python-agent - Openstack Ironic Python Agnet
#
# The ironic-python-agent helps ironic in deploying instances.
description "Ironic Python Agnet"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
expect stop
pre-start script
echo Starting Ironic Python Agnet
end script
exec /usr/bin/ironic-python-agent

View File

@ -0,0 +1,31 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: ironic-python-agent
# Required-Start: $local_fs networking
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 6
# X-Start-Before:
# Short-Description: Ironic Python Agent
# Description: Starts Ironic Python Agent for instance deployment
### END INIT INFO
NAME=ironic-python-agent
INIT_NAME=/etc/init.d/${NAME}
SCRIPT_NAME=/usr/bin/${NAME}
[ -x $SCRIPT_NAME ] || exit 0
case "$1" in
start)
$SCRIPT_NAME
;;
stop)
;;
*)
echo "Usage: $INIT_NAME {start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,12 @@
[Unit]
Description=Ironic Python Agent
After=network.target
[Service]
ExecStart=/usr/bin/ironic-python-agent
Restart=always
RestartSec=30s
[Install]
WantedBy=multi-user.target

View File

@ -1 +1 @@
scsi-target-utils: tgt:

View File

@ -0,0 +1,21 @@
{
"distro": {
"rhel": {
"tgt": "targetcli"
},
"centos":{
"tgt": "scsi-target-utils"
}
},
"family": {
"redhat": {
"tgt": "scsi-target-utils"
},
"debian": {
"tgt": "tgt"
}
},
"default": {
"tgt": "tgt"
}
}

View File

@ -9,4 +9,20 @@ set -o pipefail
install-packages -e python-dev git cloud-init install-packages -e python-dev git cloud-init
rm -rf /tmp/ironic-python-agent rm -rf /tmp/ironic-python-agent
sudo systemctl disable iptables.service case "$DIB_INIT_SYSTEM" in
upstart)
if [ -f /etc/init/ufw.conf ]; then
mv /etc/init/ufw.conf /etc/init/ufw.conf.disabled
fi
;;
systemd)
systemctl disable iptables.service
;;
sysv)
update-rc.d iptables disable
;;
*)
echo "Unsupported init system"
exit 1
;;
esac