2017-03-01 13:57:13 +00:00
# certain initialization steps (run in a container) will occur
2017-03-29 14:43:45 -06:00
# on the role marked as primary controller or the first role listed
2017-11-20 14:48:03 +00:00
{%- if enabled_roles is not defined or enabled_roles == [] -%}
2017-09-11 14:39:06 +01:00
# On upgrade certain roles can be disabled for operator driven upgrades
# See major_upgrade_steps.j2.yaml and post-upgrade.j2.yaml
{%- set enabled_roles = roles -%}
{%- endif -%}
{%- set primary_role = [enabled_roles[0]] -%}
{%- for role in enabled_roles -%}
2017-03-29 14:43:45 -06:00
{%- if 'primary' in role.tags and 'controller' in role.tags -%}
{%- set _ = primary_role.pop() -%}
{%- set _ = primary_role.append(role) -%}
{%- endif -%}
{%- endfor -%}
{%- set primary_role_name = primary_role[0].name -%}
# primary role is: {{primary_role_name}}
2017-04-11 11:44:46 +01:00
{% set deploy_steps_max = 6 -%}
2017-07-21 11:43:25 +01:00
{% set update_steps_max = 6 -%}
2018-10-04 11:50:11 +02:00
{% set external_update_steps_max = 2 -%}
2018-03-12 17:02:36 +01:00
{% set pre_upgrade_rolling_steps_max = 1 -%}
2017-08-04 14:55:48 +03:00
{% set upgrade_steps_max = 6 -%}
2019-08-26 10:20:04 +02:00
{% set external_upgrade_steps_max = 3 -%}
2018-01-17 12:28:55 +05:30
{% set post_upgrade_steps_max = 4 -%}
2018-01-23 22:43:49 +05:30
{% set post_update_steps_max = 4 -%}
2019-04-10 07:49:20 -04:00
{% set scale_steps_max = 1 -%}
2017-04-11 11:44:46 +01:00
2018-03-05 19:28:35 +01:00
heat_template_version: rocky
2017-03-01 13:57:13 +00:00
description: >
Post-deploy configuration steps via puppet for all roles,
as defined in ../roles_data.yaml
parameters:
servers:
type: json
description: Mapping of Role name e.g Controller to a list of servers
role_data:
type: json
description: Mapping of Role name e.g Controller to the per-role data
DeployIdentifier:
default: ''
type: string
description: >
Setting this to a unique value will re-run any deployment tasks which
perform configuration on a Heat stack-update.
2018-05-07 15:54:11 -06:00
deployment_source_hosts:
2018-08-01 16:35:21 -04:00
default: 'Undercloud'
2018-05-07 15:54:11 -06:00
type: string
description: Host or hostgroup that runs the deployment
deployment_target_hosts:
2020-04-27 16:51:56 +01:00
default: ''
2018-05-07 15:54:11 -06:00
type: string
2020-04-27 16:51:56 +01:00
description: >
Host or hostgroup that consists of the target systems for the deployment.
Defaults to all hosts in the current Heat stack if not set.
2017-03-01 13:57:13 +00:00
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
Fix ConfigDebug for puppet host runs
Before pike we used to be able to add -e environments/config-debug.yaml
and that would give us debug logs for puppet. With the move to ansible
running puppet we lost this feature.
Let's make sure that the old ConfigDebug variable still works with
the ansible playbook-based deploy steps. With this patch and ConfigDebug
set to true, we correctly get the puppet debug logs:
TASK [debug] *******************************************************************
ok: [localhost] => {
"(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))": [
"Warning: Undefined variable 'deploy_config_name'; ",
" (file & line not available)",
"Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README. at [\"/etc/puppet/modules/ntp/manifests/init.pp\", 54]:[\"/etc/puppet/modules/tripleo/manifests/profile/base/time/ntp.pp\", 29]",
" (at /etc/puppet/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')",
"Debug: Runtime environment: puppet_version=4.8.2, ruby_version=2.0.0, run_mode=user, default_encoding=UTF-8",
"Debug: Loading external facts from /etc/puppet/modules/openstacklib/facts.d",
"Debug: Loading external facts from /var/lib/puppet/facts.d",
....
Change-Id: Ia726fb8ca4a6f7bbbd7a1284d76ff42df6825d01
Closes-Bug: #1722752
2017-10-11 12:47:01 +02:00
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
2020-04-20 14:02:21 +02:00
HideSensitiveLogs:
default: true
type: boolean
description: >
Set it to false if you don't want to activate the no_log feature within
ansible modules.
2018-03-06 13:43:07 -05:00
EnablePuppet:
default: true
description: Whether to run the puppet (baremetal) deployment tasks.
type: boolean
2019-10-10 12:01:23 -04:00
EnablePaunch:
2019-12-28 18:13:18 -05:00
default: false
2020-05-28 11:18:54 -04:00
description: >
(DEPRECATED) Whether to run paunch during container deployment tasks.
2019-10-10 12:01:23 -04:00
type: boolean
2017-06-26 09:53:31 -04:00
DockerPuppetDebug:
2018-10-25 12:15:12 +02:00
type: boolean
default: false
2020-02-28 13:59:47 -05:00
description: Set to True to enable debug logging with Puppet Containers
2017-08-25 23:01:24 -04:00
DockerPuppetProcessCount:
type: number
2018-07-05 14:01:10 +03:00
default: 6
2019-03-01 14:58:57 -05:00
description: Number of concurrent processes to use when running container-puppet to generate config files.
2018-08-03 16:51:23 -04:00
ContainerCli:
type: string
2019-03-04 19:17:04 -05:00
default: 'podman'
2018-08-03 16:51:23 -04:00
description: CLI tool used to manage containers.
constraints:
- allowed_values: ['docker', 'podman']
2018-03-08 09:13:42 -05:00
DockerPuppetMountHostPuppet:
type: boolean
default: true
description: Whether containerized puppet executions use modules from the baremetal host. Defaults to true. Can be set to false to consume puppet modules from containers directly.
2019-02-08 09:55:07 +01:00
ContainerLogStdoutPath:
type: string
description: Absolute path for container stdout output (Podman only)
default: /var/log/containers/stdouts
2019-04-12 12:08:31 -04:00
ContainerHealthcheckDisabled:
type: boolean
description: Whether or not we disable the container healthcheck.
default: false
2019-03-21 15:11:13 +01:00
SELinuxMode:
default: 'enforcing'
description: Configures SELinux mode
type: string
constraints:
- allowed_values: [ 'enforcing', 'permissive', 'disabled' ]
2018-12-10 18:47:41 +01:00
{% for role in enabled_roles %}
{{role.name}}Count:
description: Number of {{role.name}} nodes to deploy
type: number
default: {{role.CountDefault|default(0)}}
{% endfor %}
2019-04-18 15:28:50 -04:00
ServiceNetMapLower:
description: Mapping of service name to network name
type: json
default: {}
2019-06-06 10:38:23 -04:00
ValidateControllersIcmp:
default: true
description: Validation to ensure that all controllers can be reached with ICMP
type: boolean
ValidateGatewaysIcmp:
default: true
description: Validation to ensure that all gateways can be reached with ICMP
type: boolean
ValidateFqdn:
default: false
description: Optional validation to ensure FQDN as set by Nova matches the name set in /etc/hosts.
type: boolean
PingTestIpsMap:
default: ''
description: A map of role name to a space separated list of IP addresses used to ping test each available network interface.
type: json
2019-06-05 17:29:38 -04:00
StackAction:
type: string
description: >
Heat action on performed top-level stack. Note StackUpdateType is
set to UPGRADE when a major-version upgrade is in progress.
constraints:
- allowed_values: ['CREATE', 'UPDATE']
2020-09-02 10:29:16 -04:00
NetworkSafeDefaults:
default: true
description: Allow to enable/disable safe networking defaults if os-net-config would fail to run with the provided config.
type: boolean
2019-06-06 20:49:42 -04:00
DeployArtifactURLs:
default: []
2021-03-18 12:55:46 -05:00
description: A list of HTTP URLs containing deployment artifacts to be pulled.
Currently supports tarballs and RPM packages.
type: comma_delimited_list
DeployArtifactFILEs:
default: []
description: A list of files containing deployment artifacts to be pushed.
2019-06-06 20:49:42 -04:00
Currently supports tarballs and RPM packages.
type: comma_delimited_list
2019-06-07 10:19:43 -04:00
HostsEntry:
2020-03-26 12:26:53 +01:00
default: []
type: comma_delimited_list
description: A list of entries to be added to /etc/hosts on each node.
2019-06-07 16:01:29 -04:00
AnsibleHostVarsMap:
type: json
default: {}
2019-06-13 12:41:30 -04:00
StackUpdateType:
type: string
description: >
Type of update, to differentiate between UPGRADE and UPDATE cases
when StackAction is UPDATE (both are the same stack action).
constraints:
2020-07-06 22:56:28 +02:00
- allowed_values: ['', 'UPGRADE']
2019-06-13 12:41:30 -04:00
default: ''
ContainerCli:
type: string
default: 'podman'
description: CLI tool used to manage containers.
constraints:
- allowed_values: ['docker', 'podman']
EnabledServices:
default: []
type: comma_delimited_list
2019-06-19 17:09:28 -04:00
ControlVirtualIP:
type: string
EnabledNetworks:
type: comma_delimited_list
NetVipMap:
type: json
{%- for network in networks if network.enabled|default(true) %}
{{network.name}}NetName:
default: {{network.name_lower}}
description: The name of the {{network.name_lower}} network.
type: string
{%- endfor %}
CloudNames:
type: json
EnableInternalTLS:
type: boolean
default: false
2019-07-03 09:29:25 -04:00
CloudDomain:
default: 'localdomain'
type: string
description: >
The DNS domain used for the hosts. This must match the
overcloud_domain_name configured on the undercloud.
2019-07-12 11:58:00 +02:00
NovaAdditionalCell:
default: false
description: Whether this is an cell additional to the default cell.
type: boolean
2019-07-24 16:06:06 -04:00
AllNodesExtraMapData:
default: {}
type: json
description: Map of extra data (hieradata) to set on each node.
2019-10-22 14:31:42 -04:00
UndercloudHostsEntries:
default: []
description: >
List of undercloud hosts entries to be appended to /etc/hosts. The
value is populated with the HEAT_HOSTS entries on the undercloud by
tripleoclient when running deploy.
type: comma_delimited_list
ExtraHostsEntries:
default: []
description: List of extra hosts entries to be appended to /etc/hosts
type: comma_delimited_list
VipHostsEntries:
default: []
description: List of VIP (virtual IP) hosts entries to be appended to /etc/hosts
type: comma_delimited_list
2019-12-02 17:08:11 -05:00
KeystoneResourcesConfigs:
description: The keystone resources config.
type: json
default: {}
2020-04-27 16:51:56 +01:00
RootStackName:
description: The name of the stack/plan.
type: string
2021-03-05 20:59:54 +00:00
NetCidrMap:
description: Mapping of CIDRs to network name
type: json
default: {}
2017-03-01 13:57:13 +00:00
2020-05-28 11:18:54 -04:00
parameter_groups:
- label: deprecated
description: |
The following parameters are deprecated and will be removed. They should not
be relied on for new deployments. If you have concerns regarding deprecated
parameters, please contact the TripleO development team on IRC or the
OpenStack mailing list.
parameters:
- EnablePaunch
2017-05-06 02:19:47 +02:00
conditions:
2018-12-10 18:47:41 +01:00
{% for role in enabled_roles %}
{{role.name}}NonZero:
not:
equals:
- {get_param: {{role.name}}Count}
- 0
{% endfor %}
2017-05-06 02:19:47 +02:00
2017-03-01 13:57:13 +00:00
resources:
2017-10-06 11:41:59 +02:00
ExternalDeployTasks:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
# processing from per-role unique tasks into globally unique tasks
expression: coalesce($.data, []).flatten().distinct()
data:
{%- for role in enabled_roles %}
- get_param: [role_data, {{role.name}}, external_deploy_tasks]
{%- endfor %}
2017-11-22 17:45:19 +00:00
ExternalPostDeployTasks:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
# processing from per-role unique tasks into globally unique tasks
expression: coalesce($.data, []).flatten().distinct()
data:
{%- for role in enabled_roles %}
- get_param: [role_data, {{role.name}}, external_post_deploy_tasks]
{%- endfor %}
2019-04-10 07:49:20 -04:00
ScaleTasks:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
# processing from per-role unique tasks into globally unique tasks
expression: coalesce($.data, []).flatten().distinct()
data:
{%- for role in enabled_roles %}
- get_param: [role_data, {{role.name}}, scale_tasks]
{%- endfor %}
2018-06-29 16:14:36 +02:00
ExternalUpdateTasks:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
# processing from per-role unique tasks into globally unique tasks
expression: coalesce($.data, []).flatten().distinct()
data:
{%- for role in enabled_roles %}
- get_param: [role_data, {{role.name}}, external_update_tasks]
{%- endfor %}
ExternalUpgradeTasks:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
# processing from per-role unique tasks into globally unique tasks
expression: coalesce($.data, []).flatten().distinct()
data:
{%- for role in enabled_roles %}
- get_param: [role_data, {{role.name}}, external_upgrade_tasks]
{%- endfor %}
2017-10-19 18:06:42 +01:00
BootstrapServerId:
type: OS::Heat::Value
properties:
value:
yaql:
2018-08-06 12:23:28 -04:00
# Use a constant string of "bootstrap_server_id" when there are no
# servers in the primary role, such as in the case when all
# Controllers are blacklisted. No server id's will match the string
# which is what we want when all are blacklisted.
expression: switch($.data = {} => "no_bootstrap_server", $.data != {} => $.data.items().orderBy($[0]).first()[1])
2017-10-19 18:06:42 +01:00
data: {get_param: [servers, {{primary_role_name}}]}
2017-09-11 14:39:06 +01:00
# BEGIN CONFIG STEPS, only on enabled_roles
{%- for role in enabled_roles %}
2017-06-08 23:18:44 +02:00
# Note, this should be the last step to execute configuration changes.
# Ensure that all {{role.name}}ExtraConfigPost steps are executed
# after all the previous deployment steps.
{{role.name}}ExtraConfigPost:
2018-12-10 18:47:41 +01:00
condition: {{role.name}}NonZero
2017-06-08 23:18:44 +02:00
type: OS::TripleO::NodeExtraConfigPost
2017-03-01 13:57:13 +00:00
properties:
2017-06-08 23:18:44 +02:00
servers: {get_param: [servers, {{role.name}}]}
2019-04-25 21:23:57 -04:00
EndpointMap: {get_param: EndpointMap}
2017-03-01 13:57:13 +00:00
2017-06-08 23:18:44 +02:00
# The {{role.name}}PostConfig steps are in charge of
# quiescing all services, i.e. in the Controller case,
# we should run a full service reload.
{{role.name}}PostConfig:
2018-12-10 18:47:41 +01:00
condition: {{role.name}}NonZero
2017-06-08 23:18:44 +02:00
type: OS::TripleO::Tasks::{{role.name}}PostConfig
2017-03-01 13:57:13 +00:00
depends_on:
2017-09-11 14:39:06 +01:00
{%- for dep in enabled_roles %}
2017-06-08 23:18:44 +02:00
- {{dep.name}}ExtraConfigPost
2017-07-17 10:15:13 +02:00
{%- endfor %}
2017-03-01 13:57:13 +00:00
properties:
2017-06-08 23:18:44 +02:00
servers: {get_param: servers}
input_values:
2018-12-10 16:35:04 +05:30
deploy_identifier: {get_param: DeployIdentifier}
2017-03-01 13:57:13 +00:00
{% endfor %}
2017-07-20 17:11:44 +01:00
outputs:
RoleConfig:
description: Mapping of config data for all roles
value:
2017-12-04 13:55:10 +00:00
global_vars:
deploy_steps_max: {{deploy_steps_max}}
2019-04-18 15:28:50 -04:00
service_net_map: {get_param: ServiceNetMapLower}
2019-06-06 10:38:23 -04:00
validate_controllers_icmp: {get_param: ValidateControllersIcmp}
validate_gateways_icmp: {get_param: ValidateGatewaysIcmp}
validate_fqdn: {get_param: ValidateFqdn}
ping_test_ips: {get_param: PingTestIpsMap}
2019-06-05 17:29:38 -04:00
stack_action: {get_param: StackAction}
2020-09-02 10:29:16 -04:00
network_safe_defaults: {get_param: NetworkSafeDefaults}
2020-08-28 15:36:06 -06:00
deploy_artifact_urls: {get_param: DeployArtifactURLs}
2021-03-18 12:55:46 -05:00
deploy_artifact_files: {get_param: DeployArtifactFILEs}
2019-06-07 10:19:43 -04:00
hosts_entry: {get_param: HostsEntry}
2019-06-13 12:41:30 -04:00
primary_role_name: {{ primary_role_name }}
deploy_identifier: {get_param: DeployIdentifier}
stack_update_type: {get_param: StackUpdateType}
container_cli: {get_param: ContainerCli}
enabled_services: {get_param: EnabledServices}
2019-06-19 17:09:28 -04:00
control_virtual_ip: {get_param: ControlVirtualIP}
enabled_networks: {get_param: EnabledNetworks}
net_vip_map: {get_param: NetVipMap}
2019-07-12 11:58:00 +02:00
nova_additional_cell: {get_param: NovaAdditionalCell}
2020-04-20 14:02:21 +02:00
hide_sensitive_logs: {get_param: HideSensitiveLogs}
2019-06-19 17:09:28 -04:00
{%- for network in networks if network.enabled|default(true) %}
{{network.name_lower}}_net_name: {get_param: {{network.name}}NetName}
2019-07-02 09:20:20 -04:00
{%- endfor %}
networks:
{%- for network in networks if network.enabled|default(true) %}
{{network.name}}:
name: {get_param: {{network.name}}NetName}
name_lower: {{ network.name_lower }}
2019-06-19 17:09:28 -04:00
{%- endfor %}
network_virtual_ips:
ctlplane:
ip_address: {get_param: [NetVipMap, ctlplane]}
index: 1
{%- for network in networks if network.vip|default(false) and network.enabled|default(true) %}
# External virtual ip is currently being handled separately as public_virtual_ip.
# Likewise, optional StorageNFS virtual ip is handled separately as ganesha_vip.
{%- if network.name != 'External' and network.name != 'StorageNFS' %}
{{network.name_lower}}:
ip_address: {get_param: [NetVipMap, {get_param: {{network.name}}NetName}]}
index: {{loop.index + 1}}
{%- endif %}
{%- endfor %}
cloud_names: {get_param: CloudNames}
enable_internal_tls: {get_param: EnableInternalTLS}
2019-07-03 09:29:25 -04:00
cloud_domain: {get_param: CloudDomain}
2019-07-24 16:06:06 -04:00
all_nodes_extra_map_data: {get_param: AllNodesExtraMapData}
2019-10-22 14:31:42 -04:00
undercloud_hosts_entries: {get_param: UndercloudHostsEntries}
extra_hosts_entries: {get_param: ExtraHostsEntries}
vip_hosts_entries: {get_param: VipHostsEntries}
2019-12-02 17:08:11 -05:00
keystone_resources: {get_param: KeystoneResourcesConfigs}
2021-03-05 20:59:54 +00:00
net_cidr_map: {get_param: NetCidrMap}
2020-02-24 17:44:24 +00:00
common_deploy_steps_playbooks: {get_file: deploy-steps-playbooks-common.yaml}
2017-11-22 18:37:39 +00:00
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
2020-12-14 16:23:03 +01:00
common_container_config_scripts: {get_file: common-container-config-scripts.yaml}
2020-02-04 12:11:15 +01:00
hiera_steps_tasks: {get_file: hiera-steps-tasks.yaml}
2019-11-19 18:06:28 +01:00
deploy_steps_tasks_step_0: {get_file: deploy-steps-tasks-step-0.yaml}
2019-09-05 17:55:19 -04:00
common_deploy_steps_tasks_step_1: {get_file: deploy-steps-tasks-step-1.yaml}
2019-09-19 21:49:21 -05:00
container_puppet_script: {get_file: ./container-puppet.sh}
2020-01-22 14:07:06 -05:00
generate-config-tasks: {get_file: generate-config-tasks.yaml}
2020-01-22 14:11:33 -05:00
host-container-puppet-tasks: {get_file: host-container-puppet-tasks.yaml}
2017-09-20 12:48:19 -04:00
deploy_steps_playbook:
2020-02-24 16:09:02 +00:00
{% block deploy_steps_str_replace_params %}
2017-09-20 12:48:19 -04:00
str_replace:
params:
2017-10-19 18:06:42 +01:00
BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
2018-05-07 15:54:11 -06:00
DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
2020-04-27 16:51:56 +01:00
DEPLOY_TARGET_HOST:
if:
- equals:
- {get_param: deployment_target_hosts}
- ""
- {get_param: RootStackName}
- {get_param: deployment_target_hosts}
2018-12-10 16:35:04 +05:30
DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
2018-08-06 10:15:56 -04:00
ENABLE_DEBUG: {get_param: ConfigDebug}
ENABLE_PUPPET: {get_param: EnablePuppet}
2018-08-03 16:51:23 -04:00
CONTAINER_CLI: {get_param: ContainerCli}
2019-02-08 09:55:07 +01:00
CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
2019-04-12 12:08:31 -04:00
CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
2018-08-06 10:15:56 -04:00
DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
2018-03-08 09:13:42 -05:00
DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
2019-03-21 15:11:13 +01:00
SELINUX_MODE: {get_param: SELinuxMode}
2020-02-24 16:09:02 +00:00
{% endblock %}
2017-09-20 12:48:19 -04:00
template: |
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2019-06-13 12:41:30 -04:00
2020-04-24 08:54:30 -06:00
- hosts: DEPLOY_TARGET_HOST
2020-04-30 16:09:06 -06:00
strategy: tripleo_linear
2020-04-24 08:54:30 -06:00
name: Manage SELinux
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2020-01-10 07:57:35 -05:00
any_errors_fatal: yes
2019-03-21 15:11:13 +01:00
tasks:
- name: Set selinux state
2020-06-16 15:01:43 -06:00
become: true
2019-03-21 15:11:13 +01:00
selinux:
policy: targeted
state: SELINUX_MODE
2020-04-24 08:54:30 -06:00
- hosts: all
2020-04-30 16:09:06 -06:00
strategy: tripleo_linear
2020-04-24 08:54:30 -06:00
name: Generate /etc/hosts
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes
tasks:
2020-03-11 16:52:52 +00:00
{% raw %}
2020-02-04 09:40:28 +01:00
- name: Configure Hosts Entries
include_role:
name: tripleo_hosts_entries
vars:
2020-03-11 16:52:52 +00:00
tripleo_hosts_entries_undercloud_hosts_entries: "{{ undercloud_hosts_entries }}"
tripleo_hosts_entries_extra_hosts_entries: "{{ extra_hosts_entries }}"
tripleo_hosts_entries_vip_hosts_entries: "{{ vip_hosts_entries }}"
{% endraw %}
2019-03-21 15:11:13 +01:00
2018-05-07 15:54:11 -06:00
- hosts: DEPLOY_TARGET_HOST
2020-04-30 16:09:06 -06:00
strategy: tripleo_linear
2018-01-12 15:52:26 -05:00
name: Common roles for TripleO servers
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-12-04 11:49:05 -08:00
any_errors_fatal: yes
2019-02-13 14:23:26 -05:00
# pre_tasks run before any roles in a play, so we use it for the
# named debug task for --start-at-task.
pre_tasks:
- name: Common roles for TripleO servers
2019-12-10 18:13:54 -05:00
delegate_to: localhost
run_once: true
2019-02-13 14:23:26 -05:00
debug:
2019-10-02 17:45:59 -04:00
msg: Use --start-at-task 'Common roles for TripleO servers' to resume from this task
2020-06-30 14:54:29 +02:00
tasks:
- include_role:
name: tripleo_bootstrap
- include_role:
name: tripleo_ssh_known_hosts
2017-12-04 11:49:05 -08:00
tags:
2018-01-12 15:52:26 -05:00
- common_roles
2018-01-30 19:41:35 -05:00
2018-05-07 15:54:11 -06:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2019-10-22 10:59:52 -06:00
name: Deploy step tasks for step 0
2020-06-16 15:01:43 -06:00
become: true
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-04-04 09:57:49 -04:00
any_errors_fatal: yes
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
step: 0
2018-12-10 16:35:04 +05:30
deploy_identifier: DEPLOY_IDENTIFIER
2018-10-25 08:26:16 -04:00
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 08:26:16 -04:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
2018-03-08 09:13:42 -05:00
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2018-04-04 09:57:49 -04:00
tasks:
2020-02-21 12:10:02 +00:00
- import_tasks: deploy_steps_tasks_step_0.yaml
2018-04-04 09:57:49 -04:00
tags:
- overcloud
- deploy_steps
2019-03-11 20:50:17 +01:00
- step0
2018-06-05 09:05:13 -04:00
2019-05-14 15:34:31 -04:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2021-01-25 19:57:02 +09:00
name: Server pre network steps
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2019-05-14 15:34:31 -04:00
any_errors_fatal: yes
tasks:
2020-09-03 08:43:23 -06:00
{% raw %}
2020-02-04 12:11:15 +01:00
- import_tasks: hiera_steps_tasks.yaml
2021-01-25 19:57:02 +09:00
- name: Server pre-network deployments
2020-09-03 08:43:23 -06:00
delegate_to: localhost
run_once: true
debug:
2021-01-25 19:57:02 +09:00
msg: Use --start-at-task 'Server pre-network deployments' to resume from this task
2020-09-03 08:43:23 -06:00
- include_tasks: deployments.yaml
vars:
force: false
2021-01-25 19:57:02 +09:00
with_items: "{{ hostvars[inventory_hostname]['pre_network_' ~ tripleo_role_name]|default([]) }}"
2020-09-03 08:43:23 -06:00
{% endraw %}
2019-06-13 11:13:23 -04:00
tags:
- overcloud
- pre_deploy_steps
2018-05-07 15:54:11 -06:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2020-09-02 10:52:07 +05:30
name: Server network deployments
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-10-20 13:43:38 +02:00
any_errors_fatal: yes
2017-09-20 12:48:19 -04:00
tasks:
2020-03-11 16:52:52 +00:00
{% raw %}
2020-09-03 08:43:23 -06:00
- name: Network Configuration
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Network Configuration' to resume from this task
2019-07-02 13:05:31 +02:00
- name: Check NetworkConfig script existence
2020-09-18 08:47:56 +05:30
delegate_to: localhost
stat:
path: "{{ tripleo_role_name ~ '/NetworkConfig' }}"
2019-07-02 13:05:31 +02:00
register: NetworkConfig_stat
2020-09-29 19:08:09 +05:30
when: not tripleo_network_config_with_ansible
2020-07-31 15:54:33 -06:00
- name: Run Network Config
import_role:
name: tripleo_network_config
vars:
tripleo_network_config_script_path: "{{ NetworkConfig_stat.stat.path }}"
tripleo_network_config_action: "{{ stack_action }}"
tripleo_network_config_network_deployment_actions: "{{ network_deployment_actions }}"
tripleo_network_config_async_timeout: "{{ async_timeout | default(300) }}"
tripleo_network_config_async_poll: "{{ async_poll | default(3) }}"
2020-09-02 10:29:16 -04:00
tripleo_network_config_hide_sensitive_logs: false
tripleo_network_config_legacy_script: false
tripleo_network_config_safe_defaults: "{{ network_safe_defaults }}|bool"
2020-07-31 15:54:33 -06:00
when:
2020-09-29 19:08:09 +05:30
- tripleo_network_config_with_ansible or NetworkConfig_stat.stat.exists
2021-01-29 07:26:03 -07:00
tags:
- overcloud
- pre_deploy_steps
- network_deploy_steps
{% endraw %}
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server network validation
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes
tasks:
{% raw %}
2020-08-21 13:43:35 -06:00
- name: Basic Network Validation
include_role:
name: tripleo_nodes_validation
vars:
tripleo_nodes_validation_validate_controllers_icmp: "{{ validate_controllers_icmp }}"
2020-10-06 07:21:52 -06:00
tripleo_nodes_validation_validate_gateway_icmp: "{{ validate_gateways_icmp }}"
2020-08-21 13:43:35 -06:00
tripleo_nodes_validation_validate_fqdn: "{{ validate_fqdn }}"
tripleo_nodes_validation_ping_test_ips: "{{ ping_test_ips.get(tripleo_role_name).split(' ') | list | unique }}"
2020-09-02 10:52:07 +05:30
tags:
- overcloud
- pre_deploy_steps
- network_deploy_steps
{% endraw %}
2019-06-06 10:38:23 -04:00
2021-01-25 19:57:02 +09:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server pre deployment steps
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes
tasks:
{% raw %}
- import_tasks: hiera_steps_tasks.yaml
- name: Server deployments
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Server deployments' to resume from this task
- include_tasks: deployments.yaml
vars:
force: false
with_items: "{{ hostvars[inventory_hostname]['pre_deployments_' ~ tripleo_role_name]|default([]) }}"
{% endraw %}
tags:
- overcloud
- pre_deploy_steps
2020-06-09 12:24:03 -06:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2020-06-09 12:24:03 -06:00
name: Host prep steps
2020-06-16 15:01:43 -06:00
become: true
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-10-20 13:43:38 +02:00
any_errors_fatal: yes
2017-09-20 12:48:19 -04:00
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
2018-12-10 16:35:04 +05:30
deploy_identifier: DEPLOY_IDENTIFIER
2018-10-25 08:26:16 -04:00
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 08:26:16 -04:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
2018-03-08 09:13:42 -05:00
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2017-09-20 12:48:19 -04:00
tasks:
2020-09-03 08:43:23 -06:00
{% raw %}
2021-03-18 12:55:46 -05:00
- name: Deploy pull Artifacts
2020-08-28 15:36:06 -06:00
tripleo_deploy_artifacts:
2021-03-18 12:55:46 -05:00
artifact_urls: "{{ deploy_artifact_urls | default([]) }}"
artifact_paths: "{{ deploy_artifact_files | default([]) }}"
2020-08-28 15:36:06 -06:00
when:
2021-03-18 12:55:46 -05:00
- ((deploy_artifact_urls | default([]) | length) > 0) or
((deploy_artifact_files | default([]) | length) > 0)
2020-09-03 08:43:23 -06:00
{% endraw %}
2020-06-09 12:24:03 -06:00
{%- for role in roles %}
- name: {{role.name}} Host prep block
when:
- tripleo_role_name == '{{role.name}}'
block:
- name: {{role.name}} Host prep steps
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task '{{role.name}} Host prep steps' to resume from this task
2021-02-22 07:07:55 -07:00
- include_tasks: {{role.name}}/host_prep_tasks.yaml
2020-06-09 12:24:03 -06:00
{%- endfor %}
2017-11-08 10:49:50 -05:00
tags:
- overcloud
- host_prep_steps
2018-01-30 19:41:35 -05:00
2017-10-06 11:41:59 +02:00
{%- for step in range(1,deploy_steps_max) %}
2018-01-30 19:41:35 -05:00
2018-05-07 15:54:11 -06:00
- hosts: DEPLOY_SOURCE_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2017-11-08 10:35:39 -05:00
name: External deployment step {{step}}
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-10-20 13:43:38 +02:00
any_errors_fatal: yes
2017-11-07 07:31:25 -05:00
become: false
2017-10-06 11:41:59 +02:00
vars:
2018-10-25 08:26:16 -04:00
bootstrap_server_id: BOOTSTRAP_SERVER_ID
2017-10-06 11:41:59 +02:00
step: '{{step}}'
2018-12-10 16:35:04 +05:30
deploy_identifier: DEPLOY_IDENTIFIER
2018-10-25 08:26:16 -04:00
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 08:26:16 -04:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
2018-03-08 09:13:42 -05:00
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2017-10-06 11:41:59 +02:00
tasks:
2019-02-13 14:23:26 -05:00
- name: External deployment step {{step}}
2019-12-10 18:13:54 -05:00
delegate_to: localhost
run_once: true
2019-02-13 14:23:26 -05:00
debug:
2019-10-02 17:45:59 -04:00
msg: Use --start-at-task 'External deployment step {{step}}' to resume from this task
2020-07-22 09:35:12 -04:00
- include_tasks: "external_deploy_steps_tasks_step{{step}}.yaml"
when:
- "'external_deploy_steps_tasks_step{{step}}.yaml' is exists"
2017-11-08 10:49:50 -05:00
tags:
- external
- external_deploy_steps
2018-08-31 16:59:03 -04:00
- step{{step}}
2018-01-30 19:41:35 -05:00
2018-05-07 15:54:11 -06:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2019-10-22 10:59:52 -06:00
name: Deploy step tasks for {{step}}
2020-06-16 15:01:43 -06:00
become: true
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-10-20 13:43:38 +02:00
any_errors_fatal: yes
2017-10-06 11:41:59 +02:00
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
step: '{{step}}'
2018-12-10 16:35:04 +05:30
deploy_identifier: DEPLOY_IDENTIFIER
2018-08-06 10:15:56 -04:00
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
2018-08-03 16:51:23 -04:00
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-08-06 10:15:56 -04:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
2018-03-08 09:13:42 -05:00
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2017-10-06 11:41:59 +02:00
tasks:
2019-05-08 17:14:51 +02:00
- name: Write the config_step hieradata for the deploy step {{step}} tasks
2020-03-11 16:52:52 +00:00
{% raw %}
2019-05-08 17:14:51 +02:00
copy:
2020-03-11 16:52:52 +00:00
content: "{{ dict(step=step | int) | to_json }}"
2019-05-08 17:14:51 +02:00
dest: /etc/puppet/hieradata/config_step.json
force: true
mode: '0600'
2020-03-11 16:52:52 +00:00
{% endraw %}
2019-09-05 17:55:19 -04:00
{% if step == 1 %}
2020-01-29 17:19:52 -05:00
- name: Overcloud common bootstrap tasks for step 1
2020-06-09 12:43:24 -06:00
block:
- name: Overcloud common bootstrap tasks for step 1
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Overcloud common bootstrap tasks for step 1' to resume from this task
- name: "Check if /var/lib/tripleo-config/container-startup-config/step_{{step}} already exists"
stat:
path: "/var/lib/tripleo-config/container-startup-config/step_{{step}}"
register: container_startup_configs_json_stat
- name: Write config data at the start of step 1
include_tasks: common_deploy_steps_tasks_step_1.yaml
when:
- ((deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or
not container_startup_configs_json_stat.stat.exists)
2019-09-05 17:55:19 -04:00
{% endif %}
2021-01-27 17:08:46 +01:00
- name: Deploy step tasks for {{step}}
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Deploy step tasks for {{step}}' to resume from this task
{%- for role in roles %}
- include_tasks: "{{role.name}}/deploy_steps_tasks_step{{step}}.yaml"
when:
- tripleo_role_name == '{{role.name}}'
- "'{{role.name}}/deploy_steps_tasks_step{{step}}.yaml' is exists"
{%- endfor %}
2019-02-13 14:23:26 -05:00
- name: Overcloud common deploy step tasks {{step}}
2020-06-09 12:43:24 -06:00
block:
- name: Overcloud common deploy step tasks {{step}}
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Overcloud common deploy step tasks {{step}}' to resume from this task
- name: "Check if /var/lib/tripleo-config/container-startup-config/step_{{step}} already exists"
stat:
path: "/var/lib/tripleo-config/container-startup-config/step_{{step}}"
register: container_startup_configs_json_stat
- include_tasks: common_deploy_steps_tasks.yaml
when: (deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or
(container_startup_configs_json_stat is defined and not container_startup_configs_json_stat.stat.exists)
2017-11-08 10:49:50 -05:00
tags:
- overcloud
- deploy_steps
2018-08-31 16:59:03 -04:00
- step{{step}}
2018-01-30 19:41:35 -05:00
2017-10-06 11:41:59 +02:00
{%- endfor %}
2018-05-07 15:54:11 -06:00
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
2020-04-30 13:23:32 -06:00
strategy: tripleo_free
2017-09-20 12:48:19 -04:00
name: Server Post Deployments
2020-06-16 15:01:43 -06:00
become: true
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-10-20 13:43:38 +02:00
any_errors_fatal: yes
2017-09-20 12:48:19 -04:00
tasks:
2019-02-13 14:23:26 -05:00
- name: Server Post Deployments
2019-12-10 18:13:54 -05:00
delegate_to: localhost
run_once: true
2019-02-13 14:23:26 -05:00
debug:
2019-10-02 17:45:59 -04:00
msg: Use --start-at-task 'Server Post Deployments' to resume from this task
2020-03-11 16:52:52 +00:00
{% raw %}
2018-06-11 17:55:13 -04:00
- include_tasks: deployments.yaml
2017-09-20 12:48:19 -04:00
vars:
force: false
2020-03-11 16:52:52 +00:00
with_items: "{{ hostvars[inventory_hostname]['post_deployments_' ~ tripleo_role_name]|default([]) }}"
2017-11-08 10:49:50 -05:00
tags:
- overcloud
- post_deploy_steps
2020-03-11 16:52:52 +00:00
{% endraw %}
2018-01-30 19:41:35 -05:00
2018-05-07 15:54:11 -06:00
- hosts: DEPLOY_SOURCE_HOST
2020-04-30 16:09:06 -06:00
strategy: tripleo_linear
2017-11-22 17:45:19 +00:00
name: External deployment Post Deploy tasks
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2017-11-22 17:45:19 +00:00
any_errors_fatal: yes
become: false
2018-10-25 08:26:16 -04:00
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
2018-12-10 16:35:04 +05:30
deploy_identifier: DEPLOY_IDENTIFIER
2018-10-25 08:26:16 -04:00
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 08:26:16 -04:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
2018-03-08 09:13:42 -05:00
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2017-11-22 17:45:19 +00:00
tasks:
2019-02-13 14:23:26 -05:00
- name: External deployment Post Deploy tasks
2019-12-10 18:13:54 -05:00
delegate_to: localhost
run_once: true
2019-02-13 14:23:26 -05:00
debug:
2019-10-02 17:45:59 -04:00
msg: Use --start-at-task 'External deployment Post Deploy tasks' to resume from this task
2018-07-03 15:50:26 +05:30
- import_tasks: external_post_deploy_steps_tasks.yaml
2017-11-22 17:45:19 +00:00
tags:
- external
- external_deploy_steps
2019-03-20 11:57:29 -04:00
- external_post_deploy_steps
2018-01-30 19:41:35 -05:00
2017-10-06 11:41:59 +02:00
external_deploy_steps_tasks: {get_attr: [ExternalDeployTasks, value]}
2017-11-22 17:45:19 +00:00
external_post_deploy_steps_tasks: {get_attr: [ExternalPostDeployTasks, value]}
2018-05-07 15:54:11 -06:00
update_steps_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2018-05-07 15:54:11 -06:00
template: |
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2019-05-13 15:25:57 +02:00
{%- for role in roles %}
- hosts: {{role.name}}
2018-05-07 15:54:11 -06:00
name: Run update
2020-03-11 16:52:52 +00:00
serial: "{% raw %}{{ update_serial | default({% endraw %}{{ role.update_serial | default(1) }}{% raw %})}}{% endraw %}"
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-11-21 15:48:53 +01:00
any_errors_fatal: yes
2018-10-16 12:53:38 -04:00
vars:
2018-10-25 12:15:12 +02:00
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
2018-10-16 12:53:38 -04:00
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 12:15:12 +02:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2019-02-08 10:38:10 +01:00
tripleo_minor_update: true
2021-01-20 16:59:35 +01:00
tripleo_redhat_enforce: {{role.rhsm_enforce|default("true")}}
2018-05-07 15:54:11 -06:00
tasks:
2020-02-04 12:11:15 +01:00
- import_tasks: hiera_steps_tasks.yaml
2020-12-14 16:23:03 +01:00
- import_tasks: common_container_config_scripts.yaml
2020-07-02 18:56:07 +02:00
{%- for step in range(0,update_steps_max) %}
- import_tasks: "{{ role.name }}/update_tasks_step{{ step }}.yaml"
vars:
step: "{{ step }}"
{%- endfor %}
- import_tasks: "{{role.name}}/host_prep_tasks.yaml"
2018-06-11 14:06:40 +02:00
when: tripleo_role_name == '{{role.name}}'
2019-11-19 18:06:28 +01:00
- import_tasks: deploy_steps_tasks_step_0.yaml
vars:
step: 0
2020-01-29 12:11:25 +00:00
- name: Write config data at the start of step 1
import_tasks: common_deploy_steps_tasks_step_1.yaml
2020-07-02 18:56:07 +02:00
{%- for step in range(1,deploy_steps_max) %}
- import_tasks: common_deploy_steps_tasks.yaml
vars:
step: "{{ step }}"
{%- endfor %}
{%- for step in range(0,post_update_steps_max) %}
- import_tasks: "{{ role.name }}/post_update_tasks_step{{ step }}.yaml"
vars:
step: "{{ step }}"
{%- endfor %}
2019-05-13 15:25:57 +02:00
{%- endfor %}
2018-06-29 16:14:36 +02:00
external_update_steps_tasks: {get_attr: [ExternalUpdateTasks, value]}
external_update_steps_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2018-06-29 16:14:36 +02:00
template: |
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2019-08-30 23:25:11 +02:00
{%- for step in range(external_update_steps_max) %}
2018-06-29 16:14:36 +02:00
- hosts: DEPLOY_SOURCE_HOST
2019-08-30 23:25:11 +02:00
name: External update step {{step}}
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-06-29 16:14:36 +02:00
any_errors_fatal: yes
become: false
2019-08-09 08:37:48 +02:00
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
2019-08-30 23:25:11 +02:00
step: '{{step}}'
2019-08-09 08:37:48 +02:00
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2018-06-29 16:14:36 +02:00
tasks:
2019-08-30 23:25:11 +02:00
- import_tasks: external_update_steps_tasks.yaml
2018-06-29 16:14:36 +02:00
tags:
2019-08-30 23:25:11 +02:00
- step{{step}}
2018-06-29 16:14:36 +02:00
- external
- external_update_steps
2019-08-30 23:25:11 +02:00
{%- endfor %}
{%- for step in range(1,deploy_steps_max) %}
2018-06-29 16:14:36 +02:00
# putting both update and deploy tasks in the same
# playbook allows influencing the deploy tasks by
# variables "exported" from update tasks
- hosts: DEPLOY_SOURCE_HOST
2019-08-30 23:25:11 +02:00
name: External deploy step {{step}}
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-06-29 16:14:36 +02:00
any_errors_fatal: yes
become: false
2019-08-09 08:37:48 +02:00
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
2019-08-30 23:25:11 +02:00
step: '{{step}}'
2019-08-09 08:37:48 +02:00
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2018-06-29 16:14:36 +02:00
tasks:
2019-08-30 23:25:11 +02:00
- import_tasks: external_deploy_steps_tasks.yaml
2018-06-29 16:14:36 +02:00
tags:
- external
- external_deploy_steps
2019-08-30 23:25:11 +02:00
- step{{step}}
{%- endfor %}
2018-03-12 17:02:36 +01:00
pre_upgrade_rolling_steps_tasks: |
{%- for role in roles %}
2020-02-21 12:10:02 +00:00
- include_tasks: {{role.name}}/pre_upgrade_rolling_tasks.yaml
2018-05-14 11:15:09 -07:00
when: tripleo_role_name == '{{role.name}}'
2020-02-21 12:10:02 +00:00
tags:
- always
2018-03-12 17:02:36 +01:00
{%- endfor %}
2018-05-07 15:54:11 -06:00
pre_upgrade_rolling_steps_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2018-05-07 15:54:11 -06:00
template: |
2019-05-13 15:25:57 +02:00
{%- for role in roles %}
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST:{{role.name}}"
deploy_target_host: "DEPLOY_TARGET_HOST"
2019-05-13 15:25:57 +02:00
- hosts: {{role.name}}
2018-05-07 15:54:11 -06:00
name: Run pre-upgrade rolling tasks
2019-05-13 15:25:57 +02:00
serial: {{ role.deploy_serial | default(1) }}
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-11-21 15:48:53 +01:00
any_errors_fatal: yes
2018-05-07 15:54:11 -06:00
tasks:
2018-07-03 15:50:26 +05:30
- include_tasks: pre_upgrade_rolling_steps_tasks.yaml
2018-05-07 15:54:11 -06:00
with_sequence: start=0 end={{pre_upgrade_rolling_steps_max-1}}
loop_control:
loop_var: step
2019-05-13 15:25:57 +02:00
{%- endfor %}
2018-05-07 15:54:11 -06:00
upgrade_steps_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2018-05-07 15:54:11 -06:00
template: |
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2018-12-18 12:53:51 +01:00
{%- for step in range(0,upgrade_steps_max) %}
- hosts: DEPLOY_TARGET_HOST
2020-11-11 19:14:23 +01:00
strategy: tripleo_free
2018-12-18 12:53:51 +01:00
name: Upgrade tasks for step {{step}}
2020-06-16 15:01:43 -06:00
become: true
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-11-21 15:48:53 +01:00
any_errors_fatal: yes
2018-12-18 12:53:51 +01:00
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
step: '{{step}}'
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
container_cli: CONTAINER_CLI
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-05-07 15:54:11 -06:00
tasks:
2018-12-18 12:53:51 +01:00
{%- for role in roles %}
2020-02-21 12:10:02 +00:00
- include_tasks: {{role.name}}/upgrade_tasks_step{{step}}.yaml
2018-12-18 12:53:51 +01:00
when: tripleo_role_name == '{{role.name}}'
2020-02-21 12:10:02 +00:00
tags:
- always
2018-12-18 12:53:51 +01:00
{%- endfor %}
tags:
- upgrade_steps
- upgrade_step{{step}}
{%- endfor %}
2017-10-11 15:55:06 +03:00
post_upgrade_steps_tasks: |
{%- for role in roles %}
2020-02-21 12:10:02 +00:00
- include_tasks: {{role.name}}/post_upgrade_tasks.yaml
2018-05-14 11:15:09 -07:00
when: tripleo_role_name == '{{role.name}}'
2020-02-21 12:10:02 +00:00
tags:
- always
2017-10-11 15:55:06 +03:00
{%- endfor %}
2018-05-07 15:54:11 -06:00
post_upgrade_steps_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2018-05-07 15:54:11 -06:00
template: |
2020-04-28 10:09:52 +02:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2018-05-07 15:54:11 -06:00
- hosts: DEPLOY_TARGET_HOST
2020-11-11 19:14:23 +01:00
strategy: tripleo_free
2018-11-21 15:48:53 +01:00
any_errors_fatal: yes
2018-05-07 15:54:11 -06:00
tasks:
2018-07-03 15:50:26 +05:30
- include_tasks: post_upgrade_steps_tasks.yaml
2018-05-07 15:54:11 -06:00
with_sequence: start=0 end={{post_upgrade_steps_max-1}}
2018-10-16 12:53:38 -04:00
vars:
2018-10-25 12:15:12 +02:00
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
2018-10-16 12:53:38 -04:00
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 12:15:12 +02:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2018-05-07 15:54:11 -06:00
loop_control:
loop_var: step
2018-06-29 16:14:36 +02:00
external_upgrade_steps_tasks: {get_attr: [ExternalUpgradeTasks, value]}
external_upgrade_steps_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2018-06-29 16:14:36 +02:00
template: |
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2019-08-30 23:25:11 +02:00
{%- for step in range(external_upgrade_steps_max) %}
2018-06-29 16:14:36 +02:00
- hosts: DEPLOY_SOURCE_HOST
2020-11-11 19:14:23 +01:00
strategy: tripleo_free
2019-08-30 23:25:11 +02:00
name: External upgrade step {{step}}
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-06-29 16:14:36 +02:00
any_errors_fatal: yes
become: false
2018-11-05 11:44:31 -05:00
vars:
2019-05-28 10:49:28 +00:00
# Explicit ansible_python_interpreter to allow connecting
# to different OS releases (EL7/8) while using delegate_to.
ansible_python_interpreter: /usr/libexec/platform-python
2019-08-30 23:25:11 +02:00
step: '{{step}}'
2018-10-25 12:15:12 +02:00
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
2018-11-05 11:44:31 -05:00
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 12:15:12 +02:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2018-06-29 16:14:36 +02:00
tasks:
2019-08-30 23:25:11 +02:00
- import_tasks: external_upgrade_steps_tasks.yaml
2018-06-29 16:14:36 +02:00
tags:
2019-08-30 23:25:11 +02:00
- step{{step}}
2018-06-29 16:14:36 +02:00
- external
- external_upgrade_steps
2019-08-30 23:25:11 +02:00
{%- endfor %}
{%- for step in range(1,deploy_steps_max) %}
2018-06-29 16:14:36 +02:00
# putting both upgrade and deploy tasks in the same
# playbook allows influencing the deploy tasks by
# variables "exported" from upgrade tasks
- hosts: DEPLOY_SOURCE_HOST
2019-08-30 23:25:11 +02:00
name: External deploy step {{step}}
2020-03-11 16:52:52 +00:00
gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
2018-06-29 16:14:36 +02:00
any_errors_fatal: yes
become: false
2018-11-05 11:44:31 -05:00
vars:
2019-05-28 10:49:28 +00:00
# Explicit ansible_python_interpreter to allow connecting
# to different OS releases (EL7/8) while using delegate_to.
ansible_python_interpreter: /usr/libexec/platform-python
2019-08-30 23:25:11 +02:00
step: '{{step}}'
2018-10-25 12:15:12 +02:00
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
2018-11-05 11:44:31 -05:00
container_cli: CONTAINER_CLI
2019-02-08 09:55:07 +01:00
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
2019-04-12 12:08:31 -04:00
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
2018-10-25 12:15:12 +02:00
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
2018-06-29 16:14:36 +02:00
tasks:
2019-08-30 23:25:11 +02:00
- import_tasks: external_deploy_steps_tasks.yaml
2018-06-29 16:14:36 +02:00
tags:
2019-08-30 23:25:11 +02:00
- step{{step}}
2018-06-29 16:14:36 +02:00
- external
- external_deploy_steps
2019-08-30 23:25:11 +02:00
{%- endfor %}
2019-04-10 07:49:20 -04:00
scale_steps_tasks: {get_attr: [ScaleTasks, value]}
scale_playbook:
2020-02-24 16:09:02 +00:00
{{ self.deploy_steps_str_replace_params() }}
2019-04-10 07:49:20 -04:00
template: |
# Collect the facts from the overcloud nodes but ignore unreachable
# nodes in the case of a dead node which needs to be part of the
# scale-down operation.
2020-02-24 17:44:24 +00:00
- import_playbook: common_deploy_steps_playbooks.yaml
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
2019-04-10 07:49:20 -04:00
- hosts: DEPLOY_TARGET_HOST
name: Scaling
2019-12-11 10:27:26 -05:00
# NOTE(cloudnull): This is set to true explicitly so that we have up-to-date facts
# on all DEPLOY_TARGET_HOST when performing a scaling operation.
# Without up-to-date facts, we're creating a potential failure
# scenario.
gather_facts: true
2020-04-27 12:58:22 +02:00
ignore_unreachable: true
2019-04-10 07:49:20 -04:00
become: false
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
# Only run the scale tasks on the nodes that are alive.
# We expect the tasks to work on the nodes that are alive.
# If a task is allowed to fail, it needs to be configured at
# the task definition level but not here.
- include_tasks: scale_steps_tasks.yaml
2019-12-11 10:27:26 -05:00
with_sequence: start=1 end={{scale_steps_max}}
2019-04-10 07:49:20 -04:00
loop_control:
loop_var: step
tags: always
2021-02-19 08:29:01 -07:00
# we use ansible_facts['hostname'] to determine if the host is alive
2019-04-10 07:49:20 -04:00
# or not.
2021-02-19 08:29:01 -07:00
when: ansible_facts['hostname'] is defined
2019-04-10 07:49:20 -04:00
# We don't want to run the scale tasks on dead nodes, to allow
# the operator to scale down the cloud no matter the state of
# the servers.
# However, we notify the operator if the node wasn't reachable.
# Using fail and not debug module to make it more visible
# in the logs.
- fail:
msg: "Node is unreachable. No scale tasks will be run."
ignore_errors: True
tags: always
2021-02-19 08:29:01 -07:00
# we use ansible_facts['hostname'] to determine if the host is alive
2019-04-10 07:49:20 -04:00
# or not.
2021-02-19 08:29:01 -07:00
when: ansible_facts['hostname'] is not defined
2019-04-10 07:49:20 -04:00
tags:
- scale
2018-01-23 22:43:49 +05:30
post_update_steps_tasks: |
{%- for role in roles %}
2020-02-21 12:10:02 +00:00
- include_tasks: {{role.name}}/post_update_tasks.yaml
2018-05-14 11:15:09 -07:00
when: tripleo_role_name == '{{role.name}}'
2020-02-21 12:10:02 +00:00
tags:
- always
2018-01-23 22:43:49 +05:30
{%- endfor %}