diff options
| author | Jeff Peeler <jpeeler@redhat.com> | 2015-08-28 11:26:40 -0400 |
|---|---|---|
| committer | Jeff Peeler <jpeeler@redhat.com> | 2015-09-28 16:10:43 -0400 |
| commit | f5a50a1d7d40fb39bbc503ab1079e89e4aafe3fe (patch) | |
| tree | fd734b1ab909a3c9e06be5cce1eae160f2b5d692 /docker | |
| parent | 40f9f0816f8f94b4d11012a39af21d50195f9a74 (diff) | |
| download | kolla-f5a50a1d7d40fb39bbc503ab1079e89e4aafe3fe.tar.gz kolla-f5a50a1d7d40fb39bbc503ab1079e89e4aafe3fe.zip | |
Add Ansible support for Ironic
Configuration based off upstream documentation here:
http://docs.openstack.org/developer/ironic/deploy/install-guide.html
A few notes:
-ironic-api is not configured to use mod_wsgi
-several places it's noted that discoverd is going away and needs to be
replaced with ironic-inspector - (sqlite connection should be changed
too)
-currently enabling ironic reconfigures nova compute (driver and
scheduler) as well as changes neutron network settings
-a nice enhancement would be to configure the web console
Required post-deployment configuration:
Create the flat network to launch the instances:
neutron net-create --tenant-id $TENANT_ID sharednet1 --shared \
--provider:network_type flat --provider:physical_network physnet1
neutron subnet-create sharednet1 $NETWORK_CIDR --name $SUBNET_NAME \
--ip-version=4 --gateway=$GATEWAY_IP --allocation-pool \
start=$START_IP,end=$END_IP --enable-dhcp
And then the above ID is used to set cleaning_network_uuid in the neutron
section of ironic.conf.
Change-Id: I572e7ff1f23c4e57a2c50817cafe9269fd9950dd
Implements: blueprint ironic-container
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/ironic/ironic-api/Dockerfile.j2 | 7 | ||||
| -rwxr-xr-x | docker/ironic/ironic-api/start.sh | 13 | ||||
| -rw-r--r-- | docker/ironic/ironic-base/Dockerfile.j2 | 1 | ||||
| -rw-r--r-- | docker/ironic/ironic-conductor/Dockerfile.j2 | 7 | ||||
| -rw-r--r-- | docker/ironic/ironic-conductor/config-external.sh | 11 | ||||
| -rwxr-xr-x | docker/ironic/ironic-conductor/start.sh | 6 | ||||
| -rw-r--r-- | docker/ironic/ironic-discoverd/Dockerfile.j2 | 15 | ||||
| -rw-r--r-- | docker/ironic/ironic-discoverd/config-external.sh | 11 | ||||
| -rwxr-xr-x | docker/ironic/ironic-discoverd/start.sh | 6 | ||||
| -rw-r--r-- | docker/ironic/ironic-pxe/Dockerfile.j2 | 35 | ||||
| -rwxr-xr-x | docker/ironic/ironic-pxe/start.sh | 6 |
11 files changed, 71 insertions, 47 deletions
diff --git a/docker/ironic/ironic-api/Dockerfile.j2 b/docker/ironic/ironic-api/Dockerfile.j2 index 112ff8b2d..016b3560b 100644 --- a/docker/ironic/ironic-api/Dockerfile.j2 +++ b/docker/ironic/ironic-api/Dockerfile.j2 @@ -4,15 +4,16 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla) {% if install_type == 'binary' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - openstack-ironic-api \ +# Install delorean version even though version number is less +# http://lists.openstack.org/pipermail/openstack-dev/2015-August/073100.html +RUN VER_TO_GET=$(yum --showduplicates list openstack-ironic-api | awk '/delorean/ {print $2}') \ + && yum -y install openstack-ironic-api-$VER_TO_GET \ && yum clean all {% endif %} {% endif %} COPY start.sh / -COPY config-external.sh /opt/kolla/ CMD ["/start.sh"] diff --git a/docker/ironic/ironic-api/start.sh b/docker/ironic/ironic-api/start.sh index 9d449defb..60b3ea5a0 100755 --- a/docker/ironic/ironic-api/start.sh +++ b/docker/ironic/ironic-api/start.sh @@ -1,10 +1,13 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/ironic-api" -ARGS="" - source /opt/kolla/kolla-common.sh -set_configs -exec $CMD $ARGS +# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases +# of the KOLLA_BOOTSTRAP variable being set, including empty. +if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then + su -s /bin/sh -c "ironic-dbsync upgrade" ironic + exit 0 +fi + +exec $CMD diff --git a/docker/ironic/ironic-base/Dockerfile.j2 b/docker/ironic/ironic-base/Dockerfile.j2 index 2f8207c0e..bb05d2dd7 100644 --- a/docker/ironic/ironic-base/Dockerfile.j2 +++ b/docker/ironic/ironic-base/Dockerfile.j2 @@ -10,6 +10,7 @@ RUN yum -y install \ python-oslo-log \ python-oslo-concurrency \ python-oslo-policy \ + python-oslo-versionedobjects \ && yum clean all {% endif %} diff --git a/docker/ironic/ironic-conductor/Dockerfile.j2 b/docker/ironic/ironic-conductor/Dockerfile.j2 index f62f7b7a0..7fe401b4d 100644 --- a/docker/ironic/ironic-conductor/Dockerfile.j2 +++ b/docker/ironic/ironic-conductor/Dockerfile.j2 @@ -4,15 +4,16 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla) {% if install_type == 'binary' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - openstack-ironic-conductor \ +# Install delorean version even though version number is less +# http://lists.openstack.org/pipermail/openstack-dev/2015-August/073100.html +RUN VER_TO_GET=$(yum --showduplicates list openstack-ironic-conductor | awk '/delorean/ {print $2}') \ + && yum -y install openstack-ironic-conductor-$VER_TO_GET \ && yum clean all {% endif %} {% endif %} COPY start.sh / -COPY config-external.sh /opt/kolla/ CMD ["/start.sh"] diff --git a/docker/ironic/ironic-conductor/config-external.sh b/docker/ironic/ironic-conductor/config-external.sh deleted file mode 100644 index b838ee19d..000000000 --- a/docker/ironic/ironic-conductor/config-external.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -SOURCE="/opt/kolla/ironic-api/ironic.conf" -TARGET="/etc/ironic/ironic.conf" -OWNER="ironic" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/ironic/ironic-conductor/start.sh b/docker/ironic/ironic-conductor/start.sh index c766f04c5..e6b7c5bb5 100755 --- a/docker/ironic/ironic-conductor/start.sh +++ b/docker/ironic/ironic-conductor/start.sh @@ -1,10 +1,6 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/ironic-conductor" -ARGS="" - source /opt/kolla/kolla-common.sh -set_configs -exec $CMD $ARGS +exec $CMD diff --git a/docker/ironic/ironic-discoverd/Dockerfile.j2 b/docker/ironic/ironic-discoverd/Dockerfile.j2 index 1843cb24c..5e15c8d58 100644 --- a/docker/ironic/ironic-discoverd/Dockerfile.j2 +++ b/docker/ironic/ironic-discoverd/Dockerfile.j2 @@ -4,15 +4,22 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla) {% if install_type == 'binary' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - openstack-ironic-discoverd \ - && yum clean all +RUN pip install ironic-discoverd +# discoverd no longer in delorean 9/28/2015, switch to inspector on TODO +#RUN yum -y install \ +# openstack-ironic-discoverd \ +# && yum clean all {% endif %} + +{% elif install_type == 'source' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + {% endif %} COPY start.sh / -COPY config-external.sh /opt/kolla/ CMD ["/start.sh"] diff --git a/docker/ironic/ironic-discoverd/config-external.sh b/docker/ironic/ironic-discoverd/config-external.sh deleted file mode 100644 index a3f82b8f3..000000000 --- a/docker/ironic/ironic-discoverd/config-external.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -SOURCE="/opt/kolla/ironic-discoverd/discoverd.conf" -TARGET="/etc/ironic-discoverd/discoverd.conf" -OWNER="ironic" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/ironic/ironic-discoverd/start.sh b/docker/ironic/ironic-discoverd/start.sh index 093dc517a..e6b7c5bb5 100755 --- a/docker/ironic/ironic-discoverd/start.sh +++ b/docker/ironic/ironic-discoverd/start.sh @@ -1,10 +1,6 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/ironic-discoverd" -ARGS="" - source /opt/kolla/kolla-common.sh -set_configs -exec $CMD $ARGS +exec $CMD diff --git a/docker/ironic/ironic-pxe/Dockerfile.j2 b/docker/ironic/ironic-pxe/Dockerfile.j2 new file mode 100644 index 000000000..d4484d1db --- /dev/null +++ b/docker/ironic/ironic-pxe/Dockerfile.j2 @@ -0,0 +1,35 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + +RUN yum -y install tftp-server syslinux-tftpboot \ + && yum clean all + +# PXE configuration +RUN mkdir -p /tftpboot \ + && cp /var/lib/tftpboot/chain.c32 /tftpboot \ + && echo 're ^(/tftpboot/) /tftpboot/\2' > /tftpboot/map-file \ + && echo 're ^/tftpboot/ /tftpboot/' >> /tftpboot/map-file \ + && echo 're ^(^/) /tftpboot/\1' >> /tftpboot/map-file \ + && echo 're ^([^/]) /tftpboot/\1' >> /tftpboot/map-file + + {% elif base_distro in ['ubuntu', 'debian'] %} +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + + {% endif %} + +{% elif install_type == 'source' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% endif %} + +COPY start.sh / + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/ironic/ironic-pxe/start.sh b/docker/ironic/ironic-pxe/start.sh new file mode 100755 index 000000000..e6b7c5bb5 --- /dev/null +++ b/docker/ironic/ironic-pxe/start.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -o errexit + +source /opt/kolla/kolla-common.sh + +exec $CMD |
