diskimage-builder/elements/ironic-agent/install.d/60-ironic-agent-install
Ramakrishnan G afe739ceed Fix disk image create errors behind proxy
This commit fixes errors while trying to create a
DIB ramdisk with ironic-agent element when built
behind proxy. It fixes the issue by making it install
latest versions of pip and setuptools which has the
fixes for them.

Change-Id: I1ffb832ebab009b2d77a46e6c8fc758dd9632359
Closes-Bug: 1449852
2015-05-04 21:17:47 -07:00

30 lines
784 B
Bash
Executable file

#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
install-packages python-dev qemu-utils parted hdparm util-linux genisoimage gcc
# Install the latest version of pip and setuptools which has some
# fixes for building behind proxy.
curl -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
python /tmp/get-pip.py
pip install -U setuptools
pip install -r /tmp/ironic-python-agent/requirements.txt
pip install /tmp/ironic-python-agent
rm -f /tmp/get-pip.py
sudo echo $'[Unit]
Description=Ironic Python Agent\n
[Service]
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