Add simple heat stacks

This commit is contained in:
2022-11-29 08:11:28 +00:00
parent d7167cfbdf
commit efd20ff014
2 changed files with 153 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
heat_template_version: queens
parameters:
image:
type: string
#default: ubuntu-bionic
default: 78bed194-ce02-4d6f-a110-56941b2e126b
description: glance image used to boot the server
flavor:
type: string
default: dd281ac4-2662-4b55-8d7c-c11b076ab793
description: flavor to use when booting the server
volume-type:
type: string
default: cinder-t3
description: flavor to use when booting the server
network-id:
type: string
default: c6d41cc0-0296-40e4-8dd8-4f7ff8d850ae
description: test network to use
resources:
volume_test:
type: OS::Cinder::Volume
properties:
name: volume_test
size: 10
volume_type: { get_param: volume-type }
server_init:
type: OS::Heat::CloudConfig
properties:
cloud_config:
password: ubuntu
chpasswd: {expire: False}
ssh_pwauth: True
server_test:
type: OS::Nova::Server
properties:
name: server_test
availability_zone: az-3
config_drive: true
flavor: { get_param: flavor }
image: { get_param: image }
user_data_format: RAW
user_data: { get_resource: server_init }
networks:
- port:
get_resource: server_eth0
volume-attach:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: server_test }
volume_id: { get_resource: volume_test }
secgroup_test:
type: OS::Neutron::SecurityGroup
properties:
description: Allow ssh and ping
name: secgroup_test
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
- remote_ip_prefix: 0.0.0.0/0
protocol: icmp
server_eth0:
type: OS::Neutron::Port
properties:
network_id: { get_param: network-id}
security_groups: [{ get_resource: secgroup_test }]

View File

@@ -0,0 +1,73 @@
heat_template_version: queens
parameters:
image:
type: string
default: ubuntu-bionic
description: glance image used to boot the server
flavor:
type: string
default: natp.xp.m1.small
description: flavor to use when booting the server
volume-type:
type: string
default: cinder-t3
description: The volume type to use for the volume that is going to be created
volume-data:
type: string
description: The persistent volume to attach the instance to
resources:
volume_test:
type: OS::Cinder::Volume
properties:
name: volume_test
size: 10
volume_type: { get_param: volume-type }
server_test:
type: OS::Nova::Server
properties:
name: server_test
flavor: { get_param: flavor }
image: { get_param: image }
networks:
- port:
get_resource: server_eth0
volume-attach:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: server_test }
volume_id: { get_resource: volume_test }
volume-data:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: server_test }
volume_id: { get_param: volume-data }
secgroup_test:
type: OS::Neutron::SecurityGroup
properties:
description: Allow ssh and ping
name: secgroup_test
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
- remote_ip_prefix: 0.0.0.0/0
protocol: icmp
server_eth0:
type: OS::Neutron::Port
properties:
network_id: test
security_groups: [{ get_resource: secgroup_test }]