diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 24 | ||||
-rw-r--r-- | block-storage-nfs.yaml | 59 | ||||
-rw-r--r-- | block-storage.yaml | 6 | ||||
-rw-r--r-- | examples/scale_map_result.yaml | 132 | ||||
-rw-r--r-- | nfs-server-source.yaml | 28 | ||||
-rw-r--r-- | notcompute.yaml | 12 | ||||
-rw-r--r-- | nova-compute-instance.yaml | 6 | ||||
-rw-r--r-- | overcloud-source.yaml | 24 | ||||
-rw-r--r-- | tripleo_heat_merge/merge.py | 7 | ||||
-rw-r--r-- | undercloud-source.yaml | 12 |
11 files changed, 296 insertions, 16 deletions
@@ -1,5 +1,7 @@ # Built via Makefile overcloud.yaml +overcloud-with-block-storage.yaml +overcloud-with-block-storage-nfs.yaml undercloud-bm.yaml undercloud-vm.yaml undercloud-vm-tuskar.yaml @@ -1,8 +1,10 @@ -generated_templates = \ - overcloud.yaml \ - undercloud-vm.yaml \ - undercloud-bm.yaml \ - undercloud-vm-tuskar.yaml \ +generated_templates = \ + overcloud.yaml \ + overcloud-with-block-storage.yaml \ + overcloud-with-block-storage-nfs.yaml \ + undercloud-vm.yaml \ + undercloud-bm.yaml \ + undercloud-vm-tuskar.yaml \ undercloud-vm-ironic.yaml # Files included in overcloud-source.yaml via FileInclude @@ -17,7 +19,13 @@ overcloud.yaml: overcloud-source.yaml swift-source.yaml ssl-source.yaml $(overcl overcloud-with-block-storage.yaml: overcloud-source.yaml nova-compute-instance.yaml swift-source.yaml block-storage.yaml # $^ won't work here because we want to list nova-compute-instance.yaml as # a prerequisite but don't want to pass it into merge.py - python ./tripleo_heat_merge/merge.py overcloud-source.yaml swift-source.yaml block-storage.yaml > $@.tmp + python ./tripleo_heat_merge/merge.py --scale NovaCompute=$${COMPUTESCALE:-'1'} --scale BlockStorage=$${CINDERSCALE:-'1'} overcloud-source.yaml swift-source.yaml block-storage.yaml > $@.tmp + mv $@.tmp $@ + +overcloud-with-block-storage-nfs.yaml: overcloud-source.yaml nova-compute-instance.yaml swift-source.yaml nfs-server-source.yaml block-storage-nfs.yaml + # $^ won't work here because we want to list nova-compute-instance.yaml as + # a prerequisite but don't want to pass it into merge.py + python ./tripleo_heat_merge/merge.py --scale NovaCompute=$${COMPUTESCALE:-'1'} --scale BlockStorage=$${CINDERSCALE:-'1'} overcloud-source.yaml swift-source.yaml nfs-server-source.yaml block-storage-nfs.yaml > $@.tmp mv $@.tmp $@ undercloud-vm.yaml: undercloud-source.yaml undercloud-vm-source.yaml @@ -36,10 +44,12 @@ undercloud-vm-ironic.yaml: undercloud-source.yaml undercloud-vm-ironic-source.ya python ./tripleo_heat_merge/merge.py $^ > $@.tmp mv $@.tmp $@ +check: test + test: @bash test_merge.bash clean: rm -f $(generated_templates) -.PHONY: clean overcloud.yaml +.PHONY: clean overcloud.yaml check diff --git a/block-storage-nfs.yaml b/block-storage-nfs.yaml new file mode 100644 index 00000000..04f45ef4 --- /dev/null +++ b/block-storage-nfs.yaml @@ -0,0 +1,59 @@ +HeatTemplateFormatVersion: '2012-12-12' +Description: 'Common Block Storage Configuration' +Parameters: + BlockStorageImage: + Type: String + Default: overcloud-cinder-volume + OvercloudBlockStorageFlavor: + Default: baremetal + Description: Flavor for block storage nodes to request when deploying. + Type: String +Resources: + BlockStorageAccessPolicy: + Type: OS::Heat::AccessPolicy + Properties: + AllowedResources: + - BlockStorage0 + BlockStorageUser: + Type: AWS::IAM::User + Properties: + Policies: [ { Ref: BlockStorageAccessPolicy } ] + BlockStorageKey: + Type: AWS::IAM::AccessKey + Properties: + UserName: + Ref: BlockStorageUser + BlockStorage0: + Type: OS::Nova::Server + Properties: + image: + {Ref: BlockStorageImage} + flavor: {Ref: OvercloudBlockStorageFlavor} + key_name: {Ref: KeyName} + Metadata: + os-collect-config: + cfn: + access_key_id: + Ref: BlockStorageKey + secret_access_key: + Fn::GetAtt: [ BlockStorageKey, SecretAccessKey ] + stack_name: {Ref: 'AWS::StackName'} + OpenStack::ImageBuilder::Elements: [ cinder ] + keystone: + host: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } + cinder: + db: {"Fn::Join": ['', ['mysql://cinder:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } , '/cinder']]} + volume_size_mb: '5000' + service-password: + Ref: CinderPassword + volume: 'true' + include_nfs_backend: 'true' + nfs_shares: + - {"Fn::Join": ['', [{"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } , ':/mnt/state/var/lib/nfs_share']]} + admin-password: {Ref: AdminPassword} + rabbit: + host: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } + username: {Ref: RabbitUserName} + password: {Ref: RabbitPassword} + interfaces: + control: {Ref: NeutronPublicInterface} diff --git a/block-storage.yaml b/block-storage.yaml index ca56fcef..c801040f 100644 --- a/block-storage.yaml +++ b/block-storage.yaml @@ -11,6 +11,10 @@ Parameters: Type: String Default: "guest" NoEcho: true + OvercloudBlockStorageFlavor: + Default: baremetal + Description: Flavor for block storage nodes to request when deploying. + Type: String Resources: BlockStorageAccessPolicy: Type: OS::Heat::AccessPolicy @@ -31,7 +35,7 @@ Resources: Properties: image: {Ref: BlockStorageImage} - flavor: {Ref: Flavor} + flavor: {Ref: OvercloudBlockStorageFlavor} key_name: {Ref: KeyName} Metadata: os-collect-config: diff --git a/examples/scale_map_result.yaml b/examples/scale_map_result.yaml index 5fa02291..c4617835 100644 --- a/examples/scale_map_result.yaml +++ b/examples/scale_map_result.yaml @@ -66,6 +66,50 @@ Resources: - NovaCompute0 - show - local + - Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: + - NovaCompute1 + - networks + - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute1 + - show + - Fn::Join: + - . + - - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute1 + - show + - local + - Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: + - NovaCompute2 + - networks + - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute2 + - show + - Fn::Join: + - . + - - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute2 + - show + - local os-collect-config: cfn: access_key_id: @@ -126,6 +170,28 @@ Resources: - Fn::Select: - ctlplane - Fn::GetAtt: + - NovaCompute0 + - networks + - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute0 + - show + - Fn::Join: + - . + - - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute0 + - show + - local + - Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: - NovaCompute1 - networks - Fn::Select: @@ -141,6 +207,28 @@ Resources: - NovaCompute1 - show - local + - Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: + - NovaCompute2 + - networks + - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute2 + - show + - Fn::Join: + - . + - - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute2 + - show + - local os-collect-config: cfn: access_key_id: @@ -201,6 +289,50 @@ Resources: - Fn::Select: - ctlplane - Fn::GetAtt: + - NovaCompute0 + - networks + - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute0 + - show + - Fn::Join: + - . + - - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute0 + - show + - local + - Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: + - NovaCompute1 + - networks + - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute1 + - show + - Fn::Join: + - . + - - Fn::Select: + - name + - Fn::GetAtt: + - NovaCompute1 + - show + - local + - Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: - NovaCompute2 - networks - Fn::Select: diff --git a/nfs-server-source.yaml b/nfs-server-source.yaml new file mode 100644 index 00000000..22214ae0 --- /dev/null +++ b/nfs-server-source.yaml @@ -0,0 +1,28 @@ +Description: 'NFS server share configuration for testing' +Resources: + notCompute0Config: + Type: AWS::AutoScaling::LaunchConfiguration + Metadata: + nfs_server: + shares: + Merge::Map: + NovaCompute0: + Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: + - NovaCompute0 + - networks + BlockStorage0: + Fn::Join: + - ' ' + - - Fn::Select: + - 0 + - Fn::Select: + - ctlplane + - Fn::GetAtt: + - BlockStorage0 + - networks
\ No newline at end of file diff --git a/notcompute.yaml b/notcompute.yaml index 2d3301fb..2ad5b30b 100644 --- a/notcompute.yaml +++ b/notcompute.yaml @@ -31,6 +31,14 @@ Parameters: Description: Password for connecting to glance database Type: String NoEcho: true + GlanceNotifierStrategy: + Description: Strategy to use for Glance notification queue + Type: String + Default: noop + GlanceLogFile: + Description: The filepath of the file to use for logging messages from Glance. + Type: String + Default: '' HeatDBPassword: Description: Password for accessing Heat database. Type: String @@ -130,6 +138,10 @@ Resources: - - 'mysql://glance:' - {Ref: GlanceDBPassword} - '@127.0.0.1/glance' + notifier-strategy: + Ref: GlanceNotifierStrategy + log-file: + Ref: GlanceLogFile heat: db: Fn::Join: diff --git a/nova-compute-instance.yaml b/nova-compute-instance.yaml index 55665dce..d2ca90f5 100644 --- a/nova-compute-instance.yaml +++ b/nova-compute-instance.yaml @@ -10,7 +10,7 @@ Parameters: Description: Name of an existing EC2 KeyPair to enable SSH access to the instances Type: String Default: default - Flavor: + OvercloudComputeFlavor: Description: Use this flavor Type: String Default: baremetal @@ -108,7 +108,7 @@ Resources: Ref: ComputeUser NovaCompute0CompletionCondition: Type: AWS::CloudFormation::WaitCondition - DependsOn: notCompute0 + DependsOn: notCompute0Config Properties: Handle: {Ref: NovaCompute0CompletionHandle} Count: '1' @@ -122,7 +122,7 @@ Resources: {Ref: NovaImage} image_update_policy: Ref: ImageUpdatePolicy - flavor: {Ref: Flavor} + flavor: {Ref: OvercloudComputeFlavor} key_name: {Ref: KeyName} Metadata: os-collect-config: diff --git a/overcloud-source.yaml b/overcloud-source.yaml index fa626aa2..42fc07a6 100644 --- a/overcloud-source.yaml +++ b/overcloud-source.yaml @@ -17,15 +17,27 @@ Parameters: Description: The password for the cinder service account, used by cinder-api. Type: String NoEcho: true - Flavor: + OvercloudControlFlavor: Default: baremetal - Description: Flavor to request when deploying. + Description: Flavor for control nodes to request when deploying. + Type: String + OvercloudComputeFlavor: + Default: baremetal + Description: Flavor for compute nodes to request when deploying. Type: String GlancePassword: Default: unset Description: The password for the glance service account, used by the glance services. Type: String NoEcho: true + GlanceNotifierStrategy: + Description: Strategy to use for Glance notification queue + Type: String + Default: noop + GlanceLogFile: + Description: The filepath of the file to use for logging messages from Glance. + Type: String + Default: '' HeatPassword: Default: unset Description: The password for the Heat service account, used by the Heat services. @@ -154,7 +166,7 @@ Resources: Type: AWS::IAM::AccessKey notCompute0CompletionCondition: Type: AWS::CloudFormation::WaitCondition - DependsOn: notCompute0 + DependsOn: notCompute0Config Properties: Handle: {Ref: notCompute0CompletionHandle} Count: '1' @@ -303,6 +315,10 @@ Resources: swift-store-user: service:glance swift-store-key: Ref: GlancePassword + notifier-strategy: + Ref: GlanceNotifierStrategy + log-file: + Ref: GlanceLogFile heat: admin_password: Ref: HeatPassword @@ -460,7 +476,7 @@ Resources: image_update_policy: Ref: ImageUpdatePolicy flavor: - Ref: Flavor + Ref: OvercloudControlFlavor key_name: Ref: KeyName Metadata: diff --git a/tripleo_heat_merge/merge.py b/tripleo_heat_merge/merge.py index 0de27e24..4571d289 100644 --- a/tripleo_heat_merge/merge.py +++ b/tripleo_heat_merge/merge.py @@ -33,9 +33,12 @@ def apply_scaling(template, scaling, in_copies=None): Values are handled via scale_value. - Keys in dicts are always copied per the scaling rule. + Keys in dicts are copied per the scaling rule. Values are either replaced or copied depending on whether the given scaling rule is in in_copies. + + in_copies is reset to None when a dict {'Merge::Map': someobject} is + encountered. """ in_copies = dict(in_copies or {}) # Shouldn't be needed but to avoid unexpected side effects/bugs we short @@ -43,6 +46,8 @@ def apply_scaling(template, scaling, in_copies=None): if not scaling: return template if isinstance(template, dict): + if 'Merge::Map' in template: + in_copies = None new_template = {} for key, value in template.items(): for prefix, copy_num, new_key in scale_value( diff --git a/undercloud-source.yaml b/undercloud-source.yaml index 97a05ed9..4fe2976c 100644 --- a/undercloud-source.yaml +++ b/undercloud-source.yaml @@ -24,6 +24,14 @@ Parameters: Description: The password for the glance service account, used by the glance services. Type: String NoEcho: true + GlanceNotifierStrategy: + Description: Strategy to use for Glance notification queue + Type: String + Default: noop + GlanceLogFile: + Description: The filepath of the file to use for logging messages from Glance. + Type: String + Default: '' KeyName: Default: default Description: Name of an existing EC2 KeyPair to enable SSH access to the instances @@ -123,6 +131,10 @@ Resources: host: 127.0.0.1 service-password: Ref: GlancePassword + notifier-strategy: + Ref: GlanceNotifierStrategy + log-file: + Ref: GlanceLogFile heat: admin_password: Ref: HeatPassword |