64436159e8
Puppet relies on stack_action UPDATE for some cases. Track the ephemeral heat stacks fake state for tripleo undercloud/standalone deployments to match the puppet expectations. For such deployments, the heat stack state is a fake (virtual), as we never update but always create a new ephemeral heat stack. When the deployment is finished w/o errors, create the mark file (unique to the stack name) that is used to indicate to puppet the stack_action has been changed from CREATE to UPDATE. The indication is done via a drop-in file with top level override containing either 'StackAction: CREATE' or 'UPDATE'. The drop-in is created in the working/templates directory and named <Stack_name>-stack-vstate-dropin.yaml. When the deployment fails, remove the mark file, so the serial re-deployments will be considered as creating a stack. The --force-stack-update flag keeps the mark file instead, so the serial re-deployment will be considered (virtually) updating the heat stack. For the --output-only mode, only warn users to control the stack virtual state manually. The state is considered CREATE, unless there is --force-stack-update specified. For --dry-run, also log the expected stack virtual state/action the deployment would go with. Closes-bug: #1778505 Change-Id: I55dc83acb2ed5ee07b4cf57e25135e6201589ac4 Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
75 lines
3.4 KiB
Python
75 lines
3.4 KiB
Python
# Copyright 2015 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
|
|
import os
|
|
|
|
TRIPLEO_HEAT_TEMPLATES = "/usr/share/openstack-tripleo-heat-templates/"
|
|
OVERCLOUD_YAML_NAME = "overcloud.yaml"
|
|
OVERCLOUD_ROLES_FILE = "roles_data.yaml"
|
|
UNDERCLOUD_ROLES_FILE = "roles_data_undercloud.yaml"
|
|
UNDERCLOUD_OUTPUT_DIR = os.path.join(os.environ.get('HOME'))
|
|
STANDALONE_EPHEMERAL_STACK_VSTATE = '/var/lib/tripleo-heat-installer'
|
|
UNDERCLOUD_LOG_FILE = "install-undercloud.log"
|
|
UNDERCLOUD_CONF_PATH = os.path.join(UNDERCLOUD_OUTPUT_DIR, "undercloud.conf")
|
|
OVERCLOUD_NETWORKS_FILE = "network_data.yaml"
|
|
RHEL_REGISTRATION_EXTRACONFIG_NAME = (
|
|
"extraconfig/pre_deploy/rhel-registration/")
|
|
|
|
# The name of the file which holds the plan environment contents
|
|
PLAN_ENVIRONMENT = 'plan-environment.yaml'
|
|
USER_ENVIRONMENT = 'user-environment.yaml'
|
|
USER_PARAMETERS = 'user-environments/tripleoclient-parameters.yaml'
|
|
|
|
# This directory may contain additional environments to use during deploy
|
|
DEFAULT_ENV_DIRECTORY = os.path.join(os.environ.get('HOME'),
|
|
'.tripleo', 'environments')
|
|
|
|
TRIPLEO_PUPPET_MODULES = "/usr/share/openstack-puppet/modules/"
|
|
PUPPET_MODULES = "/etc/puppet/modules/"
|
|
PUPPET_BASE = "/etc/puppet/"
|
|
# Update Queue
|
|
UPDATE_QUEUE = 'update'
|
|
UPGRADE_QUEUE = 'upgrade'
|
|
FFWD_UPGRADE_QUEUE = 'ffwdupgrade'
|
|
CEPH_UPGRADE_QUEUE = 'cephupgrade'
|
|
STACK_TIMEOUT = 240
|
|
|
|
|
|
# The default ffwd upgrade ansible playbooks generated from heat stack output
|
|
FFWD_UPGRADE_PLAYBOOK = "fast_forward_upgrade_playbook.yaml"
|
|
# The default minor update ansible playbooks generated from heat stack output
|
|
MINOR_UPDATE_PLAYBOOKS = ['update_steps_playbook.yaml']
|
|
# The default major upgrade ansible playbooks generated from heat stack output
|
|
MAJOR_UPGRADE_PLAYBOOKS = ["upgrade_steps_playbook.yaml",
|
|
"deploy_steps_playbook.yaml",
|
|
"post_upgrade_steps_playbook.yaml"]
|
|
MAJOR_UPGRADE_SKIP_TAGS = ['validation', 'pre-upgrade']
|
|
# upgrade environment files expected by the client in the --templates
|
|
# tripleo-heat-templates default above $TRIPLEO_HEAT_TEMPLATES
|
|
UPDATE_PREPARE_ENV = "environments/lifecycle/update-prepare.yaml"
|
|
UPDATE_CONVERGE_ENV = "environments/lifecycle/update-converge.yaml"
|
|
UPGRADE_PREPARE_ENV = "environments/lifecycle/upgrade-prepare.yaml"
|
|
UPGRADE_CONVERGE_ENV = "environments/lifecycle/upgrade-converge.yaml"
|
|
FFWD_UPGRADE_PREPARE_ENV = "environments/lifecycle/ffwd-upgrade-prepare.yaml"
|
|
FFWD_UPGRADE_CONVERGE_ENV = "environments/lifecycle/ffwd-upgrade-converge.yaml"
|
|
FFWD_UPGRADE_PREPARE_SCRIPT = ("#!/bin/bash \n"
|
|
"rm -f /usr/libexec/os-apply-config/templates/"
|
|
"etc/os-net-config/config.json || true \n")
|
|
CEPH_UPGRADE_PREPARE_ENV = "environments/lifecycle/ceph-upgrade-prepare.yaml"
|
|
|
|
ENABLE_SSH_ADMIN_TIMEOUT = 300
|
|
ENABLE_SSH_ADMIN_STATUS_INTERVAL = 5
|
|
ENABLE_SSH_ADMIN_SSH_PORT_TIMEOUT = 300
|