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-09-11 14:39:06 +01:00
|
|
|
{%- if enabled_roles is not defined -%}
|
|
|
|
# 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 -%}
|
2017-09-26 15:33:13 +03:00
|
|
|
{%- set is_upgrade = false -%}
|
|
|
|
{%- else %}
|
|
|
|
{%- set is_upgrade = true -%}
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- 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 -%}
|
2017-08-04 14:55:48 +03:00
|
|
|
{% set upgrade_steps_max = 6 -%}
|
2017-04-11 11:44:46 +01:00
|
|
|
|
2017-02-17 11:12:36 +01:00
|
|
|
heat_template_version: pike
|
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
|
2017-05-06 02:19:47 +02:00
|
|
|
stack_name:
|
|
|
|
type: string
|
|
|
|
description: Name of the topmost stack
|
2017-03-01 13:57:13 +00:00
|
|
|
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.
|
|
|
|
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
|
2017-06-26 09:53:31 -04:00
|
|
|
DockerPuppetDebug:
|
|
|
|
type: string
|
|
|
|
default: ''
|
|
|
|
description: Set to True to enable debug logging with docker-puppet.py
|
2017-08-25 23:01:24 -04:00
|
|
|
DockerPuppetProcessCount:
|
|
|
|
type: number
|
|
|
|
default: 3
|
|
|
|
description: Number of concurrent processes to use when running docker-puppet to generate config files.
|
2017-05-24 18:45:59 +02:00
|
|
|
ctlplane_service_ips:
|
|
|
|
type: json
|
2017-03-01 13:57:13 +00:00
|
|
|
|
2017-05-06 02:19:47 +02:00
|
|
|
conditions:
|
|
|
|
{% for step in range(1, deploy_steps_max) %}
|
|
|
|
WorkflowTasks_Step{{step}}_Enabled:
|
|
|
|
or:
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for role in enabled_roles %}
|
2017-05-06 02:19:47 +02:00
|
|
|
- not:
|
|
|
|
equals:
|
2017-09-12 22:29:13 +02:00
|
|
|
- get_param: [role_data, {{role.name}}, workflow_tasks, step{{step}}]
|
2017-05-06 02:19:47 +02:00
|
|
|
- ''
|
|
|
|
- False
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
2017-05-06 02:19:47 +02:00
|
|
|
{% endfor %}
|
|
|
|
|
2017-03-01 13:57:13 +00:00
|
|
|
resources:
|
|
|
|
|
2017-05-03 17:12:55 +01:00
|
|
|
RoleConfig:
|
2017-03-01 13:57:13 +00:00
|
|
|
type: OS::Heat::SoftwareConfig
|
|
|
|
properties:
|
2017-05-03 17:12:55 +01:00
|
|
|
group: ansible
|
|
|
|
options:
|
|
|
|
modulepath: /usr/share/ansible-modules
|
2017-03-01 13:57:13 +00:00
|
|
|
inputs:
|
2017-05-03 17:12:55 +01:00
|
|
|
- name: step
|
|
|
|
- name: role_name
|
|
|
|
- name: update_identifier
|
|
|
|
- name: bootstrap_server_id
|
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
|
|
|
- name: enable_debug
|
2017-06-26 09:53:31 -04:00
|
|
|
- name: docker_puppet_debug
|
2017-08-25 23:01:24 -04:00
|
|
|
- name: docker_puppet_process_count
|
2017-07-20 15:04:10 +01:00
|
|
|
config:
|
|
|
|
str_replace:
|
|
|
|
template: |
|
|
|
|
- hosts: localhost
|
|
|
|
connection: local
|
|
|
|
tasks:
|
|
|
|
_TASKS
|
|
|
|
params:
|
|
|
|
_TASKS: {get_file: deploy-steps-tasks.yaml}
|
2017-03-01 13:57:13 +00:00
|
|
|
|
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-05-06 02:19:47 +02:00
|
|
|
{%- for step in range(1, deploy_steps_max) %}
|
2017-09-12 22:29:13 +02:00
|
|
|
# BEGIN workflow_tasks handling
|
2017-05-06 02:19:47 +02:00
|
|
|
WorkflowTasks_Step{{step}}:
|
|
|
|
type: OS::Mistral::Workflow
|
|
|
|
condition: WorkflowTasks_Step{{step}}_Enabled
|
|
|
|
depends_on:
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- if step == 1 %}
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for dep in enabled_roles %}
|
2017-05-06 02:19:47 +02:00
|
|
|
- {{dep.name}}PreConfig
|
|
|
|
- {{dep.name}}ArtifactsDeploy
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{%- else %}
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for dep in enabled_roles %}
|
2017-05-06 02:19:47 +02:00
|
|
|
- {{dep.name}}Deployment_Step{{step -1}}
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
2017-05-06 02:19:47 +02:00
|
|
|
properties:
|
2017-09-12 22:29:13 +02:00
|
|
|
name: {list_join: [".", ["tripleo", {get_param: stack_name}, "workflow_tasks", "step{{step}}"]]}
|
2017-05-06 02:19:47 +02:00
|
|
|
type: direct
|
|
|
|
tasks:
|
|
|
|
yaql:
|
|
|
|
expression: $.data.where($ != '').select($.get('step{{step}}')).where($ != null).flatten()
|
|
|
|
data:
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for role in enabled_roles %}
|
2017-09-12 22:29:13 +02:00
|
|
|
- get_param: [role_data, {{role.name}}, workflow_tasks]
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
2017-05-06 02:19:47 +02:00
|
|
|
|
|
|
|
WorkflowTasks_Step{{step}}_Execution:
|
|
|
|
type: OS::Mistral::ExternalResource
|
|
|
|
condition: WorkflowTasks_Step{{step}}_Enabled
|
|
|
|
depends_on: WorkflowTasks_Step{{step}}
|
|
|
|
properties:
|
|
|
|
actions:
|
|
|
|
CREATE:
|
|
|
|
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
2017-05-24 18:45:59 +02:00
|
|
|
params:
|
|
|
|
env:
|
|
|
|
service_ips: { get_param: ctlplane_service_ips }
|
2017-07-14 13:38:47 +02:00
|
|
|
role_merged_configs:
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- for r in roles %}
|
2017-07-14 13:38:47 +02:00
|
|
|
{{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
2017-07-20 13:44:57 +02:00
|
|
|
evaluate_env: false
|
2017-05-06 02:19:47 +02:00
|
|
|
UPDATE:
|
|
|
|
workflow: { get_resource: WorkflowTasks_Step{{step}} }
|
2017-05-24 18:45:59 +02:00
|
|
|
params:
|
|
|
|
env:
|
|
|
|
service_ips: { get_param: ctlplane_service_ips }
|
2017-07-14 13:38:47 +02:00
|
|
|
role_merged_configs:
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- for r in roles %}
|
2017-07-14 13:38:47 +02:00
|
|
|
{{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
2017-07-20 13:44:57 +02:00
|
|
|
evaluate_env: false
|
2017-05-06 02:19:47 +02:00
|
|
|
always_update: true
|
2017-09-12 22:29:13 +02:00
|
|
|
# END workflow_tasks handling
|
2017-05-06 02:19:47 +02:00
|
|
|
{% endfor %}
|
|
|
|
|
2017-09-11 14:39:06 +01:00
|
|
|
# Artifacts config and HostPrepConfig is done on all roles, not only
|
|
|
|
# enabled_roles, because on upgrade we need to write the json files
|
|
|
|
# for the operator driven upgrade scripts (the ansible steps consume them)
|
2017-03-01 13:57:13 +00:00
|
|
|
{% for role in roles %}
|
2017-09-11 14:39:06 +01:00
|
|
|
# Prepare host tasks for {{role.name}}
|
2017-03-01 13:57:13 +00:00
|
|
|
{{role.name}}ArtifactsConfig:
|
|
|
|
type: ../puppet/deploy-artifacts.yaml
|
|
|
|
|
|
|
|
{{role.name}}ArtifactsDeploy:
|
|
|
|
type: OS::Heat::StructuredDeploymentGroup
|
|
|
|
properties:
|
2017-09-20 12:48:19 -04:00
|
|
|
name: {{role.name}}ArtifactsDeploy
|
2017-03-01 13:57:13 +00:00
|
|
|
servers: {get_param: [servers, {{role.name}}]}
|
|
|
|
config: {get_resource: {{role.name}}ArtifactsConfig}
|
|
|
|
|
2017-03-09 14:47:12 +01:00
|
|
|
{{role.name}}HostPrepConfig:
|
|
|
|
type: OS::Heat::SoftwareConfig
|
|
|
|
properties:
|
|
|
|
group: ansible
|
|
|
|
options:
|
|
|
|
modulepath: /usr/share/ansible-modules
|
2017-04-10 16:16:29 +01:00
|
|
|
config:
|
|
|
|
str_replace:
|
|
|
|
template: _PLAYBOOK
|
|
|
|
params:
|
|
|
|
_PLAYBOOK:
|
|
|
|
- hosts: localhost
|
|
|
|
connection: local
|
|
|
|
vars:
|
|
|
|
puppet_config: {get_param: [role_data, {{role.name}}, puppet_config]}
|
2017-07-13 13:40:48 +01:00
|
|
|
docker_puppet_script: {get_file: ../docker/docker-puppet.py}
|
2017-07-19 20:36:11 +01:00
|
|
|
docker_puppet_tasks: {get_param: [role_data, {{role.name}}, docker_puppet_tasks]}
|
2017-07-19 11:44:56 +01:00
|
|
|
docker_startup_configs: {get_param: [role_data, {{role.name}}, docker_config]}
|
2017-04-10 16:16:29 +01:00
|
|
|
kolla_config: {get_param: [role_data, {{role.name}}, kolla_config]}
|
|
|
|
bootstrap_server_id: {get_param: [servers, {{primary_role_name}}, '0']}
|
2017-07-19 11:44:56 +01:00
|
|
|
puppet_step_config: {get_param: [role_data, {{role.name}}, step_config]}
|
2017-04-10 16:16:29 +01:00
|
|
|
tasks:
|
|
|
|
# Join host_prep_tasks with the other per-host configuration
|
2017-08-30 15:43:16 +02:00
|
|
|
list_concat:
|
2017-09-26 15:33:13 +03:00
|
|
|
{%- if is_upgrade|default(false) and role.disable_upgrade_deployment|default(false) %}
|
|
|
|
- []
|
|
|
|
{%- else %}
|
2017-08-30 15:43:16 +02:00
|
|
|
- {get_param: [role_data, {{role.name}}, host_prep_tasks]}
|
2017-09-26 15:33:13 +03:00
|
|
|
{%- endif %}
|
2017-08-30 15:43:16 +02:00
|
|
|
-
|
|
|
|
# Write the manifest for baremetal puppet configuration
|
|
|
|
- name: Create /var/lib/tripleo-config directory
|
|
|
|
file: path=/var/lib/tripleo-config state=directory
|
|
|
|
- name: Write the puppet step_config manifest
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}puppet_step_config{{ '}}' }}" dest=/var/lib/tripleo-config/puppet_step_config.pp force=yes mode=0600
|
2017-08-30 15:43:16 +02:00
|
|
|
# this creates a JSON config file for our docker-puppet.py script
|
|
|
|
- name: Create /var/lib/docker-puppet
|
|
|
|
file: path=/var/lib/docker-puppet state=directory
|
|
|
|
- name: Write docker-puppet-tasks json files
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}puppet_config | to_json{{ '}}' }}" dest=/var/lib/docker-puppet/docker-puppet.json force=yes mode=0600
|
2017-08-30 15:43:16 +02:00
|
|
|
# FIXME: can we move docker-puppet somewhere so it's installed via a package?
|
|
|
|
- name: Write docker-puppet.py
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}docker_puppet_script{{ '}}' }}" dest=/var/lib/docker-puppet/docker-puppet.py force=yes mode=0600
|
2017-08-30 15:43:16 +02:00
|
|
|
# Here we are dumping all the docker container startup configuration data
|
|
|
|
# so that we can have access to how they are started outside of heat
|
|
|
|
# and docker-cmd. This lets us create command line tools to test containers.
|
|
|
|
# FIXME do we need the docker-container-startup-configs.json or is the new per-step
|
|
|
|
# data consumed by paunch enough?
|
|
|
|
- name: Write docker-container-startup-configs
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}docker_startup_configs | to_json{{ '}}' }}" dest=/var/lib/docker-container-startup-configs.json force=yes mode=0600
|
2017-08-30 15:43:16 +02:00
|
|
|
- name: Write per-step docker-container-startup-configs
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}item.value|to_json{{ '}}' }}" dest="/var/lib/tripleo-config/docker-container-startup-config-{{ '{{' }}item.key{{ '}}' }}.json" force=yes mode=0600
|
|
|
|
with_dict: "{{ '{{' }}docker_startup_configs{{ '}}' }}"
|
2017-08-30 15:43:16 +02:00
|
|
|
- name: Create /var/lib/kolla/config_files directory
|
|
|
|
file: path=/var/lib/kolla/config_files state=directory
|
|
|
|
- name: Write kolla config json files
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}item.value|to_json{{ '}}' }}" dest="{{ '{{' }}item.key{{ '}}' }}" force=yes mode=0600
|
|
|
|
with_dict: "{{ '{{' }}kolla_config{{ '}}' }}"
|
2017-08-30 15:43:16 +02:00
|
|
|
########################################################
|
|
|
|
# Bootstrap tasks, only performed on bootstrap_server_id
|
|
|
|
########################################################
|
|
|
|
- name: Clean /var/lib/docker-puppet/docker-puppet-tasks*.json files
|
|
|
|
file:
|
2017-09-20 12:48:19 -04:00
|
|
|
path: "{{ '{{' }}item{{ '}}' }}"
|
2017-08-30 15:43:16 +02:00
|
|
|
state: absent
|
|
|
|
with_fileglob:
|
|
|
|
- /var/lib/docker-puppet/docker-puppet-tasks*.json
|
|
|
|
when: deploy_server_id == bootstrap_server_id
|
|
|
|
- name: Write docker-puppet-tasks json files
|
2017-09-20 12:48:19 -04:00
|
|
|
copy: content="{{ '{{' }}item.value|to_json{{ '}}' }}" dest=/var/lib/docker-puppet/docker-puppet-tasks{{ '{{' }}item.key.replace("step_", ""){{ '}}' }}.json force=yes mode=0600
|
|
|
|
with_dict: "{{ '{{' }}docker_puppet_tasks{{ '}}' }}"
|
2017-08-30 15:43:16 +02:00
|
|
|
when: deploy_server_id == bootstrap_server_id
|
2017-03-09 14:47:12 +01:00
|
|
|
|
|
|
|
{{role.name}}HostPrepDeployment:
|
|
|
|
type: OS::Heat::SoftwareDeploymentGroup
|
|
|
|
properties:
|
2017-09-20 12:48:19 -04:00
|
|
|
name: {{role.name}}HostPrepDeployment
|
2017-03-09 14:47:12 +01:00
|
|
|
servers: {get_param: [servers, {{role.name}}]}
|
|
|
|
config: {get_resource: {{role.name}}HostPrepConfig}
|
2017-09-11 14:39:06 +01:00
|
|
|
{% endfor %}
|
2017-03-09 14:47:12 +01:00
|
|
|
|
2017-09-11 14:39:06 +01:00
|
|
|
# BEGIN CONFIG STEPS, only on enabled_roles
|
|
|
|
{%- for role in enabled_roles %}
|
2017-04-25 15:13:38 +00:00
|
|
|
{{role.name}}PreConfig:
|
|
|
|
type: OS::TripleO::Tasks::{{role.name}}PreConfig
|
2017-05-03 17:12:55 +01:00
|
|
|
depends_on: {{role.name}}HostPrepDeployment
|
2017-03-01 13:57:13 +00:00
|
|
|
properties:
|
2017-04-25 15:13:38 +00:00
|
|
|
servers: {get_param: [servers, {{role.name}}]}
|
2017-03-01 13:57:13 +00:00
|
|
|
input_values:
|
|
|
|
update_identifier: {get_param: DeployIdentifier}
|
|
|
|
|
2017-09-11 14:39:06 +01:00
|
|
|
# Deployment steps for {{role.name}}
|
|
|
|
# A single config is re-applied with an incrementing step number
|
2017-04-11 11:44:46 +01:00
|
|
|
{% for step in range(1, deploy_steps_max) %}
|
2017-03-01 13:57:13 +00:00
|
|
|
{{role.name}}Deployment_Step{{step}}:
|
2017-07-21 17:45:09 +01:00
|
|
|
type: OS::TripleO::DeploymentSteps
|
2017-03-01 13:57:13 +00:00
|
|
|
depends_on:
|
2017-05-06 02:19:47 +02:00
|
|
|
- WorkflowTasks_Step{{step}}_Execution
|
|
|
|
# TODO(gfidente): the following if/else condition
|
|
|
|
# replicates what is already defined for the
|
|
|
|
# WorkflowTasks_StepX resource and can be remove
|
|
|
|
# if https://bugs.launchpad.net/heat/+bug/1700569
|
|
|
|
# is fixed.
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- if step == 1 %}
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for dep in enabled_roles %}
|
2017-05-06 02:19:47 +02:00
|
|
|
- {{dep.name}}PreConfig
|
|
|
|
- {{dep.name}}ArtifactsDeploy
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{%- else %}
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for dep in enabled_roles %}
|
2017-03-01 13:57:13 +00:00
|
|
|
- {{dep.name}}Deployment_Step{{step -1}}
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
2017-03-01 13:57:13 +00:00
|
|
|
properties:
|
|
|
|
name: {{role.name}}Deployment_Step{{step}}
|
|
|
|
servers: {get_param: [servers, {{role.name}}]}
|
2017-05-03 17:12:55 +01:00
|
|
|
config: {get_resource: RoleConfig}
|
2017-03-01 13:57:13 +00:00
|
|
|
input_values:
|
|
|
|
step: {{step}}
|
2017-05-03 17:12:55 +01:00
|
|
|
role_name: {{role.name}}
|
2017-03-01 13:57:13 +00:00
|
|
|
update_identifier: {get_param: DeployIdentifier}
|
2017-05-03 17:12:55 +01:00
|
|
|
bootstrap_server_id: {get_param: [servers, {{primary_role_name}}, '0']}
|
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
|
|
|
enable_debug: {get_param: ConfigDebug}
|
2017-06-26 09:53:31 -04:00
|
|
|
docker_puppet_debug: {get_param: DockerPuppetDebug}
|
2017-08-25 23:01:24 -04:00
|
|
|
docker_puppet_process_count: {get_param: DockerPuppetProcessCount}
|
2017-03-01 13:57:13 +00:00
|
|
|
{% endfor %}
|
2017-05-03 17:12:55 +01:00
|
|
|
# END CONFIG STEPS
|
2017-03-01 13:57:13 +00:00
|
|
|
|
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:
|
2017-03-01 13:57:13 +00:00
|
|
|
depends_on:
|
2017-09-11 14:39:06 +01:00
|
|
|
{%- for dep in enabled_roles %}
|
2017-03-01 13:57:13 +00:00
|
|
|
- {{dep.name}}Deployment_Step5
|
2017-07-17 10:15:13 +02:00
|
|
|
{%- endfor %}
|
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}}]}
|
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:
|
|
|
|
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:
|
|
|
|
update_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:
|
|
|
|
deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
|
2017-09-20 12:48:19 -04:00
|
|
|
deploy_steps_playbook:
|
|
|
|
str_replace:
|
|
|
|
params:
|
|
|
|
BOOTSTRAP_SERVER_ID: {get_param: [servers, {{primary_role_name}}, '0']}
|
|
|
|
template: |
|
2017-10-20 13:43:38 +02:00
|
|
|
- hosts: undercloud:overcloud
|
|
|
|
name: Gather facts
|
|
|
|
gather_facts: yes
|
2017-09-20 12:48:19 -04:00
|
|
|
- hosts: overcloud
|
|
|
|
name: Server deployments
|
2017-10-20 13:43:38 +02:00
|
|
|
gather_facts: no
|
|
|
|
any_errors_fatal: yes
|
2017-09-20 12:48:19 -04:00
|
|
|
tasks:
|
|
|
|
{%- for role in roles %}
|
|
|
|
- include: {{role.name}}/deployments.yaml
|
|
|
|
vars:
|
|
|
|
force: false
|
|
|
|
when: role_name == '{{role.name}}'
|
2017-10-17 17:33:14 +01:00
|
|
|
with_items: "{{ '{{' }} {{role.name}}_pre_deployments|default([]) {{ '}}' }}"
|
2017-09-20 12:48:19 -04:00
|
|
|
{%- endfor %}
|
|
|
|
- hosts: overcloud
|
|
|
|
name: Deployment steps
|
2017-10-20 13:43:38 +02:00
|
|
|
gather_facts: no
|
|
|
|
any_errors_fatal: yes
|
2017-09-20 12:48:19 -04:00
|
|
|
vars:
|
|
|
|
bootstrap_server_id: BOOTSTRAP_SERVER_ID
|
|
|
|
tasks:
|
|
|
|
{%- for role in roles %}
|
|
|
|
- include: {{role.name}}/host_prep_tasks.yaml
|
|
|
|
when: role_name == '{{role.name}}'
|
|
|
|
{%- endfor %}
|
2017-10-06 11:41:59 +02:00
|
|
|
{%- for step in range(1,deploy_steps_max) %}
|
|
|
|
- hosts: undercloud
|
|
|
|
name: Undercloud deployment step {{step}}
|
2017-10-20 13:43:38 +02:00
|
|
|
gather_facts: no
|
|
|
|
any_errors_fatal: yes
|
2017-10-06 11:41:59 +02:00
|
|
|
vars:
|
|
|
|
step: '{{step}}'
|
|
|
|
tasks:
|
|
|
|
- include: external_deploy_steps_tasks.yaml
|
|
|
|
- hosts: overcloud
|
|
|
|
name: Overcloud deployment step {{step}}
|
2017-10-20 13:43:38 +02:00
|
|
|
gather_facts: no
|
|
|
|
any_errors_fatal: yes
|
2017-10-06 11:41:59 +02:00
|
|
|
vars:
|
|
|
|
bootstrap_server_id: BOOTSTRAP_SERVER_ID
|
|
|
|
step: '{{step}}'
|
|
|
|
tasks:
|
2017-09-20 12:48:19 -04:00
|
|
|
- include: deploy_steps_tasks.yaml
|
2017-10-06 11:41:59 +02:00
|
|
|
{%- endfor %}
|
2017-09-20 12:48:19 -04:00
|
|
|
- hosts: overcloud
|
|
|
|
name: Server Post Deployments
|
2017-10-20 13:43:38 +02:00
|
|
|
gather_facts: no
|
|
|
|
any_errors_fatal: yes
|
2017-09-20 12:48:19 -04:00
|
|
|
tasks:
|
2017-07-20 17:11:44 +01:00
|
|
|
{%- for role in roles %}
|
2017-09-20 12:48:19 -04:00
|
|
|
- include: {{role.name}}/deployments.yaml
|
|
|
|
vars:
|
|
|
|
force: false
|
|
|
|
when: role_name == '{{role.name}}'
|
2017-10-17 17:33:14 +01:00
|
|
|
with_items: "{{ '{{' }} {{role.name}}_post_deployments|default([]) {{ '}}' }}"
|
2017-07-20 17:11:44 +01:00
|
|
|
{%- endfor %}
|
2017-10-06 11:41:59 +02:00
|
|
|
external_deploy_steps_tasks: {get_attr: [ExternalDeployTasks, value]}
|
2017-07-21 11:43:25 +01:00
|
|
|
update_steps_tasks: |
|
|
|
|
{%- for role in roles %}
|
|
|
|
- include: {{role.name}}/update_tasks.yaml
|
|
|
|
when: role_name == '{{role.name}}'
|
|
|
|
{%- endfor %}
|
|
|
|
update_steps_playbook: |
|
|
|
|
- hosts: overcloud
|
|
|
|
serial: 1
|
|
|
|
tasks:
|
|
|
|
- include: update_steps_tasks.yaml
|
2017-09-14 09:31:58 -06:00
|
|
|
with_sequence: start=1 end={{update_steps_max-1}}
|
2017-07-21 11:43:25 +01:00
|
|
|
loop_control:
|
|
|
|
loop_var: step
|
|
|
|
- include: deploy_steps_tasks.yaml
|
2017-09-14 09:31:58 -06:00
|
|
|
with_sequence: start=1 end={{deploy_steps_max-1}}
|
2017-07-21 11:43:25 +01:00
|
|
|
loop_control:
|
|
|
|
loop_var: step
|
2017-08-04 14:55:48 +03:00
|
|
|
upgrade_steps_tasks: |
|
|
|
|
{%- for role in roles %}
|
|
|
|
- include: {{role.name}}/upgrade_tasks.yaml
|
|
|
|
when: role_name == '{{role.name}}'
|
|
|
|
{%- endfor %}
|
|
|
|
upgrade_steps_playbook: |
|
|
|
|
- hosts: overcloud
|
|
|
|
tasks:
|
|
|
|
- include: upgrade_steps_tasks.yaml
|
2017-09-14 09:31:58 -06:00
|
|
|
with_sequence: start=1 end={{upgrade_steps_max-1}}
|
2017-08-04 14:55:48 +03:00
|
|
|
loop_control:
|
|
|
|
loop_var: step
|