From 87fc83d7b1334dd2bd5852ae9edf44f87d29e79c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 25 Jan 2021 19:57:02 +0900 Subject: [PATCH] Restore PreNetworkConfig resources This change restores the PreNetworkConfig resources, so that we migrate back ExtraCnfigPre and NodeExtraConfig from pre network configurations to post network configurations, to be consistent with older version depending on Heat software deployments instead of config download. Depends-on: https://review.opendev.org/783554 Closes-Bug: #1907214 Change-Id: I96e7e4c570839cfba6011788464d8e93925b2f01 (cherry picked from commit e7894c0b2308692364b72a7dc22cb5a32cd5c3b8) --- common/deploy-steps.j2 | 30 ++++++++++++++++--- overcloud-resource-registry-puppet.j2.yaml | 1 + puppet/role.role.j2.yaml | 9 ++++++ .../notes/bug-1907214-df2f07cbacbe8a24.yaml | 13 ++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/bug-1907214-df2f07cbacbe8a24.yaml diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 2b0842f06e..d4cfcb0925 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -525,21 +525,21 @@ outputs: - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST strategy: tripleo_free - name: Server pre deployment steps + name: Server pre network steps gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" any_errors_fatal: yes tasks: {% raw %} - import_tasks: hiera_steps_tasks.yaml - - name: Server deployments + - name: Server pre-network deployments delegate_to: localhost run_once: true debug: - msg: Use --start-at-task 'Server deployments' to resume from this task + msg: Use --start-at-task 'Server pre-network deployments' to resume from this task - include_tasks: deployments.yaml vars: force: false - with_items: "{{ hostvars[inventory_hostname]['pre_deployments_' ~ tripleo_role_name]|default([]) }}" + with_items: "{{ hostvars[inventory_hostname]['pre_network_' ~ tripleo_role_name]|default([]) }}" {% endraw %} tags: - overcloud @@ -604,6 +604,28 @@ outputs: - network_deploy_steps {% endraw %} + - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free + name: Server pre deployment steps + gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" + any_errors_fatal: yes + tasks: +{% raw %} + - import_tasks: hiera_steps_tasks.yaml + - name: Server deployments + delegate_to: localhost + run_once: true + debug: + msg: Use --start-at-task 'Server deployments' to resume from this task + - include_tasks: deployments.yaml + vars: + force: false + with_items: "{{ hostvars[inventory_hostname]['pre_deployments_' ~ tripleo_role_name]|default([]) }}" +{% endraw %} + tags: + - overcloud + - pre_deploy_steps + - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST strategy: tripleo_free name: Host prep steps diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index b37a69a1ef..1def37a60e 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -9,6 +9,7 @@ resource_registry: OS::TripleO::RandomString: OS::Heat::RandomString {% for role in roles %} + 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::Tasks::{{role.name}}PreConfig: OS::Heat::None diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index 9d627a5476..3990af5035 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -401,6 +401,15 @@ resources: short: - {get_attr: [{{server_resource_name}}, name]} + PreNetworkConfig: + type: OS::TripleO::{{role.name}}::PreNetworkConfig + condition: server_not_blacklisted + properties: + server: {get_resource: {{server_resource_name}}} + RoleParameters: {get_param: RoleParameters} + ServiceNames: {get_param: ServiceNames} + deployment_actions: {get_attr: [DeploymentActions, value]} + # Resource for site-specific injection of root certificate NodeTLSCAData: type: OS::TripleO::NodeTLSCAData diff --git a/releasenotes/notes/bug-1907214-df2f07cbacbe8a24.yaml b/releasenotes/notes/bug-1907214-df2f07cbacbe8a24.yaml new file mode 100644 index 0000000000..9697f2f31e --- /dev/null +++ b/releasenotes/notes/bug-1907214-df2f07cbacbe8a24.yaml @@ -0,0 +1,13 @@ +--- +features: + - | + The ``OS::TripleO::{{role.name}}::PreNetworkConfig`` resource has been + restored. This resource can be used to implement any configuration steps + executed before network configurations are applied. + +fixes: + - | + Now ``ExtraConfigPre`` resource and ``NodeExtraConfig`` resource are + executed after network configurations are applied in nodes. This is + consitent with the previous version with heat software deployment + mechanism instead of config-download.