From bb9fd2c61a9ab41c57f427e13cd6a8bae391049e Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 11 Jan 2018 13:14:50 +0000 Subject: [PATCH] Reinstate common overcloud manifest for all roles This was lost in the translation to ansible, but it's needed to enable existing interfaces such as hiera includes via *ExtraConfig. For reference this problem was introduced in: I674a4d9d2c77d1f6fbdb0996f6c9321848e32662 and this fix only considers returning the behaviour prior to that patch (for the baremetal puppet apply), further discussion is required on if/how this could be applied to the new container architecture. Change-Id: I0384edb23eed336b95ffe6293fe7d4248447e849 Partial-Bug: #1742663 --- common/services.yaml | 22 ++++--- overcloud-resource-registry-puppet.j2.yaml | 1 - puppet/config.role.j2.yaml | 59 ------------------- ...{overcloud_role.pp => overcloud_common.pp} | 5 +- 4 files changed, 16 insertions(+), 71 deletions(-) delete mode 100644 puppet/config.role.j2.yaml rename puppet/manifests/{overcloud_role.pp => overcloud_common.pp} (78%) diff --git a/common/services.yaml b/common/services.yaml index eda3c7c449..fb15d26cc9 100644 --- a/common/services.yaml +++ b/common/services.yaml @@ -67,14 +67,20 @@ resources: properties: type: string value: - yaql: - expression: - # select 'step_config' only from services that do not have a docker_config - coalesce($.data.service_names, []).zip(coalesce($.data.step_config, []), coalesce($.data.docker_config, [])).where($[2] = null).where($[1] != null).select($[1]).join("\n") - data: - service_names: {get_attr: [ServiceChain, role_data, service_name]} - step_config: {get_attr: [ServiceChain, role_data, step_config]} - docker_config: {get_attr: [ServiceChain, role_data, docker_config]} + list_join: + - "\n" + - - str_replace: + template: {get_file: ../puppet/manifests/overcloud_common.pp} + params: + __ROLE__: {get_param: RoleName} + - yaql: + expression: + # select 'step_config' only from services that do not have a docker_config + coalesce($.data.service_names, []).zip(coalesce($.data.step_config, []), coalesce($.data.docker_config, [])).where($[2] = null).where($[1] != null).select($[1]).join("\n") + data: + service_names: {get_attr: [ServiceChain, role_data, service_name]} + step_config: {get_attr: [ServiceChain, role_data, step_config]} + docker_config: {get_attr: [ServiceChain, role_data, docker_config]} DockerConfig: type: OS::Heat::Value diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index 9d8e611471..3ba636e22c 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -19,7 +19,6 @@ resource_registry: OS::TripleO::{{role.name}}::PreNetworkConfig: OS::Heat::None OS::TripleO::{{role.name}}PostDeploySteps: common/post.yaml OS::TripleO::{{role.name}}: puppet/{{role.name.lower()}}-role.yaml - OS::TripleO::{{role.name}}Config: puppet/{{role.name.lower()}}-config.yaml OS::TripleO::Tasks::{{role.name}}PreConfig: OS::Heat::None OS::TripleO::Tasks::{{role.name}}PostConfig: OS::Heat::None OS::TripleO::{{role.name}}ExtraConfigPre: puppet/extraconfig/pre_deploy/default.yaml diff --git a/puppet/config.role.j2.yaml b/puppet/config.role.j2.yaml deleted file mode 100644 index 6f449c2000..0000000000 --- a/puppet/config.role.j2.yaml +++ /dev/null @@ -1,59 +0,0 @@ -heat_template_version: queens - -description: > - A software config which runs puppet on the {{role}} role - -parameters: - ConfigDebug: - default: false - description: Whether to run config management (e.g. Puppet) in debug mode. - type: boolean - StepConfig: - type: string - description: Config manifests that will be used to step through the deployment. - default: '' - PuppetTags: - type: string - description: List of comma-separated tags to limit puppet catalog to. - default: '' - -conditions: - - puppet_tags_empty: {equals : [{get_param: PuppetTags}, '']} - -resources: - - {{role}}PuppetConfigImpl: - type: OS::Heat::SoftwareConfig - properties: - group: puppet - options: - enable_debug: {get_param: ConfigDebug} - enable_hiera: True - enable_facter: False - modulepath: /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules - tags: - if: - - puppet_tags_empty - - '' - - list_join: - - ',' - - ['file,concat,file_line,augeas', {get_param: PuppetTags}] - outputs: - - name: result - inputs: - - name: step - type: Number - config: - list_join: - - '' - - - str_replace: - template: {get_file: manifests/overcloud_role.pp} - params: - __ROLE__: {{role.lower()}} - - {get_param: StepConfig} - -outputs: - OS::stack_id: - description: The software config which runs puppet on the {{role}} role - value: {get_resource: {{role}}PuppetConfigImpl} diff --git a/puppet/manifests/overcloud_role.pp b/puppet/manifests/overcloud_common.pp similarity index 78% rename from puppet/manifests/overcloud_role.pp rename to puppet/manifests/overcloud_common.pp index e2bf514621..5b3a6c0182 100644 --- a/puppet/manifests/overcloud_role.pp +++ b/puppet/manifests/overcloud_common.pp @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +# Common config, from tripleo-heat-templates/puppet/manifests/overcloud_common.pp # The content of this file will be used to generate # the puppet manifests for all roles, the placeholder # __ROLE__ will be replaced by 'controller', 'blockstorage', @@ -25,6 +26,4 @@ if hiera('step') >= 4 { $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud___ROLE__', hiera('step')]) package_manifest{$package_manifest_name: ensure => present} -# NOTE(gfidente): ensure deprecated package manifest is absent, can be removed after Pike -$absent_package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller_pacemaker', hiera('step')]) -package_manifest{$absent_package_manifest_name: ensure => absent} +# End of overcloud_common.pp