Skip to content
Snippets Groups Projects
Commit 15a917a6 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Added support for a stop playbook in kolla"

parents 27ee3973 2cfc069e
No related branches found
No related tags found
No related merge requests found
---
- name: Creating /kolla-stop/tools directory on node
file:
state: directory
path: /tmp/kolla-stop/tools
- name: Copying validate-docker-execute.sh file
copy:
src: ../tools/validate-docker-execute.sh
dest: /tmp/kolla-stop/tools
mode: 0755
- name: Copying stop-containers file
copy:
src: ../tools/stop-containers
dest: /tmp/kolla-stop/tools
mode: 0755
---
- include: copy_tools.yml
- include: stop_containers.yml
---
- name: Stopping Kolla containers
command: /tmp/kolla-stop/tools/stop-containers
---
- hosts: all
roles:
- stop
...@@ -30,6 +30,7 @@ data_files = ...@@ -30,6 +30,7 @@ data_files =
share/kolla/tools = tools/cleanup-containers share/kolla/tools = tools/cleanup-containers
share/kolla/tools = tools/cleanup-host share/kolla/tools = tools/cleanup-host
share/kolla/tools = tools/cleanup-images share/kolla/tools = tools/cleanup-images
share/kolla/tools = tools/stop-containers
share/kolla/doc = doc/* share/kolla/doc = doc/*
share/kolla/etc_examples = etc/* share/kolla/etc_examples = etc/*
share/kolla = tools/init-runonce share/kolla = tools/init-runonce
......
...@@ -50,6 +50,7 @@ Commands: ...@@ -50,6 +50,7 @@ Commands:
post-deploy Do post deploy on deploy node post-deploy Do post deploy on deploy node
pull Pull all images for containers (only pulls, no running container changes) pull Pull all images for containers (only pulls, no running container changes)
reconfigure Reconfigure OpenStack service reconfigure Reconfigure OpenStack service
stop Stop Kolla containers
certificates Generate self-signed certificate for TLS *For Development Only* certificates Generate self-signed certificate for TLS *For Development Only*
upgrade Upgrades existing OpenStack Environment upgrade Upgrades existing OpenStack Environment
genconfig Generate configuration files for enabled OpenStack services genconfig Generate configuration files for enabled OpenStack services
...@@ -206,6 +207,10 @@ EOF ...@@ -206,6 +207,10 @@ EOF
ACTION="Reconfigure OpenStack service" ACTION="Reconfigure OpenStack service"
EXTRA_OPTS="$EXTRA_OPTS -e action=reconfigure -e serial=30%" EXTRA_OPTS="$EXTRA_OPTS -e action=reconfigure -e serial=30%"
;; ;;
(stop)
ACTION="Stop Kolla containers"
PLAYBOOK="${BASEDIR}/ansible/stop.yml"
;;
(certificates) (certificates)
ACTION="Generate TLS Certificates" ACTION="Generate TLS Certificates"
PLAYBOOK="${BASEDIR}/ansible/certificates.yml" PLAYBOOK="${BASEDIR}/ansible/certificates.yml"
......
#!/bin/bash
if [[ $(pgrep qemu) ]]; then
echo "Some qemu processes were detected."
echo "Docker will not be able to stop the nova_libvirt container with those running."
echo "Please clean them up before rerunning this script."
exit 1
fi
if [ -n "$1" ]; then
containers_to_stop=($(docker ps | grep -E "$1" | awk '{print $1}'))
else
containers_to_stop=$(docker ps --filter "label=kolla_version" --format "{{.Names}}" -a)
fi
echo "Stopping containers..."
(docker stop -t 30 ${containers_to_stop} 2>&1) > /dev/null
echo "All containers stopped!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment