Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge "Use Ansible to configure the Hiera config"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jun 22, 2019
2 parents 636cf45 + e115e14 commit d48275a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 47 deletions.
7 changes: 7 additions & 0 deletions common/deploy-steps.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ parameters:
{{role.name}}DeploymentHieradata:
type: json
default: {}
{{role.name}}DeploymentHierarchy:
type: json
default: {}
{{role.name}}PerHostHieradata:
type: json
default: {}
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down
33 changes: 33 additions & 0 deletions overcloud.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
47 changes: 0 additions & 47 deletions puppet/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d48275a

Please sign in to comment.