diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | block-storage.yaml | 2 | ||||
-rw-r--r-- | examples/source2_lib_result.yaml | 4 | ||||
-rw-r--r-- | examples/source_include_subkey_result.yaml | 4 | ||||
-rw-r--r-- | examples/source_lib_result.yaml | 4 | ||||
-rw-r--r-- | nova-compute-instance.yaml | 15 | ||||
-rw-r--r-- | overcloud-source.yaml | 21 | ||||
-rw-r--r-- | tripleo_heat_merge/merge.py | 30 | ||||
-rw-r--r-- | undercloud-source.yaml | 29 |
9 files changed, 77 insertions, 36 deletions
@@ -10,8 +10,6 @@ overcloud_source_deps = nova-compute-instance.yaml all: $(generated_templates) -# Note that COMPUTESCALE is not a physical dep - 'make overcloud.yaml' won't do -# the right thing if you change COMPUTESCALE from one run to another. overcloud.yaml: overcloud-source.yaml swift-source.yaml ssl-source.yaml $(overcloud_source_deps) python ./tripleo_heat_merge/merge.py --scale NovaCompute=$${COMPUTESCALE:-'1'} overcloud-source.yaml swift-source.yaml ssl-source.yaml > $@.tmp mv $@.tmp $@ @@ -43,3 +41,5 @@ test: clean: rm -f $(generated_templates) + +.PHONY: clean overcloud.yaml diff --git a/block-storage.yaml b/block-storage.yaml index d644c421..48496356 100644 --- a/block-storage.yaml +++ b/block-storage.yaml @@ -39,8 +39,6 @@ Resources: {Ref: BlockStorageImage} flavor: {Ref: Flavor} key_name: {Ref: KeyName} - InstanceType: '0' - ImageId: '0' Metadata: os-collect-config: cfn: diff --git a/examples/source2_lib_result.yaml b/examples/source2_lib_result.yaml index d4b19768..172dce0f 100644 --- a/examples/source2_lib_result.yaml +++ b/examples/source2_lib_result.yaml @@ -1,7 +1,7 @@ Description: examples/source2.yaml HeatTemplateFormatVersion: '2012-12-12' Parameters: - GenericBImage: + BImage: Type: String ImportantValue: Default: a_default @@ -12,5 +12,5 @@ Resources: my_meta: Foo Properties: image: - Ref: GenericBImage + Ref: BImage Type: OS::Nova::Server diff --git a/examples/source_include_subkey_result.yaml b/examples/source_include_subkey_result.yaml index f5ff80ea..641e8148 100644 --- a/examples/source_include_subkey_result.yaml +++ b/examples/source_include_subkey_result.yaml @@ -1,7 +1,7 @@ Description: examples/source_include_subkey.yaml HeatTemplateFormatVersion: '2012-12-12' Parameters: - GenericBImage: + Foo: Type: String Resources: GenericB: @@ -10,5 +10,5 @@ Resources: Ref: ImportantValue Properties: image: - Ref: GenericBImage + Ref: Foo Type: OS::Nova::Server diff --git a/examples/source_lib_result.yaml b/examples/source_lib_result.yaml index a165cabf..ceb8a321 100644 --- a/examples/source_lib_result.yaml +++ b/examples/source_lib_result.yaml @@ -1,14 +1,14 @@ Description: examples/source.yaml HeatTemplateFormatVersion: '2012-12-12' Parameters: - AImage: null Default: my_image + SourceImage: null Type: String Resources: A: Properties: image: - Ref: AImage + Ref: SourceImage Type: OS::Nova::Server B: Metadata: diff --git a/nova-compute-instance.yaml b/nova-compute-instance.yaml index 4b6a8a05..6c2671c0 100644 --- a/nova-compute-instance.yaml +++ b/nova-compute-instance.yaml @@ -23,8 +23,20 @@ Parameters: Default: overcloud-compute KeystoneHost: Type: String + NeutronFlatNetworks: + Type: String + Default: '' + Description: If set, flat networks to configure in neutron plugins. NeutronHost: Type: String + NeutronPhysicalBridge: + Default: '' + Description: An OVS bridge to create for accessing external networks. + Type: String + NeutronPublicInterface: + Default: '' + Description: A port to add to the NeutronPhysicalBridge. + Type: String RabbitHost: Type: String RabbitPassword: @@ -149,6 +161,7 @@ Resources: keystone: host: {Ref: KeystoneHost} neutron: + flat-networks: {Ref: NeutronFlatNetworks} host: {Ref: NeutronHost} ovs_db: {Ref: NeutronDSN} ovs: @@ -164,6 +177,8 @@ Resources: network_vlan_ranges: {Ref: NeutronNetworkVLANRanges} bridge_mappings: {Ref: NeutronBridgeMappings} enable_tunneling: {Ref: NeutronEnableTunnelling} + physical_bridge: {Ref: NeutronPhysicalBridge} + public_interface: {Ref: NeutronPublicInterface} service-password: Ref: NeutronPassword admin-password: {Ref: AdminPassword} diff --git a/overcloud-source.yaml b/overcloud-source.yaml index 78ce4aa0..7fd7505f 100644 --- a/overcloud-source.yaml +++ b/overcloud-source.yaml @@ -77,9 +77,17 @@ Parameters: Description: The password for the nova service account, used by nova-api. Type: String NoEcho: true - PowerUserName: - Default: stack - Description: What username to ssh to the virtual power host with. + NeutronFlatNetworks: + Type: String + Default: '' + Description: If set, flat networks to configure in neutron plugins. + HypervisorNeutronPhysicalBridge: + Default: '' + Description: An OVS bridge to create on each hypervisor. + Type: String + HypervisorNeutronPublicInterface: + Default: '' + Description: What interface to add to the HypervisorNeutronPhysicalBridge. Type: String NeutronPublicInterface: Default: eth0 @@ -162,7 +170,13 @@ Resources: NeutronDSN: {"Fn::Join": ['', ['mysql://neutron:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ]}, '/neutron']]} NeutronNetworkType: "gre" NeutronEnableTunnelling: "True" + NeutronFlatNetworks: + Ref: NeutronFlatNetworks NeutronNetworkVLANRanges: "" + NeutronPhysicalBridge: + Ref: HypervisorNeutronPhysicalBridge + NeutronPublicInterface: + Ref: HypervisorNeutronPublicInterface NeutronBridgeMappings: Ref: NeutronBridgeMappings RabbitPassword: "guest" @@ -280,6 +294,7 @@ Resources: - notCompute0 - networks neutron: + flat-networks: {Ref: NeutronFlatNetworks} host: Fn::Select: - 0 diff --git a/tripleo_heat_merge/merge.py b/tripleo_heat_merge/merge.py index 7b5951a3..dd254ab4 100644 --- a/tripleo_heat_merge/merge.py +++ b/tripleo_heat_merge/merge.py @@ -188,11 +188,17 @@ def main(argv=None): "be copied to Prefix1Foo in the output, and value Prefix0Bar to be" "renamed to Prefix1Bar inside that copy, or copied to Prefix1Bar " "outside of any copy.") + parser.add_argument( + '--change-image-params', action='store_true', default=False, + help="Change parameters in templates to match resource names. This was " + " the default at one time but it causes issues when parameter " + " names need to remain stable.") args = parser.parse_args(argv) templates = args.templates scaling = parse_scaling(args.scale) merged_template = merge(templates, args.master_role, args.slave_roles, - args.included_template_dir, scaling=scaling) + args.included_template_dir, scaling=scaling, + change_image_params=args.change_image_params) if args.output == '-': out_file = sys.stdout else: @@ -202,7 +208,7 @@ def main(argv=None): def merge(templates, master_role=None, slave_roles=None, included_template_dir=INCLUDED_TEMPLATE_DIR, - scaling=None): + scaling=None, change_image_params=None): scaling = scaling or {} errors = [] end_template={'HeatTemplateFormatVersion': '2012-12-12', @@ -239,11 +245,12 @@ def merge(templates, master_role=None, slave_roles=None, new_resources = template.get('Resources', {}) for r, rbody in sorted(new_resources.items()): if rbody['Type'] in MERGABLE_TYPES: - if 'image' in MERGABLE_TYPES[rbody['Type']]: - image_key = MERGABLE_TYPES[rbody['Type']]['image'] - # XXX Assuming ImageId is always a Ref - ikey_val = end_template['Parameters'][rbody['Properties'][image_key]['Ref']] - del end_template['Parameters'][rbody['Properties'][image_key]['Ref']] + if change_image_params: + if 'image' in MERGABLE_TYPES[rbody['Type']]: + image_key = MERGABLE_TYPES[rbody['Type']]['image'] + # XXX Assuming ImageId is always a Ref + ikey_val = end_template['Parameters'][rbody['Properties'][image_key]['Ref']] + del end_template['Parameters'][rbody['Properties'][image_key]['Ref']] role = rbody.get('Metadata', {}).get('OpenStack::Role', r) role = translate_role(role, master_role, slave_roles) if role != r: @@ -264,10 +271,11 @@ def merge(templates, master_role=None, slave_roles=None, if 'Resources' not in end_template: end_template['Resources'] = {} end_template['Resources'][role] = rbody - if 'image' in MERGABLE_TYPES[rbody['Type']]: - ikey = '%sImage' % (role) - end_template['Resources'][role]['Properties'][image_key] = {'Ref': ikey} - end_template['Parameters'][ikey] = ikey_val + if change_image_params: + if 'image' in MERGABLE_TYPES[rbody['Type']]: + ikey = '%sImage' % (role) + end_template['Resources'][role]['Properties'][image_key] = {'Ref': ikey} + end_template['Parameters'][ikey] = ikey_val elif rbody['Type'] == 'FileInclude': # we trust os.path.join to DTRT: if FileInclude path isn't # absolute, join to included_template_dir (./) diff --git a/undercloud-source.yaml b/undercloud-source.yaml index 801c7916..9c49e656 100644 --- a/undercloud-source.yaml +++ b/undercloud-source.yaml @@ -15,6 +15,17 @@ Parameters: Default: i386 Description: The architecture to use in Nova-BM - i386 or amd64. Type: String + ControllerAddress: + Default: + Fn::Select: + - 0 + - Fn::Select: + - "ctlplane" + - Fn::GetAtt: + - undercloud + - networks + Description: The IP address for controller endpoints in config files. + Type: String Flavor: Default: baremetal Description: Flavor to request when deploying. @@ -33,7 +44,7 @@ Parameters: Description: The password for the Heat service account, used by the Heat services. Type: String NoEcho: true - Image: + undercloudImage: Default: undercloud Type: String NeutronPassword: @@ -85,13 +96,7 @@ Resources: admin-token: Ref: AdminToken controller-address: - Fn::Select: - - 0 - - Fn::Select: - - "ctlplane" - - Fn::GetAtt: - - undercloud - - networks + Ref: ControllerAddress cinder: db: mysql://cinder:unset@localhost/cinder volume_size_mb: '5000' @@ -115,19 +120,19 @@ Resources: Fn::Join: - '' - - http:// - - {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [ undercloud, networks ]} ]}]} + - {Ref: ControllerAddress} - ":8003" metadata_server_url: Fn::Join: - '' - - http:// - - {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [ undercloud, networks ]} ]}]} + - {Ref: ControllerAddress} - ":8000" waitcondition_server_url: Fn::Join: - '' - - http:// - - {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [ undercloud, networks ]} ]}]} + - {Ref: ControllerAddress} - ":8000/v1/waitcondition" os-collect-config: cfn: @@ -165,7 +170,7 @@ Resources: Type: OS::Nova::Server Properties: image: - Ref: Image + Ref: undercloudImage flavor: Ref: Flavor key_name: |