Merge "Use Ansible to configure the Hiera config"

This commit is contained in:
Zuul 2019-06-22 07:32:06 +00:00 committed by Gerrit Code Review
commit d48275a3f1
3 changed files with 40 additions and 47 deletions

View File

@ -122,6 +122,9 @@ parameters:
{{role.name}}DeploymentHieradata:
type: json
default: {}
{{role.name}}DeploymentHierarchy:
type: json
default: {}
{{role.name}}PerHostHieradata:
type: json
default: {}
@ -405,6 +408,7 @@ outputs:
hieradata_template: "{{role.name}}/all-nodes-deployment-hieradata.j2.yaml"
hieradata_variable_start_string: $$
hieradata_variable_end_string: $$
hieradata_files: "{{ '{{' }} lookup('file', '{{role.name}}/deployment-hierarchy.yaml') {{ '}}' }}"
when: tripleo_role_name == '{{role.name}}'
- name: Deployment hieradata
include_role:
@ -413,6 +417,7 @@ outputs:
hieradata_template: "{{role.name}}/deployment-hieradata.j2.yaml"
hieradata_variable_start_string: $$
hieradata_variable_end_string: $$
hieradata_files: "{{ '{{' }} lookup('file', '{{role.name}}/deployment-hierarchy.yaml') {{ '}}' }}"
when: tripleo_role_name == '{{role.name}}'
- name: Per-host hieradata
include_role:
@ -422,6 +427,7 @@ outputs:
hieradata_per_host: True
hieradata_variable_start_string: $$
hieradata_variable_end_string: $$
hieradata_files: "{{ '{{' }} lookup('file', '{{role.name}}/deployment-hierarchy.yaml') {{ '}}' }}"
when: tripleo_role_name == '{{role.name}}'
{%- endfor %}
tags:
@ -679,6 +685,7 @@ outputs:
# removed.
{{role.name}}/all-nodes-deployment-hieradata.j2.yaml: {get_param: {{role.name}}AllNodesDeploymentHieradata}
{{role.name}}/deployment-hieradata.j2.yaml: {get_param: {{role.name}}DeploymentHieradata}
{{role.name}}/deployment-hierarchy.yaml: {get_param: {{role.name}}DeploymentHierarchy}
{{role.name}}/per-host-hieradata.j2.yaml: {get_param: {{role.name}}PerHostHieradata}
{%- endfor %}
update_steps_tasks: |

View File

@ -1000,6 +1000,37 @@ resources:
- {get_attr: [{{role.name}}, blacklist_hostname]}
{%- endfor %}
{%- for role in roles %}
{{role.name}}ConfigHierarchy:
type: OS::Heat::Value
properties:
value:
- '"%{::uuid}"'
- host_extraconfig
- docker_puppet # Optionally provided by container-puppet.py
- heat_config_%{::deploy_config_name}
- config_step
- {{role.name.lower()}}_extraconfig
- extraconfig
- service_names
- service_configs
- {{role.name.lower()}}
- bootstrap_node # provided by allNodesConfig
- all_nodes # provided by allNodesConfig
- vip_data # provided by allNodesConfig
- net_ip_map
- '"%{::osfamily}"'
# The following are required for compatibility with the Controller role
# where some vendor integrations added hieradata via ExtraConfigPre
- neutron_bigswitch_data # Optionally provided by Controller/ComputeExtraConfigPre
- neutron_cisco_data # Optionally provided by Controller/ComputeExtraConfigPre
- cisco_n1kv_data # Optionally provided by Controller/ComputeExtraConfigPre
- midonet_data #Optionally provided by AllNodesExtraConfig
- cisco_aci_data # Optionally provided by Controller/ComputeExtraConfigPre
# Special variable for upgrade
- upgrade
{%- endfor %}
# Post deployment steps for all roles
AllNodesDeploySteps:
type: OS::TripleO::PostDeploySteps
@ -1029,6 +1060,8 @@ resources:
map_merge:
list_concat:
- {get_attr: [{{role.name}}, config_datafiles]}
{{role.name}}DeploymentHierarchy:
{get_attr: [{{role.name}}ConfigHierarchy, value]}
{{role.name}}PerHostHieradata:
map_merge:
list_concat:

View File

@ -660,53 +660,6 @@ resources:
- {get_param: {{role.name}}NetworkDeploymentActions}
- {get_param: NetworkDeploymentActions}
{{server_resource_name}}Deployment:
type: OS::Heat::StructuredDeployment
depends_on: PreNetworkConfig
properties:
name: {{server_resource_name}}Deployment
config: {get_resource: {{server_resource_name}}Config}
server: {get_resource: {{server_resource_name}}}
actions:
if:
- server_not_blacklisted
- ['CREATE', 'UPDATE']
- []
{{server_resource_name}}Config:
type: OS::Heat::StructuredConfig
depends_on: {{server_resource_name}}ConfigDatafiles
properties:
group: hiera
config:
map_merge:
- hierarchy:
- '"%{::uuid}"'
- host_extraconfig
- docker_puppet # Optionally provided by container-puppet.py
- heat_config_%{::deploy_config_name}
- config_step
- {{role.name.lower()}}_extraconfig
- extraconfig
- service_names
- service_configs
- {{role.name.lower()}}
- bootstrap_node # provided by allNodesConfig
- all_nodes # provided by allNodesConfig
- vip_data # provided by allNodesConfig
- net_ip_map
- '"%{::osfamily}"'
# The following are required for compatibility with the Controller role
# where some vendor integrations added hieradata via ExtraConfigPre
- neutron_bigswitch_data # Optionally provided by Controller/ComputeExtraConfigPre
- neutron_cisco_data # Optionally provided by Controller/ComputeExtraConfigPre
- cisco_n1kv_data # Optionally provided by Controller/ComputeExtraConfigPre
- midonet_data #Optionally provided by AllNodesExtraConfig
- cisco_aci_data # Optionally provided by Controller/ComputeExtraConfigPre
# Special variable for upgrade
- upgrade
- merge_behavior: deeper
{{server_resource_name}}ConfigDatafiles:
type: OS::Heat::Value
properties: