diff options
Diffstat (limited to 'docker')
8 files changed, 19 insertions, 137 deletions
diff --git a/docker/neutron/neutron-agents/Dockerfile.j2 b/docker/neutron/neutron-agents/Dockerfile.j2 index 7eb1a1152..3fb1ffe30 100644 --- a/docker/neutron/neutron-agents/Dockerfile.j2 +++ b/docker/neutron/neutron-agents/Dockerfile.j2 @@ -32,6 +32,8 @@ COPY neutron-dhcp-agent/ /opt/kolla/neutron-dhcp-agent COPY neutron-l3-agent/ /opt/kolla/neutron-l3-agent COPY neutron-metadata-agent/ /opt/kolla/neutron-metadata-agent -CMD ["/usr/bin/supervisord"] +COPY start.sh / + +CMD ["/start.sh"] {{ include_footer }} diff --git a/docker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh b/docker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh deleted file mode 100755 index badbd86a1..000000000 --- a/docker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/dhcp_agent.ini /opt/kolla/neutron-agents/dnsmasq.conf" -TARGET="/etc/neutron/" -OWNER="neutron" - -for f in $SOURCES; do - if [[ -f "$f" ]]; then - fname=$(basename $f) - cp $f $TARGET - chown ${OWNER}: $TARGET/$fname - chmod 0644 $TARGET/$fname - fi -done diff --git a/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh b/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh index 9186a5c90..96ecd80e6 100755 --- a/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh +++ b/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh @@ -1,37 +1,11 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/neutron-dhcp-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini" - # Loading common functions. -source /opt/kolla/kolla-common.sh source /opt/kolla/config-sudoers.sh -# Override set_configs() here because it doesn't work for fat containers like -# this one. -set_configs() { - case $KOLLA_CONFIG_STRATEGY in - COPY_ALWAYS) - source /opt/kolla/neutron-dhcp-agent/config-external.sh - ;; - COPY_ONCE) - if [[ -f /configured-dhcp ]]; then - echo 'INFO - Neutron-dhcp has already been configured; Refusing to copy new configs' - return - fi - source /opt/kolla/neutron-dhcp-agent/config-external.sh - touch /configured-dhcp - ;; - - *) - echo '$KOLLA_CONFIG_STRATEGY is not set properly' - exit 1 - ;; - esac -} - -# Execute config strategy -set_configs +# Will be removed when neutron-agents is a thin container +CMD="/usr/bin/neutron-dhcp-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini" exec $CMD $ARGS diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/config-external.sh b/docker/neutron/neutron-agents/neutron-l3-agent/config-external.sh deleted file mode 100755 index e6eb049a4..000000000 --- a/docker/neutron/neutron-agents/neutron-l3-agent/config-external.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/l3_agent.ini /opt/kolla/neutron-agents/fwaas_driver.ini" -TARGET="/etc/neutron/" -OWNER="neutron" - -for f in $SOURCES; do - if [[ -f "$f" ]]; then - fname=$(basename $f) - cp $f $TARGET - chown ${OWNER}: $TARGET/$fname - chmod 0644 $TARGET/$fname - fi -done - -SOURCE="/opt/kolla/neutron-agents/ml2_conf.ini" -TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/start.sh b/docker/neutron/neutron-agents/neutron-l3-agent/start.sh index 2a0f18b62..aa73b090b 100755 --- a/docker/neutron/neutron-agents/neutron-l3-agent/start.sh +++ b/docker/neutron/neutron-agents/neutron-l3-agent/start.sh @@ -1,37 +1,11 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/neutron-l3-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" - # Loading common functions. -source /opt/kolla/kolla-common.sh source /opt/kolla/config-sudoers.sh -# Override set_configs() here because it doesn't work for fat containers like -# this one. -set_configs() { - case $KOLLA_CONFIG_STRATEGY in - COPY_ALWAYS) - source /opt/kolla/neutron-l3-agent/config-external.sh - ;; - COPY_ONCE) - if [[ -f /configured-l3 ]]; then - echo 'INFO - Neutron-l3 has already been configured; Refusing to copy new configs' - return - fi - source /opt/kolla/neutron-l3-agent/config-external.sh - touch /configured-l3 - ;; - - *) - echo '$KOLLA_CONFIG_STRATEGY is not set properly' - exit 1 - ;; - esac -} - -# Execute config strategy -set_configs +# Will be removed when this container is broken out into thin containers +CMD="/usr/bin/neutron-l3-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" exec $CMD $ARGS diff --git a/docker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh b/docker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh deleted file mode 100755 index 319ee3793..000000000 --- a/docker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/metadata_agent.ini" -TARGET="/etc/neutron/" -OWNER="neutron" - -for f in $SOURCES; do - if [[ -f "$f" ]]; then - fname=$(basename $f) - cp $f $TARGET - chown ${OWNER}: $TARGET/$fname - chmod 0644 $TARGET/$fname - fi -done diff --git a/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh b/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh index 04c37159a..d94f767e2 100755 --- a/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh +++ b/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh @@ -1,37 +1,11 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/neutron-metadata-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini" - # Loading common functions. -source /opt/kolla/kolla-common.sh source /opt/kolla/config-sudoers.sh -# Override set_configs() here because it doesn't work for fat containers like -# this one. -set_configs() { - case $KOLLA_CONFIG_STRATEGY in - COPY_ALWAYS) - source /opt/kolla/neutron-metadata-agent/config-external.sh - ;; - COPY_ONCE) - if [[ -f /configured-md ]]; then - echo 'INFO - Neutron-metadata has already been configured; Refusing to copy new configs' - return - fi - source /opt/kolla/neutron-metadata-agent/config-external.sh - touch /configured-md - ;; - - *) - echo '$KOLLA_CONFIG_STRATEGY is not set properly' - exit 1 - ;; - esac -} - -# Execute config strategy -set_configs +# Will be removed when this container is broken out in thin containers +CMD="/usr/bin/neutron-metadata-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini" exec $CMD $ARGS diff --git a/docker/neutron/neutron-agents/start.sh b/docker/neutron/neutron-agents/start.sh new file mode 100755 index 000000000..8b5f302cf --- /dev/null +++ b/docker/neutron/neutron-agents/start.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -o errexit + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +exec /usr/bin/supervisord |
