summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Herve <therve@redhat.com>2018-12-07 15:45:10 +0100
committerThomas Herve <therve@redhat.com>2018-12-07 15:45:10 +0100
commit862f52cce0821878a0ea0ea66160cb9dfa1a2506 (patch)
tree2a273fb6c5cb04e90b30aed826c48ba541c92e2b
parentfd040354711f8846a189503c6338508af9c0e6cf (diff)
Put user data in the main stack
We create user data per instance, but two are global for all, and the last one per role, so we can move it up the stack. Change-Id: I1330e54744adef9be159edd8f01aefa3db85a480
Notes
Notes (review): Verified-1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Code-Review+2: Alex Schultz <aschultz@redhat.com> Code-Review+2: Dan Prince <dprince@redhat.com> Workflow+1: Emilien Macchi <emilien@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 13 Dec 2018 18:53:27 +0000 Reviewed-on: https://review.openstack.org/623504 Project: openstack/tripleo-heat-templates Branch: refs/heads/master
-rw-r--r--overcloud.j2.yaml28
-rw-r--r--puppet/role.role.j2.yaml32
2 files changed, 32 insertions, 28 deletions
diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml
index 98c1cec..639dd59 100644
--- a/overcloud.j2.yaml
+++ b/overcloud.j2.yaml
@@ -396,6 +396,16 @@ resources:
396 - {get_attr: [{{role.name}}, known_hosts_hostnames]} 396 - {get_attr: [{{role.name}}, known_hosts_hostnames]}
397 {% endfor %} 397 {% endfor %}
398 398
399 # Creates the "heat-admin" user if configured via the environment
400 # Should return a OS::Heat::MultipartMime reference via OS::stack_id
401 NodeAdminUserData:
402 type: OS::TripleO::NodeAdminUserData
403
404 # For optional operator additional userdata
405 # Should return a OS::Heat::MultipartMime reference via OS::stack_id
406 NodeUserData:
407 type: OS::TripleO::NodeUserData
408
399 # Jinja loop for Role in roles_data.yaml 409 # Jinja loop for Role in roles_data.yaml
400{% for role in roles %} 410{% for role in roles %}
401 # Resources generated for {{role.name}} Role 411 # Resources generated for {{role.name}} Role
@@ -552,6 +562,23 @@ resources:
552 data: 562 data:
553 - {get_attr: [{{role.name}}, hostname_map]} 563 - {get_attr: [{{role.name}}, hostname_map]}
554 564
565 # Combine the NodeAdminUserData and NodeUserData mime archives
566 {{role.name}}UserData:
567 type: OS::Heat::MultipartMime
568 properties:
569 parts:
570 - config: {get_resource: NodeAdminUserData}
571 type: multipart
572 - config: {get_resource: NodeUserData}
573 type: multipart
574 - config: {get_resource: {{role.name}}RoleUserData}
575 type: multipart
576
577 # For optional operator role-specific userdata
578 # Should return a OS::Heat::MultipartMime reference via OS::stack_id
579 {{role.name}}RoleUserData:
580 type: OS::TripleO::{{role.name}}::NodeUserData
581
555 {{role.name}}: 582 {{role.name}}:
556 type: OS::Heat::ResourceGroup 583 type: OS::Heat::ResourceGroup
557 depends_on: Networks 584 depends_on: Networks
@@ -590,6 +617,7 @@ resources:
590 map_merge: 617 map_merge:
591 - {{role.RoleParametersDefault|default({})}} 618 - {{role.RoleParametersDefault|default({})}}
592 - get_param: {{role.name}}Parameters 619 - get_param: {{role.name}}Parameters
620 UserData: {get_resource: {{role.name}}UserData}
593{% endfor %} 621{% endfor %}
594 622
595{% for role in roles %} 623{% for role in roles %}
diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml
index 9eb23bc..d9302f7 100644
--- a/puppet/role.role.j2.yaml
+++ b/puppet/role.role.j2.yaml
@@ -289,6 +289,9 @@ parameters:
289 constraints: 289 constraints:
290 - allowed_values: [delete, retain] 290 - allowed_values: [delete, retain]
291 291
292 UserData:
293 type: string
294
292{% if role.uses_deprecated_params|default(false) %} 295{% if role.uses_deprecated_params|default(false) %}
293parameter_groups: 296parameter_groups:
294- label: deprecated 297- label: deprecated
@@ -424,7 +427,7 @@ resources:
424 - network: ctlplane 427 - network: ctlplane
425 subnet: {get_param: {{role.name}}ControlPlaneSubnet} 428 subnet: {get_param: {{role.name}}ControlPlaneSubnet}
426 user_data_format: SOFTWARE_CONFIG 429 user_data_format: SOFTWARE_CONFIG
427 user_data: {get_resource: UserData} 430 user_data: {get_param: UserData}
428 name: 431 name:
429 yaql: 432 yaql:
430 expression: $.data.hostname_map.get($.data.hostname, $.data.hostname).toLower() 433 expression: $.data.hostname_map.get($.data.hostname, $.data.hostname).toLower()
@@ -448,33 +451,6 @@ resources:
448 - {get_param: [DeploymentSwiftDataMap, 451 - {get_param: [DeploymentSwiftDataMap,
449 {get_param: Hostname}]} 452 {get_param: Hostname}]}
450 453
451 # Combine the NodeAdminUserData and NodeUserData mime archives
452 UserData:
453 type: OS::Heat::MultipartMime
454 properties:
455 parts:
456 - config: {get_resource: NodeAdminUserData}
457 type: multipart
458 - config: {get_resource: NodeUserData}
459 type: multipart
460 - config: {get_resource: RoleUserData}
461 type: multipart
462
463 # Creates the "heat-admin" user if configured via the environment
464 # Should return a OS::Heat::MultipartMime reference via OS::stack_id
465 NodeAdminUserData:
466 type: OS::TripleO::NodeAdminUserData
467
468 # For optional operator additional userdata
469 # Should return a OS::Heat::MultipartMime reference via OS::stack_id
470 NodeUserData:
471 type: OS::TripleO::NodeUserData
472
473 # For optional operator role-specific userdata
474 # Should return a OS::Heat::MultipartMime reference via OS::stack_id
475 RoleUserData:
476 type: OS::TripleO::{{role.name}}::NodeUserData
477
478 {%- for network in networks %} 454 {%- for network in networks %}
479 {%- if network.enabled|default(true) and network.name in role.networks|default([]) %} 455 {%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
480 {{network.name}}Port: 456 {{network.name}}Port: