Add upgrade-bifrost command
This performs the same as a deploy-bifrost, but first stops the bifrost services and container if they are running. This can help where a docker stop may lead to an ungraceful shutdown, possibly due to running multiple services in one container. Change-Id: I131ab3c0e850a1d7f5c814ab65385e3a03dfcc74 Implements: blueprint bifrost-upgrade Closes-Bug: #1834332
This commit is contained in:
parent
6db1db57df
commit
9cac1137d0
@ -1,10 +1,35 @@
|
|||||||
---
|
---
|
||||||
- name: Stopping bifrost_deploy container
|
- block:
|
||||||
become: true
|
- name: Check if bifrost_deploy container is running
|
||||||
kolla_docker:
|
become: true
|
||||||
action: "stop_container"
|
kolla_container_facts:
|
||||||
common_options: "{{ docker_common_options }}"
|
name:
|
||||||
name: "bifrost_deploy"
|
- bifrost_deploy
|
||||||
|
register: container_facts
|
||||||
|
|
||||||
|
- block:
|
||||||
|
# Ensure that all services are stopped gracefully, and in a sensible
|
||||||
|
# order.
|
||||||
|
- name: Stop services gracefully
|
||||||
|
become: true
|
||||||
|
command: docker exec bifrost_deploy systemctl stop {{ item }}.service
|
||||||
|
with_items:
|
||||||
|
- ironic-api
|
||||||
|
- ironic-conductor
|
||||||
|
- ironic-inspector
|
||||||
|
- mariadb
|
||||||
|
- rabbitmq-server
|
||||||
|
- nginx
|
||||||
|
|
||||||
|
- name: Stopping bifrost_deploy container
|
||||||
|
become: true
|
||||||
|
kolla_docker:
|
||||||
|
action: "stop_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
name: "bifrost_deploy"
|
||||||
|
|
||||||
|
when: "'bifrost_deploy' in container_facts"
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['bifrost']
|
- inventory_hostname in groups['bifrost']
|
||||||
- "'bifrost_deploy' not in skip_stop_containers"
|
- "'bifrost_deploy' not in skip_stop_containers"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: config.yml
|
# Stop the container prior to redeploying it.
|
||||||
|
- include_tasks: stop.yml
|
||||||
|
|
||||||
- include_tasks: start.yml
|
- include_tasks: deploy.yml
|
||||||
|
@ -70,6 +70,7 @@ Commands:
|
|||||||
stop Stop Kolla containers
|
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
|
||||||
|
upgrade-bifrost Upgrades an existing bifrost container
|
||||||
genconfig Generate configuration files for enabled OpenStack services
|
genconfig Generate configuration files for enabled OpenStack services
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -106,6 +107,7 @@ reconfigure
|
|||||||
stop
|
stop
|
||||||
certificates
|
certificates
|
||||||
upgrade
|
upgrade
|
||||||
|
upgrade-bifrost
|
||||||
genconfig
|
genconfig
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -324,6 +326,11 @@ EOF
|
|||||||
ACTION="Upgrading OpenStack Environment"
|
ACTION="Upgrading OpenStack Environment"
|
||||||
EXTRA_OPTS="$EXTRA_OPTS -e kolla_action=upgrade -e kolla_serial=${ANSIBLE_SERIAL}"
|
EXTRA_OPTS="$EXTRA_OPTS -e kolla_action=upgrade -e kolla_serial=${ANSIBLE_SERIAL}"
|
||||||
;;
|
;;
|
||||||
|
(upgrade-bifrost)
|
||||||
|
ACTION="Upgrading Bifrost"
|
||||||
|
PLAYBOOK="${BASEDIR}/ansible/bifrost.yml"
|
||||||
|
EXTRA_OPTS="$EXTRA_OPTS -e kolla_action=upgrade"
|
||||||
|
;;
|
||||||
(reconfigure)
|
(reconfigure)
|
||||||
ACTION="Reconfigure OpenStack service"
|
ACTION="Reconfigure OpenStack service"
|
||||||
EXTRA_OPTS="$EXTRA_OPTS -e kolla_action=reconfigure -e kolla_serial=${ANSIBLE_SERIAL}"
|
EXTRA_OPTS="$EXTRA_OPTS -e kolla_action=reconfigure -e kolla_serial=${ANSIBLE_SERIAL}"
|
||||||
|
Loading…
Reference in New Issue
Block a user