Use Ansible for all_nodes hieradata
Migrate the generation of the all_nodes hieradata from Heat to using the tripleo-hieradata role instead. Change-Id: I9a37d1faec73a81a28d8f89d86375fb15ee765c7 Depends-On: I6e1e1c28dc09c9e04119db910068d62409a5afc8
This commit is contained in:
parent
f44f339399
commit
4c34147cc1
|
@ -530,7 +530,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
host_container_puppet_tasks: "{{host_container_puppet_tasks|default([]) + [item]}}"
|
host_container_puppet_tasks: "{{host_container_puppet_tasks|default([]) + [item]}}"
|
||||||
loop: "{{container_puppet_tasks.get('step_' + step, [])}}"
|
loop: "{{container_puppet_tasks.get('step_' + step, [])}}"
|
||||||
when: vars[item.service_name + '_short_bootstrap_node_name'] == ansible_hostname
|
when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | first) == ansible_hostname
|
||||||
vars:
|
vars:
|
||||||
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -171,6 +171,23 @@ parameters:
|
||||||
AnsibleHostVarsMap:
|
AnsibleHostVarsMap:
|
||||||
type: json
|
type: json
|
||||||
default: {}
|
default: {}
|
||||||
|
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:
|
||||||
|
- allowed_values: ['', 'UPGRADE', 'FASTFORWARDUPGRADE']
|
||||||
|
default: ''
|
||||||
|
ContainerCli:
|
||||||
|
type: string
|
||||||
|
default: 'podman'
|
||||||
|
description: CLI tool used to manage containers.
|
||||||
|
constraints:
|
||||||
|
- allowed_values: ['docker', 'podman']
|
||||||
|
EnabledServices:
|
||||||
|
default: []
|
||||||
|
type: comma_delimited_list
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
{% for role in enabled_roles %}
|
{% for role in enabled_roles %}
|
||||||
|
@ -304,6 +321,11 @@ outputs:
|
||||||
stack_action: {get_param: StackAction}
|
stack_action: {get_param: StackAction}
|
||||||
deploy_artifact_urls: {list_join: [' ', {get_param: DeployArtifactURLs}]}
|
deploy_artifact_urls: {list_join: [' ', {get_param: DeployArtifactURLs}]}
|
||||||
hosts_entry: {get_param: HostsEntry}
|
hosts_entry: {get_param: HostsEntry}
|
||||||
|
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}
|
||||||
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
|
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
|
||||||
docker_puppet_script: {get_file: ./container-puppet.py}
|
docker_puppet_script: {get_file: ./container-puppet.py}
|
||||||
all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh}
|
all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh}
|
||||||
|
@ -347,6 +369,36 @@ outputs:
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
name: Manage SELinux
|
name: Manage SELinux
|
||||||
|
@ -413,6 +465,7 @@ outputs:
|
||||||
hieradata_variable_end_string: $$
|
hieradata_variable_end_string: $$
|
||||||
hieradata_files: "{{ '{{' }} lookup('file', '{{role.name}}/deployment-hierarchy.yaml') {{ '}}' }}"
|
hieradata_files: "{{ '{{' }} lookup('file', '{{role.name}}/deployment-hierarchy.yaml') {{ '}}' }}"
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
when: tripleo_role_name == '{{role.name}}'
|
||||||
|
|
||||||
- name: Deployment hieradata
|
- name: Deployment hieradata
|
||||||
include_role:
|
include_role:
|
||||||
name: tripleo-hieradata
|
name: tripleo-hieradata
|
||||||
|
@ -451,6 +504,7 @@ outputs:
|
||||||
vars:
|
vars:
|
||||||
hieradata_templates_list:
|
hieradata_templates_list:
|
||||||
- bootstrap_node
|
- bootstrap_node
|
||||||
|
- all_nodes
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
when: tripleo_role_name == '{{role.name}}'
|
||||||
tags:
|
tags:
|
||||||
- overcloud
|
- overcloud
|
||||||
|
@ -745,6 +799,34 @@ outputs:
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
tasks:
|
tasks:
|
||||||
- include_vars: global_vars.yaml
|
- include_vars: global_vars.yaml
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
{%- for role in roles %}
|
{%- for role in roles %}
|
||||||
- hosts: {{role.name}}
|
- hosts: {{role.name}}
|
||||||
name: Run update
|
name: Run update
|
||||||
|
@ -807,6 +889,34 @@ outputs:
|
||||||
- include_vars: global_vars.yaml
|
- include_vars: global_vars.yaml
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
- hosts: DEPLOY_SOURCE_HOST
|
- hosts: DEPLOY_SOURCE_HOST
|
||||||
name: External update steps
|
name: External update steps
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
@ -860,6 +970,34 @@ outputs:
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
tasks:
|
tasks:
|
||||||
- include_vars: global_vars.yaml
|
- include_vars: global_vars.yaml
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
- hosts: {{role.name}}
|
- hosts: {{role.name}}
|
||||||
name: Run pre-upgrade rolling tasks
|
name: Run pre-upgrade rolling tasks
|
||||||
serial: {{ role.deploy_serial | default(1) }}
|
serial: {{ role.deploy_serial | default(1) }}
|
||||||
|
@ -907,9 +1045,35 @@ outputs:
|
||||||
warn: no
|
warn: no
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
{%- for step in range(0,upgrade_steps_max) %}
|
{%- for step in range(0,upgrade_steps_max) %}
|
||||||
|
|
||||||
- hosts: DEPLOY_TARGET_HOST
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
name: Upgrade tasks for step {{step}}
|
name: Upgrade tasks for step {{step}}
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
@ -1009,6 +1173,34 @@ outputs:
|
||||||
- include_vars: global_vars.yaml
|
- include_vars: global_vars.yaml
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
- hosts: DEPLOY_SOURCE_HOST
|
- hosts: DEPLOY_SOURCE_HOST
|
||||||
name: External upgrade
|
name: External upgrade
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
@ -1108,6 +1300,34 @@ outputs:
|
||||||
- include_vars: global_vars.yaml
|
- include_vars: global_vars.yaml
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Render all_nodes data as group_vars for overcloud
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
run_once: true
|
||||||
|
block:
|
||||||
|
- name: Get current user
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
- name: render all_nodes data as group_vars for overcloud
|
||||||
|
template:
|
||||||
|
src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
|
||||||
|
dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
|
||||||
|
owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
|
name: Set all_nodes data as group_vars for overcloud
|
||||||
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
tasks:
|
||||||
|
- name: Set all_nodes data as group_vars for overcloud
|
||||||
|
include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
|
||||||
|
tags:
|
||||||
|
- facts
|
||||||
- hosts: DEPLOY_TARGET_HOST
|
- hosts: DEPLOY_TARGET_HOST
|
||||||
name: Scaling
|
name: Scaling
|
||||||
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
|
||||||
|
|
|
@ -48,11 +48,6 @@ parameter_defaults:
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
SshFirewallAllowAll: True
|
SshFirewallAllowAll: True
|
||||||
|
|
||||||
# Heat action on performed top-level stack. Note StackUpdateType is set to UPGRADE when a major-version upgrade is in progress.
|
|
||||||
# Mandatory. This parameter must be set by the user.
|
|
||||||
# Type: string
|
|
||||||
StackAction: CREATE
|
|
||||||
|
|
||||||
# How many replicas to use in the swift rings.
|
# How many replicas to use in the swift rings.
|
||||||
# Type: number
|
# Type: number
|
||||||
SwiftReplicas: 1
|
SwiftReplicas: 1
|
||||||
|
|
|
@ -28,11 +28,6 @@ parameter_defaults:
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
SshFirewallAllowAll: True
|
SshFirewallAllowAll: True
|
||||||
|
|
||||||
# Heat action on performed top-level stack. Note StackUpdateType is set to UPGRADE when a major-version upgrade is in progress.
|
|
||||||
# Mandatory. This parameter must be set by the user.
|
|
||||||
# Type: string
|
|
||||||
StackAction: CREATE
|
|
||||||
|
|
||||||
resource_registry:
|
resource_registry:
|
||||||
OS::TripleO::Network::Ports::ControlPlaneVipPort: OS::Heat::None
|
OS::TripleO::Network::Ports::ControlPlaneVipPort: OS::Heat::None
|
||||||
OS::TripleO::Services::AodhApi: OS::Heat::None
|
OS::TripleO::Services::AodhApi: OS::Heat::None
|
||||||
|
|
|
@ -72,39 +72,12 @@ resources:
|
||||||
{{network.name_lower}}: {get_param: {{network.name}}NetName}
|
{{network.name_lower}}: {get_param: {{network.name}}NetName}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
ServicesIpData:
|
|
||||||
type: OS::Heat::Value
|
|
||||||
depends_on: EnabledServicesValue
|
|
||||||
properties:
|
|
||||||
value:
|
|
||||||
map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
# $$ is used here to indicate the start/end of an ansible jinja
|
|
||||||
# expression. we could use {{ and }} but the escaping would make it
|
|
||||||
# difficult to read, and it would still come out surrounded by
|
|
||||||
# quotes. On the ansible side,
|
|
||||||
# we then set variable_start_string/variable_end_string to $$ for
|
|
||||||
# use with the template module
|
|
||||||
SERVICE_node_ips: $$ groups['SERVICE'] | default ([]) | map('extract', hostvars, service_net_map['SERVICE_network'] | default('ctlplane') ~ '_ip') | list | to_json $$
|
|
||||||
for_each:
|
|
||||||
SERVICE:
|
|
||||||
yaql:
|
|
||||||
expression: let(root => $) -> coalesce($root.data.enabled_services, []).where($root.data.service_net_map.keys().contains($ + "_network"))
|
|
||||||
data:
|
|
||||||
service_net_map: {get_param: ServiceNetMap}
|
|
||||||
enabled_services: {get_attr: [EnabledServicesValue, value]}
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
net_ip_map:
|
net_ip_map:
|
||||||
description: >
|
description: >
|
||||||
A Hash containing a mapping of network names to assigned lists
|
A Hash containing a mapping of network names to assigned lists
|
||||||
of IP addresses.
|
of IP addresses.
|
||||||
value: {get_attr: [NetIpMapValue, value]}
|
value: {get_attr: [NetIpMapValue, value]}
|
||||||
service_ips:
|
|
||||||
description: >
|
|
||||||
Map of enabled services to a list of their IP addresses
|
|
||||||
value: {get_attr: [ServicesIpData, value]}
|
|
||||||
ctlplane_service_ips:
|
ctlplane_service_ips:
|
||||||
description: >
|
description: >
|
||||||
Map of enabled services to a list of their ctlplane IP addresses
|
Map of enabled services to a list of their ctlplane IP addresses
|
||||||
|
@ -115,90 +88,3 @@ outputs:
|
||||||
SERVICE_ctlplane_node_ips: $$ groups['SERVICE'] | default ([]) | map('extract', hostvars, 'ctlplane_ip') | list | to_json $$
|
SERVICE_ctlplane_node_ips: $$ groups['SERVICE'] | default ([]) | map('extract', hostvars, 'ctlplane_ip') | list | to_json $$
|
||||||
for_each:
|
for_each:
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
||||||
service_hostnames:
|
|
||||||
description: >
|
|
||||||
Map of enabled services to a list of hostnames where they're running
|
|
||||||
value:
|
|
||||||
map_replace:
|
|
||||||
- yaql:
|
|
||||||
# This filters any entries where the value hasn't been substituted for
|
|
||||||
# a list, e.g it's still $service_network. This happens when there is
|
|
||||||
# no network defined for the service in the ServiceNetMap, which is OK
|
|
||||||
# as not all services have to be bound to a network, so we filter them
|
|
||||||
expression: dict($.data.map.items().where(not $[1].endsWith("_network")))
|
|
||||||
data:
|
|
||||||
map:
|
|
||||||
map_replace:
|
|
||||||
- map_merge:
|
|
||||||
if:
|
|
||||||
- is_cell
|
|
||||||
-
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_cell_node_names: SERVICE_network
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
|
||||||
-
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_node_names: SERVICE_network
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
|
||||||
- values: {get_param: ServiceNetMap}
|
|
||||||
- values: {get_param: NetworkHostnameMap}
|
|
||||||
short_service_hostnames:
|
|
||||||
description: >
|
|
||||||
Map of enabled services to a list of hostnames where they're running regardless of the network
|
|
||||||
value:
|
|
||||||
yaql:
|
|
||||||
# If ServiceHostnameList is empty the role is deployed with zero nodes
|
|
||||||
# therefore we don't want to add any *_node_names to the map
|
|
||||||
expression: dict($.data.map.items().where(len($[1]) > 0))
|
|
||||||
data:
|
|
||||||
map:
|
|
||||||
map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_short_node_names: {get_param: ServiceHostnameList}
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
|
||||||
short_service_bootstrap_hostnames:
|
|
||||||
description: >
|
|
||||||
Map of enabled services to a list of hostnames where they're running regardless of the network
|
|
||||||
Used for bootstrap purposes
|
|
||||||
value:
|
|
||||||
yaql:
|
|
||||||
# If ServiceHostnameList is empty the role is deployed with zero nodes
|
|
||||||
# therefore we don't want to add any *_node_names to the map
|
|
||||||
expression: dict($.data.map.items().where(len($[1]) > 0))
|
|
||||||
data:
|
|
||||||
map:
|
|
||||||
map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_short_bootstrap_node_name: {get_param: ServiceHostnameList}
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
|
||||||
service_bootstrap_ips:
|
|
||||||
description: >
|
|
||||||
Map of enabled services to a list of their IP addresses
|
|
||||||
Used for bootstrap purposes
|
|
||||||
value:
|
|
||||||
yaql:
|
|
||||||
# This filters any entries where the value hasn't been substituted for
|
|
||||||
# a list, e.g it's still $service_network. This happens when there is
|
|
||||||
# no network defined for the service in the ServiceNetMap, which is OK
|
|
||||||
# as not all services have to be bound to a network, so we filter them
|
|
||||||
expression: dict($.data.map.items().where(not isString($[1])))
|
|
||||||
data:
|
|
||||||
map:
|
|
||||||
map_replace:
|
|
||||||
- map_replace:
|
|
||||||
- map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_bootstrap_node_ip: SERVICE_network
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_attr: [EnabledServicesValue, value]}
|
|
||||||
- values: {get_param: ServiceNetMap}
|
|
||||||
- values: {get_attr: [NetIpMapValue, value]}
|
|
||||||
|
|
|
@ -786,51 +786,10 @@ resources:
|
||||||
- ','
|
- ','
|
||||||
{%- for role in roles %}
|
{%- for role in roles %}
|
||||||
- {get_attr: [{{role.name}}ServiceNames, value]}
|
- {get_attr: [{{role.name}}ServiceNames, value]}
|
||||||
{%- endfor %}
|
|
||||||
controller_ips: {get_attr: [{{primary_role_name}}, ip_address]}
|
|
||||||
controller_names: {get_attr: [{{primary_role_name}}, hostname]}
|
|
||||||
service_ips:
|
|
||||||
map_merge:
|
|
||||||
{%- for role in roles %}
|
|
||||||
- {get_attr: [{{role.name}}IpListMap, service_ips]}
|
|
||||||
{%- endfor %}
|
|
||||||
service_node_names:
|
|
||||||
yaql:
|
|
||||||
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1]).select([$[0], $[1].flatten()]))
|
|
||||||
data:
|
|
||||||
l:
|
|
||||||
{%- for role in roles %}
|
|
||||||
- {get_attr: [{{role.name}}IpListMap, service_hostnames]}
|
|
||||||
{%- endfor %}
|
|
||||||
short_service_node_names:
|
|
||||||
yaql:
|
|
||||||
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1]).select([$[0], $[1].flatten()]))
|
|
||||||
data:
|
|
||||||
l:
|
|
||||||
{%- for role in roles %}
|
|
||||||
- {get_attr: [{{role.name}}IpListMap, short_service_hostnames]}
|
|
||||||
{%- endfor %}
|
|
||||||
short_service_bootstrap_node:
|
|
||||||
yaql:
|
|
||||||
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1]).select([$[0], $[1].flatten().first()]))
|
|
||||||
data:
|
|
||||||
l:
|
|
||||||
{%- for role in roles %}
|
|
||||||
- {get_attr: [{{role.name}}IpListMap, short_service_bootstrap_hostnames]}
|
|
||||||
{%- endfor %}
|
|
||||||
service_bootstrap_node_ip:
|
|
||||||
yaql:
|
|
||||||
expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1]).select([$[0], $[1].flatten().first(null)]))
|
|
||||||
data:
|
|
||||||
l:
|
|
||||||
{%- for role in roles %}
|
|
||||||
- {get_attr: [{{role.name}}IpListMap, service_bootstrap_ips]}
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
NetVipMap: {get_attr: [VipMap, net_ip_map]}
|
NetVipMap: {get_attr: [VipMap, net_ip_map]}
|
||||||
RedisVirtualIP: {get_attr: [RedisVirtualIP, ip_address]}
|
RedisVirtualIP: {get_attr: [RedisVirtualIP, ip_address]}
|
||||||
ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
|
ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
|
||||||
DeployIdentifier: {get_param: DeployIdentifier}
|
|
||||||
UpdateIdentifier: {get_param: UpdateIdentifier}
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
GlobalConfig:
|
GlobalConfig:
|
||||||
|
@ -1094,6 +1053,11 @@ resources:
|
||||||
{%- for role in roles %}
|
{%- for role in roles %}
|
||||||
{{role.name}}HieradataVars: {get_attr: [{{role.name}}HieradataVars, value]}
|
{{role.name}}HieradataVars: {get_attr: [{{role.name}}HieradataVars, value]}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
EnabledServices:
|
||||||
|
list_concat:
|
||||||
|
{%- for role in roles %}
|
||||||
|
- {get_attr: [{{role.name}}ServiceNames, value]}
|
||||||
|
{%- endfor %}
|
||||||
|
|
||||||
DeployedServerEnvironment:
|
DeployedServerEnvironment:
|
||||||
type: OS::TripleO::DeployedServerEnvironment
|
type: OS::TripleO::DeployedServerEnvironment
|
||||||
|
@ -1207,11 +1171,6 @@ outputs:
|
||||||
BlacklistedIpAddresses:
|
BlacklistedIpAddresses:
|
||||||
description: List of blacklisted ctlplane IP addresses
|
description: List of blacklisted ctlplane IP addresses
|
||||||
value: {get_attr: [BlacklistedIpAddresses, value]}
|
value: {get_attr: [BlacklistedIpAddresses, value]}
|
||||||
# We can use the AllNodesConfig from the primary role here as this part of
|
|
||||||
# the allNodesConfig is the same for all roles.
|
|
||||||
AllNodesConfig:
|
|
||||||
description: The config (hieradata) for all nodes.
|
|
||||||
value: {get_attr: [{{primary_role_name}}allNodesConfig, all_nodes_config]}
|
|
||||||
GlobalConfig:
|
GlobalConfig:
|
||||||
description: The global_config (hieradata).
|
description: The global_config (hieradata).
|
||||||
value: {get_attr: [GlobalConfig, value]}
|
value: {get_attr: [GlobalConfig, value]}
|
||||||
|
|
|
@ -14,20 +14,6 @@ parameters:
|
||||||
type: string
|
type: string
|
||||||
enabled_services:
|
enabled_services:
|
||||||
type: comma_delimited_list
|
type: comma_delimited_list
|
||||||
controller_ips:
|
|
||||||
type: comma_delimited_list
|
|
||||||
service_ips:
|
|
||||||
type: json
|
|
||||||
service_node_names:
|
|
||||||
type: json
|
|
||||||
short_service_node_names:
|
|
||||||
type: json
|
|
||||||
short_service_bootstrap_node:
|
|
||||||
type: json
|
|
||||||
service_bootstrap_node_ip:
|
|
||||||
type: json
|
|
||||||
controller_names:
|
|
||||||
type: comma_delimited_list
|
|
||||||
NetVipMap:
|
NetVipMap:
|
||||||
type: json
|
type: json
|
||||||
RedisVirtualIP:
|
RedisVirtualIP:
|
||||||
|
@ -35,33 +21,6 @@ parameters:
|
||||||
default: ''
|
default: ''
|
||||||
ServiceNetMap:
|
ServiceNetMap:
|
||||||
type: json
|
type: json
|
||||||
DeployIdentifier:
|
|
||||||
type: string
|
|
||||||
default: ''
|
|
||||||
description: >
|
|
||||||
Setting this to a unique value will re-run any deployment tasks which
|
|
||||||
perform configuration on a Heat stack-update.
|
|
||||||
UpdateIdentifier:
|
|
||||||
type: string
|
|
||||||
default: ''
|
|
||||||
description: >
|
|
||||||
Setting to a previously unused value during stack-update will trigger
|
|
||||||
package update on all nodes
|
|
||||||
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']
|
|
||||||
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:
|
|
||||||
- allowed_values: ['', 'UPGRADE', 'FASTFORWARDUPGRADE']
|
|
||||||
default: ''
|
|
||||||
EnableInternalTLS:
|
EnableInternalTLS:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
@ -76,91 +35,15 @@ parameters:
|
||||||
description: The name of the {{network.name_lower}} network.
|
description: The name of the {{network.name_lower}} network.
|
||||||
type: string
|
type: string
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
ContainerCli:
|
|
||||||
type: string
|
|
||||||
default: 'podman'
|
|
||||||
description: CLI tool used to manage containers.
|
|
||||||
constraints:
|
|
||||||
- allowed_values: ['docker', 'podman']
|
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
allNodesConfigValue:
|
|
||||||
type: OS::Heat::Value
|
|
||||||
properties:
|
|
||||||
value:
|
|
||||||
yaql:
|
|
||||||
expression: $.data.all_nodes_extra_map_data.mergeWith($.data.all_nodes)
|
|
||||||
data:
|
|
||||||
all_nodes_extra_map_data: {get_param: AllNodesExtraMapData}
|
|
||||||
all_nodes:
|
|
||||||
map_merge:
|
|
||||||
- enabled_services:
|
|
||||||
yaql:
|
|
||||||
expression: $.data.distinct()
|
|
||||||
data: {get_param: enabled_services}
|
|
||||||
# This writes out a mapping of service_name_enabled: 'true'
|
|
||||||
# For any services not enabled, hiera foo_enabled will
|
|
||||||
# return nil, as it's undefined
|
|
||||||
- map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
# Note this must be string 'true' due to
|
|
||||||
# https://bugs.launchpad.net/heat/+bug/1617203
|
|
||||||
SERVICE_enabled: 'true'
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_param: enabled_services}
|
|
||||||
# Dynamically generate per-service network data
|
|
||||||
# This works as follows (outer->inner functions)
|
|
||||||
# yaql - filters services where no mapping exists in ServiceNetMap
|
|
||||||
# map_replace: substitute e.g heat_api_network with network name from ServiceNetMap
|
|
||||||
# map_merge/repeat: generate a per-service mapping
|
|
||||||
- yaql:
|
|
||||||
# This filters any entries where the value hasn't been substituted for
|
|
||||||
# a list, e.g it's still $service_network. This happens when there is
|
|
||||||
# no network defined for the service in the ServiceNetMap, which is OK
|
|
||||||
# as not all services have to be bound to a network, so we filter them
|
|
||||||
expression: dict($.data.map.items().where(isString($[1]) and not $[1].endsWith("_network")))
|
|
||||||
data:
|
|
||||||
map:
|
|
||||||
map_replace:
|
|
||||||
- map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_network: SERVICE_network
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_param: enabled_services}
|
|
||||||
- values: {get_param: ServiceNetMap}
|
|
||||||
# Keystone doesn't provide separate entries for the public
|
|
||||||
# and admin endpoints, so we need to add them here manually
|
|
||||||
# like we do in the vip-config below
|
|
||||||
- keystone_admin_api_network: {get_param: [ServiceNetMap, keystone_admin_api_network]}
|
|
||||||
keystone_public_api_network: {get_param: [ServiceNetMap, keystone_public_api_network]}
|
|
||||||
# provides a mapping of service_name_ips to a list of IPs
|
|
||||||
- {get_param: service_ips}
|
|
||||||
- {get_param: service_node_names}
|
|
||||||
- {get_param: short_service_node_names}
|
|
||||||
- {get_param: short_service_bootstrap_node}
|
|
||||||
- {get_param: service_bootstrap_node_ip}
|
|
||||||
- controller_node_ips:
|
|
||||||
list_join:
|
|
||||||
- ','
|
|
||||||
- {get_param: controller_ips}
|
|
||||||
controller_node_names:
|
|
||||||
list_join:
|
|
||||||
- ','
|
|
||||||
- {get_param: controller_names}
|
|
||||||
deploy_identifier: {get_param: DeployIdentifier}
|
|
||||||
stack_action: {get_param: StackAction}
|
|
||||||
stack_update_type: {get_param: StackUpdateType}
|
|
||||||
container_cli: {get_param: ContainerCli}
|
|
||||||
|
|
||||||
allNodesConfigDatafiles:
|
allNodesConfigDatafiles:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
properties:
|
properties:
|
||||||
value:
|
value:
|
||||||
datafiles:
|
datafiles:
|
||||||
all_nodes: {get_attr: [allNodesConfigValue, value]}
|
all_nodes_extra_map_data: {get_parm: AllNodesExtraMapData}
|
||||||
vip_data:
|
vip_data:
|
||||||
map_merge:
|
map_merge:
|
||||||
# Dynamically generate per-service VIP data based on enabled_services
|
# Dynamically generate per-service VIP data based on enabled_services
|
||||||
|
@ -248,9 +131,6 @@ outputs:
|
||||||
description: The ID of the allNodesConfigImpl resource.
|
description: The ID of the allNodesConfigImpl resource.
|
||||||
value:
|
value:
|
||||||
{get_resource: allNodesConfigImpl}
|
{get_resource: allNodesConfigImpl}
|
||||||
all_nodes_config:
|
|
||||||
description: The all_nodes hieradata config
|
|
||||||
value: {get_attr: [allNodesConfigValue, value]}
|
|
||||||
all_nodes_config_hieradata:
|
all_nodes_config_hieradata:
|
||||||
description: The all_nodes config in the full format with datafiles section.
|
description: The all_nodes config in the full format with datafiles section.
|
||||||
value: {get_attr: [allNodesConfigDatafiles, value]}
|
value: {get_attr: [allNodesConfigDatafiles, value]}
|
||||||
|
|
|
@ -43,9 +43,6 @@ environments:
|
||||||
parameters:
|
parameters:
|
||||||
- SoftwareConfigTransport
|
- SoftwareConfigTransport
|
||||||
- DnsServers
|
- DnsServers
|
||||||
puppet/all-nodes-config.yaml:
|
|
||||||
parameters:
|
|
||||||
- StackAction
|
|
||||||
sample-env-generator/standalone.yaml:
|
sample-env-generator/standalone.yaml:
|
||||||
parameters:
|
parameters:
|
||||||
- AddVipsToEtcHosts
|
- AddVipsToEtcHosts
|
||||||
|
|
|
@ -24,9 +24,6 @@ environments:
|
||||||
parameters:
|
parameters:
|
||||||
- SoftwareConfigTransport
|
- SoftwareConfigTransport
|
||||||
- DnsServers
|
- DnsServers
|
||||||
puppet/all-nodes-config.yaml:
|
|
||||||
parameters:
|
|
||||||
- StackAction
|
|
||||||
sample_values:
|
sample_values:
|
||||||
# Normal bits for standalone
|
# Normal bits for standalone
|
||||||
StackAction: CREATE
|
StackAction: CREATE
|
||||||
|
|
Loading…
Reference in New Issue