Re-implement keepalived restart without pre_deploy

... and use host_prep_tasks from config-download.
We are trying to HostPrepConfig resource that use OS::Heat::SoftwareConfig
and the old fashion to run Ansible, for more native config-downlaod.
undercloud_pre is the only service that needs HostPrepConfig now, so
let's switch to config-download.

It restarts keepalived container at each undercloud install & upgrade.
Also it adds support for podman as it uses container_cli variable.

Note: the workaround can still be removed once we have Keepalived 2.0.6
but it won't happen before CentOS8 probably.

Change-Id: I7454013c2e37058b5010a2a6cacfae0d0f873744
Related-Bug: #1791238
This commit is contained in:
Emilien Macchi 2018-12-05 17:45:52 -05:00
parent eb70154796
commit be61d8a2b5
4 changed files with 16 additions and 32 deletions

View File

@ -40,6 +40,12 @@ parameters:
default: false
description: Remove package if the service is being disabled during upgrade
type: boolean
# TODO(emilien) Remove when Keepalived 2.0.6 is out
# https://bugs.launchpad.net/tripleo/+bug/1791238
KeepalivedRestart:
default: false
description: Whether or not restart Keepalived. Useful for Undercloud only.
type: boolean
resources:
@ -104,6 +110,13 @@ outputs:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
command: /usr/local/bin/kolla_start
host_prep_tasks:
- name: Set fact for restarting Keepalived container
set_fact:
restart_keepalived: {get_param: KeepalivedRestart}
- name: Restart Keepalived container
shell: "{{container_cli}} restart keepalived"
when: restart_keepalived|bool
ignore_errors: True
- name: load ip_vs module
import_role:
name: tripleo-module-load

View File

@ -2,7 +2,6 @@ resource_registry:
OS::TripleO::Network::Ports::RedisVipPort: ../network/ports/noop.yaml
OS::TripleO::Network::Ports::ControlPlaneVipPort: ../deployed-server/deployed-neutron-port.yaml
OS::TripleO::Undercloud::Net::SoftwareConfig: ../net-config-undercloud.yaml
OS::TripleO::NodeExtraConfig: ../extraconfig/pre_deploy/undercloud_pre.yaml
OS::TripleO::NodeExtraConfigPost: ../extraconfig/post_deploy/undercloud_post.yaml
OS::TripleO::Services::DockerRegistry: ../puppet/services/docker-registry.yaml
OS::TripleO::Services::ContainerImagePrepare: ../puppet/services/container-image-prepare.yaml
@ -154,3 +153,6 @@ parameter_defaults:
- /usr/share/openstack-octavia-amphora-images:/usr/share/openstack-octavia-amphora-images:ro
NeutronMetadataProxySharedSecret: ''
MetadataNATRule: true
# TODO(emilien) Remove when Keepalived 2.0.6 is out
# https://bugs.launchpad.net/tripleo/+bug/1791238
KeepalivedRestart: true

View File

@ -1,8 +0,0 @@
#!/bin/bash
# This needs to be run after os-net-config. since os-net-config potentially can
# restart network interfaces, which would affects VIPs controlled by
# keepalived.
# TODO(hjensas): Remove this when we have keepalived 2.0.6 or later.
docker container restart keepalived || true

View File

@ -1,23 +0,0 @@
heat_template_version: rocky
description: >
Pre-deployment for the TripleO undercloud
parameters:
server:
type: string
resources:
UndercloudPreConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: {get_file: ./undercloud_pre.sh}
UndercloudPreDeployment:
type: OS::Heat::SoftwareDeployment
properties:
name: UndercloudPreDeployment
server: {get_param: server}
config: {get_resource: UndercloudPreConfig}