From be61d8a2b5537e4ea3374f5245afaa299972a03e Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 5 Dec 2018 17:45:52 -0500 Subject: [PATCH] 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 --- docker/services/keepalived.yaml | 13 ++++++++++++ environments/undercloud.yaml | 4 +++- extraconfig/pre_deploy/undercloud_pre.sh | 8 -------- extraconfig/pre_deploy/undercloud_pre.yaml | 23 ---------------------- 4 files changed, 16 insertions(+), 32 deletions(-) delete mode 100644 extraconfig/pre_deploy/undercloud_pre.sh delete mode 100644 extraconfig/pre_deploy/undercloud_pre.yaml diff --git a/docker/services/keepalived.yaml b/docker/services/keepalived.yaml index cad6ce0a93..4804d53917 100644 --- a/docker/services/keepalived.yaml +++ b/docker/services/keepalived.yaml @@ -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 diff --git a/environments/undercloud.yaml b/environments/undercloud.yaml index adceb151aa..c644ad0fd3 100644 --- a/environments/undercloud.yaml +++ b/environments/undercloud.yaml @@ -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 diff --git a/extraconfig/pre_deploy/undercloud_pre.sh b/extraconfig/pre_deploy/undercloud_pre.sh deleted file mode 100644 index e5311d432c..0000000000 --- a/extraconfig/pre_deploy/undercloud_pre.sh +++ /dev/null @@ -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 diff --git a/extraconfig/pre_deploy/undercloud_pre.yaml b/extraconfig/pre_deploy/undercloud_pre.yaml deleted file mode 100644 index e63b48a53c..0000000000 --- a/extraconfig/pre_deploy/undercloud_pre.yaml +++ /dev/null @@ -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}