[ironic-agent] Use svc-map for enabling agent

Switch to using svc-map element for systemd based agent.

This allows both .deb and .rpm installs to share the
element for systemd based installs. There are not any
plans to package a .rpm package for upstart or sysv, so
these are left as is.

Change-Id: Idca7ad97355cae785162989774a7e6dea6fdc5b5
Closes-Bug: #1490584
This commit is contained in:
John Trowbridge 2015-08-31 10:27:44 -04:00
parent 12d71c6447
commit 109e02b1ce
6 changed files with 15 additions and 5 deletions

View File

@ -16,5 +16,10 @@ Beyond installing the ironic-python-agent, this element does the following:
in order to support source based installation of ironic-python-agent and its in order to support source based installation of ironic-python-agent and its
dependencies. dependencies.
.. note::
The package based install currently only enables the service when using the
systemd init system. This can easily be changed if there is an agent
package which includes upstart or sysv packaging.
.. note:: .. note::
Using the ramdisk will require at least 1.5GB of ram Using the ramdisk will require at least 1.5GB of ram

View File

@ -1,2 +1,5 @@
dhcp-all-interfaces dhcp-all-interfaces
package-installs
pkg-map
source-repositories source-repositories
svc-map

View File

@ -28,8 +28,7 @@ case "$DIB_INIT_SYSTEM" in
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
;; ;;
systemd) systemd)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/$(svc-map ironic-python-agent).service
systemctl enable ironic-python-agent.service
;; ;;
sysv) sysv)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init

View File

@ -14,7 +14,7 @@ umask 022
expect stop expect stop
pre-start script pre-start script
echo Starting Ironic Python Agnet echo Starting Ironic Python Agent
end script end script
exec /usr/bin/ironic-python-agent exec /usr/bin/ironic-python-agent

View File

@ -17,11 +17,10 @@ case "$DIB_INIT_SYSTEM" in
;; ;;
systemd) systemd)
systemctl disable iptables.service systemctl disable iptables.service
systemctl enable openstack-ironic-python-agent.service systemctl enable $(svc-map ironic-python-agent).service
;; ;;
sysv) sysv)
update-rc.d iptables disable update-rc.d iptables disable
update-rc.d openstack-ironic-python-agent enable
;; ;;
*) *)
echo "Unsupported init system" echo "Unsupported init system"

View File

@ -0,0 +1,4 @@
ironic-python-agent:
default: openstack-ironic-python-agent
redhat: openstack-ironic-python-agent
debian: ironic-python-agent