diff --git a/.goreleaser.yml b/.goreleaser.yml index eed99fa7..c2c41e39 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -52,6 +52,7 @@ checksum: release: #disable: true + prerelease: true github: owner: tliron diff --git a/assets/tosca/profiles/openstack/1.0/data.yaml b/assets/tosca/profiles/openstack/1.0/data.yaml index 4e815877..a2c0d139 100644 --- a/assets/tosca/profiles/openstack/1.0/data.yaml +++ b/assets/tosca/profiles/openstack/1.0/data.yaml @@ -38,15 +38,15 @@ data_types: derived_from: string - openstack.Nova.Flavor: + openstack.nova.Flavor: derived_from: string - openstack.Nova.Keypair: + openstack.nova.Keypair: derived_from: string - openstack.Nova.Server.Network: + openstack.nova.Server.Network: derived_from: Root properties: allocate_network: @@ -80,7 +80,7 @@ data_types: Dict, which has expand properties for port. Used only if port property is not specified for creating port. type: map - entry_schema: openstack.Nova.Server.Port + entry_schema: openstack.nova.Server.Port subnet: description: >- Subnet in which to allocate the IP address for port. Used for creating port, based on @@ -91,7 +91,7 @@ data_types: Port tag. Heat ignores any update on this property as nova does not support it. type: string - openstack.Nova.Server.Port: + openstack.nova.Server.Port: derived_from: Root properties: admin_state_up: @@ -103,7 +103,7 @@ data_types: description: >- Additional MAC/IP address pairs allowed to pass through the port. type: list - entry_schema: openstack.Nova.Server.AddressPair + entry_schema: openstack.nova.Server.AddressPair binding.vnic_type: description: >- The vnic type to be bound on the neutron port. To support SR-IOV PCI passthrough @@ -135,7 +135,7 @@ data_types: type: map entry_schema: string # TODO - openstack.Nova.Server.AddressPair: + openstack.nova.Server.AddressPair: derived_from: Root properties: ip_address: @@ -147,7 +147,7 @@ data_types: MAC address to allow through this port. type: openstack.MacAddress - openstack.Nova.Server.SwiftData: + openstack.nova.Server.SwiftData: derived_from: Root properties: container: @@ -163,7 +163,7 @@ data_types: constraints: - min_length: 1 - openstack.Nova.Server.BlockDevice: + openstack.nova.Server.BlockDevice: derived_from: Root properties: delete_on_termination: @@ -189,7 +189,7 @@ data_types: infer the size. type: scalar-unit.size - openstack.Nova.Server.BlockDevice2: + openstack.nova.Server.BlockDevice2: derived_from: Root properties: boot_index: diff --git a/assets/tosca/profiles/openstack/1.0/js/generate.js b/assets/tosca/profiles/openstack/1.0/js/generate.js index ef959dbe..d55bf031 100644 --- a/assets/tosca/profiles/openstack/1.0/js/generate.js +++ b/assets/tosca/profiles/openstack/1.0/js/generate.js @@ -23,7 +23,7 @@ function writeTopology() { for (var vertexId in clout.vertexes) { var vertex = clout.vertexes[vertexId]; - if (!tosca.isNodeTemplate(vertex, 'openstack.Nova.Server')) + if (!tosca.isNodeTemplate(vertex, 'openstack.nova.Server')) continue; var nodeTemplate = vertex.properties; @@ -47,10 +47,10 @@ function writePlaybookInstall() { name: 'Configure OpenStack', os_client_config: null, }, { - name: 'Import topology.yaml', + name: 'Import topology.' + puccini.format, include_vars: { name: 'topology', - file: 'topology.yaml' + file: 'topology.' + puccini.format } }, { include_role: { @@ -161,7 +161,7 @@ function writeCfg() { puccini.write('\ [defaults]\n\ ansible_managed=Modified by Ansible on %Y-%m-%d %H:%M:%S %Z\n\ -inventory=./inventory.yaml\n\ +inventory=./inventory.' + puccini.format +'\n\ transport=ssh\n\ command_warnings=false\n\ \n\ diff --git a/assets/tosca/profiles/openstack/1.0/nodes.yaml b/assets/tosca/profiles/openstack/1.0/nodes.yaml index 5882c48b..7754d3c3 100644 --- a/assets/tosca/profiles/openstack/1.0/nodes.yaml +++ b/assets/tosca/profiles/openstack/1.0/nodes.yaml @@ -8,7 +8,7 @@ imports: node_types: # https://docs.openstack.org/heat/rocky/template_guide/openstack.html#OS::Nova::Server - openstack.Nova.Server: + openstack.nova.Server: metadata: heat_name: OS::Nova::Server properties: @@ -26,13 +26,13 @@ node_types: description: >- Block device mappings for this server. type: list - entry_schema: openstack.Nova.Server.BlockDevice + entry_schema: openstack.nova.Server.BlockDevice required: false block_device_mapping_v2: description: >- Block device mappings v2 for this server. type: list - entry_schema: openstack.Nova.Server.BlockDevice2 + entry_schema: openstack.nova.Server.BlockDevice2 required: false config_drive: description: >- @@ -48,7 +48,7 @@ node_types: is set to POLL_TEMP_URL, a container will be automatically created from the resource name, and the object name will be a generated uuid. type: map - entry_schema: openstack.Nova.Server.SwiftData + entry_schema: openstack.nova.Server.SwiftData required: false diskConfig: description: >- @@ -60,7 +60,7 @@ node_types: flavor: description: >- The ID or name of the flavor to boot onto. - type: openstack.Nova.Flavor + type: openstack.nova.Flavor flavor_update_policy: description: >- Policy on how to apply a flavor update; either by requesting a server resize or by @@ -87,7 +87,7 @@ node_types: key_name: description: >- Name of keypair to inject into the server. - type: openstack.Nova.Keypair + type: openstack.nova.Keypair required: false metadata: description: >- @@ -107,7 +107,7 @@ node_types: An ordered list of nics to be added to this server, with information about connected networks, fixed ips, port etc. type: list - entry_schema: openstack.Nova.Server.Network + entry_schema: openstack.nova.Server.Network required: false personality: description: >- diff --git a/examples/openstack/hello-world.yaml b/examples/openstack/hello-world.yaml index b5d6b588..23b9867e 100644 --- a/examples/openstack/hello-world.yaml +++ b/examples/openstack/hello-world.yaml @@ -28,7 +28,7 @@ topology_template: node_templates: my_instance: - type: openstack.Nova.Server + type: openstack.nova.Server properties: key_name: { get_input: key_name } image: { get_input: image_id } diff --git a/tosca/grammars/hot/template.go b/tosca/grammars/hot/template.go index 1ea27334..c0f078a4 100644 --- a/tosca/grammars/hot/template.go +++ b/tosca/grammars/hot/template.go @@ -36,6 +36,7 @@ func NewTemplate(context *tosca.Context) *Template { self.Context.ImportScript("tosca.visualize", "internal:/tosca/simple/1.1/js/visualize.js") self.Context.ImportScript("tosca.utils", "internal:/tosca/simple/1.1/js/utils.js") self.Context.ImportScript("tosca.helpers", "internal:/tosca/simple/1.1/js/helpers.js") + self.Context.ImportScript("openstack.generate", "internal:/tosca/openstack/1.0/js/generate.js") self.NewPseudoParameter("OS::stack_name", "stack_name") self.NewPseudoParameter("OS::stack_id", "stack_id") diff --git a/tosca/profiles/openstack/v1_0/data.go b/tosca/profiles/openstack/v1_0/data.go index 289b7afb..108c5b1b 100644 --- a/tosca/profiles/openstack/v1_0/data.go +++ b/tosca/profiles/openstack/v1_0/data.go @@ -44,15 +44,15 @@ data_types: derived_from: string - openstack.Nova.Flavor: + openstack.nova.Flavor: derived_from: string - openstack.Nova.Keypair: + openstack.nova.Keypair: derived_from: string - openstack.Nova.Server.Network: + openstack.nova.Server.Network: derived_from: Root properties: allocate_network: @@ -86,7 +86,7 @@ data_types: Dict, which has expand properties for port. Used only if port property is not specified for creating port. type: map - entry_schema: openstack.Nova.Server.Port + entry_schema: openstack.nova.Server.Port subnet: description: >- Subnet in which to allocate the IP address for port. Used for creating port, based on @@ -97,7 +97,7 @@ data_types: Port tag. Heat ignores any update on this property as nova does not support it. type: string - openstack.Nova.Server.Port: + openstack.nova.Server.Port: derived_from: Root properties: admin_state_up: @@ -109,7 +109,7 @@ data_types: description: >- Additional MAC/IP address pairs allowed to pass through the port. type: list - entry_schema: openstack.Nova.Server.AddressPair + entry_schema: openstack.nova.Server.AddressPair binding.vnic_type: description: >- The vnic type to be bound on the neutron port. To support SR-IOV PCI passthrough @@ -141,7 +141,7 @@ data_types: type: map entry_schema: string # TODO - openstack.Nova.Server.AddressPair: + openstack.nova.Server.AddressPair: derived_from: Root properties: ip_address: @@ -153,7 +153,7 @@ data_types: MAC address to allow through this port. type: openstack.MacAddress - openstack.Nova.Server.SwiftData: + openstack.nova.Server.SwiftData: derived_from: Root properties: container: @@ -169,7 +169,7 @@ data_types: constraints: - min_length: 1 - openstack.Nova.Server.BlockDevice: + openstack.nova.Server.BlockDevice: derived_from: Root properties: delete_on_termination: @@ -195,7 +195,7 @@ data_types: infer the size. type: scalar-unit.size - openstack.Nova.Server.BlockDevice2: + openstack.nova.Server.BlockDevice2: derived_from: Root properties: boot_index: diff --git a/tosca/profiles/openstack/v1_0/js-generate.go b/tosca/profiles/openstack/v1_0/js-generate.go index 75053d7e..8f47e486 100644 --- a/tosca/profiles/openstack/v1_0/js-generate.go +++ b/tosca/profiles/openstack/v1_0/js-generate.go @@ -29,7 +29,7 @@ function writeTopology() { for (var vertexId in clout.vertexes) { var vertex = clout.vertexes[vertexId]; - if (!tosca.isNodeTemplate(vertex, 'openstack.Nova.Server')) + if (!tosca.isNodeTemplate(vertex, 'openstack.nova.Server')) continue; var nodeTemplate = vertex.properties; @@ -53,10 +53,10 @@ function writePlaybookInstall() { name: 'Configure OpenStack', os_client_config: null, }, { - name: 'Import topology.yaml', + name: 'Import topology.' + puccini.format, include_vars: { name: 'topology', - file: 'topology.yaml' + file: 'topology.' + puccini.format } }, { include_role: { @@ -167,7 +167,7 @@ function writeCfg() { puccini.write('\ [defaults]\n\ ansible_managed=Modified by Ansible on %Y-%m-%d %H:%M:%S %Z\n\ -inventory=./inventory.yaml\n\ +inventory=./inventory.' + puccini.format +'\n\ transport=ssh\n\ command_warnings=false\n\ \n\ diff --git a/tosca/profiles/openstack/v1_0/nodes.go b/tosca/profiles/openstack/v1_0/nodes.go index c7d8b1ab..e32f4a0e 100644 --- a/tosca/profiles/openstack/v1_0/nodes.go +++ b/tosca/profiles/openstack/v1_0/nodes.go @@ -14,7 +14,7 @@ imports: node_types: # https://docs.openstack.org/heat/rocky/template_guide/openstack.html#OS::Nova::Server - openstack.Nova.Server: + openstack.nova.Server: metadata: heat_name: OS::Nova::Server properties: @@ -32,13 +32,13 @@ node_types: description: >- Block device mappings for this server. type: list - entry_schema: openstack.Nova.Server.BlockDevice + entry_schema: openstack.nova.Server.BlockDevice required: false block_device_mapping_v2: description: >- Block device mappings v2 for this server. type: list - entry_schema: openstack.Nova.Server.BlockDevice2 + entry_schema: openstack.nova.Server.BlockDevice2 required: false config_drive: description: >- @@ -54,7 +54,7 @@ node_types: is set to POLL_TEMP_URL, a container will be automatically created from the resource name, and the object name will be a generated uuid. type: map - entry_schema: openstack.Nova.Server.SwiftData + entry_schema: openstack.nova.Server.SwiftData required: false diskConfig: description: >- @@ -66,7 +66,7 @@ node_types: flavor: description: >- The ID or name of the flavor to boot onto. - type: openstack.Nova.Flavor + type: openstack.nova.Flavor flavor_update_policy: description: >- Policy on how to apply a flavor update; either by requesting a server resize or by @@ -93,7 +93,7 @@ node_types: key_name: description: >- Name of keypair to inject into the server. - type: openstack.Nova.Keypair + type: openstack.nova.Keypair required: false metadata: description: >- @@ -113,7 +113,7 @@ node_types: An ordered list of nics to be added to this server, with information about connected networks, fixed ips, port etc. type: list - entry_schema: openstack.Nova.Server.Network + entry_schema: openstack.nova.Server.Network required: false personality: description: >-