diff --git a/elements/ironic-agent/README.rst b/elements/ironic-agent/README.rst index 51414cd1..0484adc1 100644 --- a/elements/ironic-agent/README.rst +++ b/elements/ironic-agent/README.rst @@ -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 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:: Using the ramdisk will require at least 1.5GB of ram diff --git a/elements/ironic-agent/element-deps b/elements/ironic-agent/element-deps index 3f5c9a85..f332d35b 100644 --- a/elements/ironic-agent/element-deps +++ b/elements/ironic-agent/element-deps @@ -1,2 +1,5 @@ dhcp-all-interfaces +package-installs +pkg-map source-repositories +svc-map diff --git a/elements/ironic-agent/install.d/ironic-agent-source-install/60-ironic-agent-install b/elements/ironic-agent/install.d/ironic-agent-source-install/60-ironic-agent-install index 9c9e4bbc..4b7b1c03 100755 --- a/elements/ironic-agent/install.d/ironic-agent-source-install/60-ironic-agent-install +++ b/elements/ironic-agent/install.d/ironic-agent-source-install/60-ironic-agent-install @@ -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 ;; 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 + install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/$(svc-map 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 diff --git a/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf b/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf index e043cad1..4601f19e 100755 --- a/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf +++ b/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf @@ -14,7 +14,7 @@ umask 022 expect stop pre-start script - echo Starting Ironic Python Agnet + echo Starting Ironic Python Agent end script exec /usr/bin/ironic-python-agent diff --git a/elements/ironic-agent/post-install.d/80-ironic-agent b/elements/ironic-agent/post-install.d/80-ironic-agent index 715266b9..9171273f 100755 --- a/elements/ironic-agent/post-install.d/80-ironic-agent +++ b/elements/ironic-agent/post-install.d/80-ironic-agent @@ -23,11 +23,10 @@ case "$DIB_INIT_SYSTEM" in ;; systemd) systemctl disable iptables.service - systemctl enable openstack-ironic-python-agent.service + systemctl enable $(svc-map ironic-python-agent).service ;; sysv) update-rc.d iptables disable - update-rc.d openstack-ironic-python-agent enable ;; *) echo "Unsupported init system" diff --git a/elements/ironic-agent/svc-map b/elements/ironic-agent/svc-map new file mode 100644 index 00000000..d9c79e17 --- /dev/null +++ b/elements/ironic-agent/svc-map @@ -0,0 +1,4 @@ +ironic-python-agent: + default: openstack-ironic-python-agent + redhat: openstack-ironic-python-agent + debian: ironic-python-agent \ No newline at end of file