├── .gitignore
├── .gitreview
├── .yamllint
├── .zuul.yaml
├── CONTRIBUTING.rst
├── LICENSE
├── README.rst
├── cfn
├── F17
│ ├── AutoScalingCeilometer.yaml
│ ├── EC2WithEBSSample.template
│ ├── HAProxy_Single_Instance.template
│ ├── InstanceGroup.template
│ ├── MySQL_Single_Instance.template
│ ├── Neutron.template
│ ├── Neutron.yaml
│ ├── Neutron_floating.template
│ ├── PuppetMaster_Single_Instance.template
│ ├── Rails_Single_Instance.template
│ ├── S3_Single_Instance.template
│ ├── Swift.template
│ ├── VPN_Service.template
│ ├── WordPress_2_Instances.template
│ ├── WordPress_2_Instances_With_EBS.template
│ ├── WordPress_2_Instances_With_EBS_EIP.template
│ ├── WordPress_And_Http.template
│ ├── WordPress_Composed_Instances.template
│ ├── WordPress_NoKey.template
│ ├── WordPress_Single_Instance.template
│ ├── WordPress_Single_Instance.yaml
│ ├── WordPress_Single_Instance_With_EBS.template
│ ├── WordPress_Single_Instance_With_EBS_EIP.template
│ ├── WordPress_Single_Instance_With_EIP.template
│ ├── WordPress_Single_Instance_With_HA.yaml
│ ├── WordPress_Single_Instance_With_Neutron.template
│ ├── WordPress_Single_Instance_gold.template
│ ├── WordPress_With_LB.template
│ ├── WordPress_With_RDS.template
│ ├── getting_started.template
│ └── invalid
│ │ ├── AutoScalingMultiAZSample.template
│ │ ├── AutoScalingMultiAZSample.yaml
│ │ ├── WordPress_Single_Instance_With_HA.template
│ │ ├── WordPress_Single_Instance_With_HA_AccessPolicy.template
│ │ └── WordPress_Single_Instance_With_IHA.template
├── F18
│ ├── WordPress_NoKey.yaml
│ └── WordPress_Single_Instance.template
├── F19
│ └── WordPress_NoKey.yaml
├── README
├── aws_asg.template
└── deb
│ ├── MultiNode_DevStack.yaml
│ └── WordPress_Single_Instance_deb.template
├── contrib
└── rackspace
│ ├── RackspaceAutoScale.yaml
│ └── WordPress_Single_Instance_Rackspace_Cloud_Servers.template
├── doc
└── source
│ ├── conf.py
│ └── contributor
│ └── contributing.rst
├── hot
├── F18
│ ├── NovaInstanceWithCinderVolume_Native.yaml
│ ├── WordPress_Native.yaml
│ └── WordPress_NoKey.yaml
├── F20
│ ├── WordPress_2_Instances.yaml
│ └── WordPress_Native.yaml
├── Windows
│ ├── ActiveDirectoryController
│ │ ├── AD.psm1
│ │ ├── ActiveDirectoryDomainController.ps1
│ │ └── ActiveDirectoryDomainController.yaml
│ ├── IIS_Drupal
│ │ ├── Common
│ │ │ └── heat-powershell-utils.psm1
│ │ ├── IIS_Drupal.ps1
│ │ ├── IIS_Drupal.psm1
│ │ ├── IIS_Drupal.yaml
│ │ └── Tests
│ │ │ └── IIS_Drupal.Tests.ps1
│ ├── MSSQLServer
│ │ ├── MSSQL.ps1
│ │ ├── MSSQL.psm1
│ │ ├── MSSQL.yaml
│ │ ├── Tests
│ │ │ └── MSSQL.Tests.ps1
│ │ └── heat-powershell-utils.psm1
│ └── PuppetAgent
│ │ ├── PuppetAgent.ps1
│ │ ├── PuppetAgent.psm1
│ │ ├── Tests
│ │ └── PuppetAgent.Tests.ps1
│ │ ├── heat-powershell-utils.psm1
│ │ └── puppet-agent.yaml
├── asg_of_servers.yaml
├── asg_of_stacks.yaml
├── autohealing
│ ├── autohealing_group.yaml
│ └── autohealing_server.yaml
├── autoscaling.yaml
├── barbican
│ ├── container_generic.yaml
│ ├── order.yaml
│ └── secret.yaml
├── blazar
│ ├── blazar_host.yaml
│ └── blazar_lease.yaml
├── chef-server.yaml
├── condition.yaml
├── designate
│ ├── desginate_domain.yaml
│ └── desginate_record.yaml
├── external_resource.yaml
├── hello_world.yaml
├── instance_group.yaml
├── keystone
│ ├── keystone.yaml
│ ├── keystone_domain.yaml
│ ├── keystone_group.yaml
│ ├── keystone_project.yaml
│ ├── keystone_region.yaml
│ ├── keystone_role.yaml
│ ├── keystone_service.yaml
│ ├── keystone_service_endpoint.yaml
│ ├── keystone_updated.yaml
│ └── keystone_user.yaml
├── lb_server.yaml
├── lbaasv2
│ └── lb_group.yaml
├── magnum
│ └── create_coe_cluster.yaml
├── mistral
│ ├── nova_networking_server_with_ip_env.yaml
│ └── templates
│ │ ├── autoscaling_using_mistral.yaml
│ │ ├── server_with_ip.yaml
│ │ └── stack_restarter.yaml
├── mistral_external.yaml
├── monasca
│ └── autoscaling.yaml
├── multi_region_hello_world.yaml
├── native_waitcondition.yaml
├── neutron
│ └── instance_trunk_port.yaml
├── nova
│ └── host_aggregate.yaml
├── octavia
│ └── servers_with_octavia.yaml
├── resource_group
│ ├── random.yaml
│ ├── resource_group.yaml
│ ├── resource_group_index_lookup.yaml
│ ├── server_with_volumes.yaml
│ └── volume_with_attachment.yaml
├── senlin
│ ├── autoscaled_loadbalancer_cluster.yaml
│ └── cluster.yaml
├── server_console.yaml
├── server_with_encrpyted_volume.yaml
├── servers_in_existing_neutron_net.yaml
├── servers_in_existing_neutron_network_no_floating_ips.yaml
├── servers_in_new_neutron_net.yaml
├── software-config
│ ├── README.rst
│ ├── boot-config
│ │ ├── README.rst
│ │ ├── centos7_rdo_env.yaml
│ │ ├── container_agent_env.yaml
│ │ ├── fedora_pip_env.yaml
│ │ ├── fedora_yum_env.yaml
│ │ ├── none_env.yaml
│ │ ├── templates
│ │ │ ├── fragments
│ │ │ │ ├── 20-os-apply-config
│ │ │ │ ├── configure_config_agent.sh
│ │ │ │ ├── get_container_agent_image.frag
│ │ │ │ ├── install_config_agent_pip.sh
│ │ │ │ ├── install_config_agent_rdo.sh
│ │ │ │ ├── install_config_agent_yum.sh
│ │ │ │ ├── install_python_build_env_apt.sh
│ │ │ │ ├── install_python_build_env_yum.sh
│ │ │ │ ├── os-collect-config.conf
│ │ │ │ ├── start_config_agent.sh
│ │ │ │ └── start_container_agent.sh
│ │ │ ├── install_config_agent_centos7_rdo.yaml
│ │ │ ├── install_config_agent_fedora_pip.yaml
│ │ │ ├── install_config_agent_fedora_yum.yaml
│ │ │ ├── install_config_agent_test_image.yaml
│ │ │ ├── install_config_agent_ubuntu_pip.yaml
│ │ │ └── install_container_agent.yaml
│ │ ├── test_image_env.yaml
│ │ └── ubuntu_pip_env.yaml
│ ├── example-templates
│ │ ├── README.rst
│ │ ├── certificates
│ │ │ ├── ca_1.crt
│ │ │ └── ca_2.crt
│ │ ├── cirros-example
│ │ │ ├── README.rst
│ │ │ ├── cirros-hello-world.yaml
│ │ │ ├── init.d
│ │ │ │ └── heat-deploy-hook
│ │ │ └── rc3.d
│ │ │ │ └── S99-heat-deploy-hook
│ │ ├── config-scripts
│ │ │ ├── example-ansible-template.ansible
│ │ │ ├── example-ca-certs-config.yml
│ │ │ ├── example-container-config.pod
│ │ │ ├── example-docker-compose.yml
│ │ │ ├── example-puppet-manifest.pp
│ │ │ ├── example-salt-state.sls
│ │ │ └── example-script.sh
│ │ ├── example-ansible-template.yaml
│ │ ├── example-cfn-init-template.yaml
│ │ ├── example-chef-template.yaml
│ │ ├── example-cloud-init-configure-ca-cert.yaml
│ │ ├── example-cloud-init.yaml
│ │ ├── example-config-pristine-image.yaml
│ │ ├── example-config-pristine-image_env.yaml
│ │ ├── example-deploy-sequence.yaml
│ │ ├── example-docker-compose-template.yaml
│ │ ├── example-kubelet-template.yaml
│ │ ├── example-os-apply-config-plus-cloud-config.yaml
│ │ ├── example-os-apply-config.yaml
│ │ ├── example-pristine-atomic-docker-compose.yaml
│ │ ├── example-pristine-atomic-docker-compose_env.yaml
│ │ ├── example-pristine-atomic-tool.yaml
│ │ ├── example-pristine-atomic-tool_env.yaml
│ │ ├── example-puppet-template.yaml
│ │ ├── example-salt-template.yaml
│ │ ├── example-script-template.yaml
│ │ ├── example-software-deploymentgroup-template.yaml
│ │ ├── example-ssh-copy-id.yaml
│ │ ├── example-structured-template.yaml
│ │ ├── example-sw-component-template.yaml
│ │ └── wordpress
│ │ │ ├── WordPress_software-config_1-instance.yaml
│ │ │ ├── WordPress_software-config_2-instances.yaml
│ │ │ ├── db_install.sh
│ │ │ └── wp_install.sh
│ ├── heat-container-agent
│ │ ├── Dockerfile
│ │ ├── README.rst
│ │ └── scripts
│ │ │ ├── 50-heat-config-docker-compose
│ │ │ ├── 55-heat-config
│ │ │ ├── configure_container_agent.sh
│ │ │ ├── heat-config-notify
│ │ │ └── hooks
│ │ │ ├── atomic
│ │ │ ├── docker-compose
│ │ │ └── script
│ └── test-image
│ │ ├── README.rst
│ │ ├── build-heat-test-image.sh
│ │ └── elements
│ │ ├── centos7-heat-test
│ │ ├── README.md
│ │ ├── element-deps
│ │ ├── package-installs.yaml
│ │ └── pkg-map
│ │ ├── fedora-heat-test
│ │ ├── README.md
│ │ └── element-deps
│ │ ├── heat-agent-pkg-requires
│ │ ├── README.md
│ │ ├── element-deps
│ │ ├── package-installs.yaml
│ │ └── pkg-map
│ │ ├── heat-config-hook-requires
│ │ ├── README.md
│ │ ├── element-deps
│ │ ├── package-installs.yaml
│ │ └── pkg-map
│ │ ├── python-dev
│ │ ├── README.md
│ │ ├── element-deps
│ │ ├── package-installs.yaml
│ │ └── pkg-map
│ │ └── ubuntu-heat-test
│ │ ├── README.md
│ │ └── element-deps
├── swift.yaml
├── vm_with_cinder.yaml
└── zun
│ └── webapp.yaml
├── jeos
├── CentOS-6.3-x86_64-cfntools.tdl
├── U10-amd64-cfntools.tdl
├── U12.10-amd64-cfntools.tdl
└── U12.10-i386-cfntools.tdl
├── openshift-origin
├── F19
│ ├── README.rst
│ ├── aws-template
│ │ ├── README.rst
│ │ └── openshift.template
│ ├── elements
│ │ ├── heat-cfntools
│ │ │ └── install.d
│ │ │ │ └── 05-heat-cfntools
│ │ ├── openshift-origin-broker
│ │ │ ├── README.md
│ │ │ ├── element-deps
│ │ │ └── install.d
│ │ │ │ └── 30-openshift-origin-broker
│ │ └── openshift-origin-node
│ │ │ ├── README.md
│ │ │ ├── element-deps
│ │ │ └── install.d
│ │ │ └── 30-openshift-origin-node
│ └── hot-template
│ │ ├── README.rst
│ │ ├── openshift-scalable-cpu-nbgears
│ │ ├── nodeinstance.yaml
│ │ └── openshift.yaml
│ │ ├── openshift-scalable-cpu
│ │ ├── nodeinstance.yaml
│ │ └── openshift.yaml
│ │ ├── openshift-scalable-nbgears
│ │ ├── nodeinstance.yaml
│ │ └── openshift.yaml
│ │ └── openshift
│ │ └── openshift.yaml
└── centos65
│ ├── OpenShift-1B1N.yaml
│ ├── OpenShift.yaml
│ ├── README.rst
│ └── highly-available
│ ├── README.md
│ └── invalid
│ ├── oso_ha.yaml
│ ├── oso_ha_env.yaml
│ ├── oso_node.yaml
│ └── oso_node_env.yaml
├── playbooks
└── devstack
│ └── run.yaml
├── roles
└── run-heat-template-check
│ ├── defaults
│ └── main.yaml
│ └── tasks
│ └── main.yaml
├── setup.cfg
└── tools
├── cfn-json2yaml
├── fetch-cloudformation-examples
├── heat-jeos.sh
├── post_test_hook.sh
└── validate-templates
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *.swp
3 | *~
4 | cfn/cloudformation-examples/
5 | private
6 |
--------------------------------------------------------------------------------
/.gitreview:
--------------------------------------------------------------------------------
1 | [gerrit]
2 | host=review.opendev.org
3 | port=29418
4 | project=openstack/heat-templates.git
5 |
--------------------------------------------------------------------------------
/.yamllint:
--------------------------------------------------------------------------------
1 | ---
2 | extends: default
3 | rules:
4 | braces: {min-spaces-inside: 0, max-spaces-inside: 1}
5 | brackets: {min-spaces-inside: 0, max-spaces-inside: 1}
6 | comments: disable
7 | comments-indentation: disable
8 | document-start: disable
9 | indentation: disable
10 | line-length: disable
11 |
--------------------------------------------------------------------------------
/.zuul.yaml:
--------------------------------------------------------------------------------
1 | - job:
2 | name: heat-templates-check
3 | parent: devstack
4 | run: playbooks/devstack/run.yaml
5 | timeout: 7500
6 | required-projects:
7 | - opendev.org/openstack/heat
8 | - opendev.org/openstack/heat-agents
9 | - opendev.org/openstack/heat-templates
10 | roles:
11 | - zuul: opendev.org/openstack/devstack
12 | vars:
13 | devstack_services:
14 | s-account: false
15 | s-container: false
16 | s-object: false
17 | s-proxy: false
18 | devstack_plugins:
19 | heat: https://opendev.org/openstack/heat
20 | devstack_local_conf:
21 | post-config:
22 | $HEAT_CONF:
23 | DEFAULT:
24 | convergence_engine: true
25 | logging_exception_prefix: "%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s"
26 | heat_api:
27 | workers: 2
28 | heat_api_cfn:
29 | workers: 2
30 | cache:
31 | enabled: True
32 | eventlet_opts:
33 | client_socket_timeout: 120
34 | oslo_messaging_notifications:
35 | driver: messagingv2
36 | test_results_stage_name: test_results
37 | zuul_copy_output:
38 | '{{ stage_dir }}/{{ test_results_stage_name }}.subunit': logs
39 | '{{ stage_dir }}/{{ test_results_stage_name }}.html': logs
40 | '{{ stage_dir }}/stackviz': logs
41 | extensions_to_txt:
42 | conf: true
43 | log: true
44 | yaml: true
45 | yml: true
46 | irrelevant-files:
47 | - ^.*\.rst$
48 | - ^doc/.*$
49 |
50 | - project:
51 | check:
52 | jobs:
53 | - heat-templates-check
54 | # This is added to merge *.rst only changes
55 | - noop
56 | gate:
57 | jobs:
58 | - heat-templates-check
59 | - noop
60 |
--------------------------------------------------------------------------------
/CONTRIBUTING.rst:
--------------------------------------------------------------------------------
1 | The source repository for this project can be found at:
2 |
3 | https://opendev.org/openstack/heat-templates
4 |
5 | Pull requests submitted through GitHub are not monitored.
6 |
7 | To start contributing to OpenStack, follow the steps in the contribution guide
8 | to set up and use Gerrit:
9 |
10 | https://docs.openstack.org/contributors/code-and-documentation/quick-start.html
11 |
12 | Bugs should be filed on Storyboard,:
13 |
14 | https://storyboard.openstack.org/#!/project/openstack/heat-templates
15 |
16 | For more specific information about contributing to this repository, see the
17 | heat-templates contributor guide:
18 |
19 | https://opendev.org/openstack/heat-templates/src/branch/master/doc/source/contributor/contributing.rst
20 |
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | ========================
2 | Team and repository tags
3 | ========================
4 |
5 | .. image:: https://governance.openstack.org/tc/badges/heat-templates.svg
6 | :target: https://governance.openstack.org/tc/reference/tags/index.html
7 |
8 | .. Change things from this point on
9 |
10 | ==============
11 | Heat Templates
12 | ==============
13 |
14 | Heat is a service to orchestrate multiple composite cloud applications using
15 | templates
16 |
17 | This repository provides:
18 |
19 | * Example templates which demonstrate core Heat functionality
20 | * Related image-building templates
21 | * Template-related scripts and conversion tools
22 |
23 | ============================
24 | Software configuration hooks
25 | ============================
26 |
27 |
28 | All hooks (heat agents) in heat-templates repository are removed,
29 | please use hooks in `heat-agents https://opendev.org/openstack/heat-agents` instead.
30 | Here is document entry for heat-agents: `https://docs.openstack.org/heat-agents/latest/`
31 |
--------------------------------------------------------------------------------
/cfn/F17/InstanceGroup.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 |
4 | "Description" : "Template to create multiple instances.",
5 |
6 | "Parameters" : {
7 | "KeyName" : {
8 | "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
9 | "Type" : "String"
10 | },
11 | "InstanceType" : {
12 | "Description" : "Instance type",
13 | "Type" : "String",
14 | "Default" : "m1.small",
15 | "AllowedValues" : [ "m1.tiny", "m1.small", "m1.medium", "m1.large", "m1.xlarge" ],
16 | "ConstraintDescription" : "must be a valid EC2 instance type."
17 | },
18 | "ImageId" : {
19 | "Description" : "Name of the image to use",
20 | "Type" : "String",
21 | "Default" : "F17-x86_64-cfntools"
22 | },
23 | "NumInstances": {
24 | "Default": "1",
25 | "MinValue": "1",
26 | "MaxValue": "100",
27 | "Description" : "Number of instances to create",
28 | "Type": "Number"
29 | }
30 | },
31 |
32 | "Resources" : {
33 | "JobServerGroup" : {
34 | "Type" : "OS::Heat::InstanceGroup",
35 | "Properties" : {
36 | "LaunchConfigurationName" : { "Ref" : "JobServerConfig" },
37 | "Size" : {"Ref": "NumInstances"},
38 | "AvailabilityZones" : { "Fn::GetAZs" : "" }
39 | }
40 | },
41 |
42 | "JobServerConfig" : {
43 | "Type" : "AWS::AutoScaling::LaunchConfiguration",
44 | "Properties": {
45 | "ImageId" : { "Ref" : "ImageId" },
46 | "InstanceType" : { "Ref" : "InstanceType" },
47 | "KeyName" : { "Ref" : "KeyName" },
48 | "NovaSchedulerHints": [ {"Key": "part", "Value": "long"},
49 | {"Key": "ready", "Value": "short"} ],
50 | "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
51 | "#!/bin/bash -v\n"
52 | ]]}}
53 | }
54 | }
55 | },
56 |
57 | "Outputs": {
58 | "ServerGroupAddresses": {
59 | "Value": { "Fn::GetAtt": ["JobServerGroup", "InstanceList"] },
60 | "Description": "IP Address of instances."
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/cfn/F17/Neutron.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 |
4 | "Description" : "Template to test Neutron resources",
5 |
6 | "Parameters" : {
7 |
8 | },
9 |
10 | "Resources" : {
11 | "network": {
12 | "Type": "OS::Neutron::Net",
13 | "Properties": {
14 | "name": "the_network"
15 | }
16 | },
17 | "unnamed_network": {
18 | "Type": "OS::Neutron::Net"
19 | },
20 | "admin_down_network": {
21 | "Type": "OS::Neutron::Net",
22 | "Properties": {
23 | "admin_state_up": false
24 | }
25 | },
26 |
27 | "subnet": {
28 | "Type": "OS::Neutron::Subnet",
29 | "Properties": {
30 | "network_id": { "Ref" : "network" },
31 | "ip_version": 4,
32 | "cidr": "10.0.3.0/24",
33 | "allocation_pools": [{"start": "10.0.3.20", "end": "10.0.3.150"}]
34 | }
35 | },
36 |
37 | "port": {
38 | "Type": "OS::Neutron::Port",
39 | "Properties": {
40 | "device_id": "d6b4d3a5-c700-476f-b609-1493dd9dadc0",
41 | "name": "port1",
42 | "network_id": { "Ref" : "network" },
43 | "fixed_ips": [{
44 | "subnet_id": { "Ref" : "subnet" },
45 | "ip_address": "10.0.3.21"
46 | }]
47 | }
48 | },
49 |
50 | "router": {
51 | "Type": "OS::Neutron::Router"
52 | },
53 |
54 | "router_interface": {
55 | "Type": "OS::Neutron::RouterInterface",
56 | "Properties": {
57 | "router_id": { "Ref" : "router" },
58 | "subnet_id": { "Ref" : "subnet" }
59 | }
60 | }
61 | },
62 | "Outputs" : {
63 | "the_network_status" : {
64 | "Value" : { "Fn::GetAtt" : [ "network", "status" ]},
65 | "Description" : "Status of network"
66 | },
67 | "port_device_owner" : {
68 | "Value" : { "Fn::GetAtt" : [ "port", "device_owner" ]},
69 | "Description" : "Device owner of the port"
70 | },
71 | "port_fixed_ips" : {
72 | "Value" : { "Fn::GetAtt" : [ "port", "fixed_ips" ]},
73 | "Description" : "Fixed IPs of the port"
74 | },
75 | "port_mac_address" : {
76 | "Value" : { "Fn::GetAtt" : [ "port", "mac_address" ]},
77 | "Description" : "MAC address of the port"
78 | },
79 | "port_status" : {
80 | "Value" : { "Fn::GetAtt" : [ "port", "status" ]},
81 | "Description" : "Status of the port"
82 | },
83 | "port_show" : {
84 | "Value" : { "Fn::GetAtt" : [ "port", "show" ]},
85 | "Description" : "All attributes for port"
86 | },
87 | "subnet_show" : {
88 | "Value" : { "Fn::GetAtt" : [ "subnet", "show" ]},
89 | "Description" : "All attributes for subnet"
90 | },
91 | "network_show" : {
92 | "Value" : { "Fn::GetAtt" : [ "network", "show" ]},
93 | "Description" : "All attributes for network"
94 | },
95 | "router_show" : {
96 | "Value" : { "Fn::GetAtt" : [ "router", "show" ]},
97 | "Description" : "All attributes for router"
98 | }
99 | }
100 | }
--------------------------------------------------------------------------------
/cfn/F17/Neutron.yaml:
--------------------------------------------------------------------------------
1 | HeatTemplateFormatVersion: '2012-12-12'
2 | Description: Template to test Neutron resources
3 | Resources:
4 | network:
5 | Type: OS::Neutron::Net
6 | Properties: {name: the_network}
7 | unnamed_network:
8 | Type: 'OS::Neutron::Net'
9 | admin_down_network:
10 | Type: OS::Neutron::Net
11 | Properties: {admin_state_up: false}
12 | subnet:
13 | Type: OS::Neutron::Subnet
14 | Properties:
15 | network_id: {Ref: network}
16 | ip_version: 4
17 | cidr: 10.0.3.0/24
18 | allocation_pools:
19 | - {end: 10.0.3.150, start: 10.0.3.20}
20 | port:
21 | Type: OS::Neutron::Port
22 | Properties:
23 | device_id: d6b4d3a5-c700-476f-b609-1493dd9dadc0
24 | name: port1
25 | network_id: {Ref: network}
26 | fixed_ips:
27 | - subnet_id: {Ref: subnet}
28 | ip_address: 10.0.3.21
29 | router:
30 | Type: 'OS::Neutron::Router'
31 | router_interface:
32 | Type: OS::Neutron::RouterInterface
33 | Properties:
34 | router_id: {Ref: router}
35 | subnet_id: {Ref: subnet}
36 | Outputs:
37 | the_network_status:
38 | Value:
39 | Fn::GetAtt: [network, status]
40 | Description: Status of network
41 | port_device_owner:
42 | Value:
43 | Fn::GetAtt: [port, device_owner]
44 | Description: Device owner of the port
45 | port_fixed_ips:
46 | Value:
47 | Fn::GetAtt: [port, fixed_ips]
48 | Description: Fixed IPs of the port
49 | port_mac_address:
50 | Value:
51 | Fn::GetAtt: [port, mac_address]
52 | Description: MAC address of the port
53 | port_status:
54 | Value:
55 | Fn::GetAtt: [port, status]
56 | Description: Status of the port
57 | port_show:
58 | Value:
59 | Fn::GetAtt: [port, show]
60 | Description: All attributes for port
61 | subnet_show:
62 | Value:
63 | Fn::GetAtt: [subnet, show]
64 | Description: All attributes for subnet
65 | network_show:
66 | Value:
67 | Fn::GetAtt: [network, show]
68 | Description: All attributes for network
69 | router_show:
70 | Value:
71 | Fn::GetAtt: [router, show]
72 | Description: All attributes for router
73 |
--------------------------------------------------------------------------------
/cfn/F17/Neutron_floating.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 |
4 | "Description" : "Template to test Neutron resources",
5 |
6 | "Parameters" : {
7 |
8 | "external_network" : {
9 | "Description" : "UUID of an existing external network",
10 | "Type" : "String"
11 | },
12 | "internal_network" : {
13 | "Description" : "UUID of an existing internal network",
14 | "Type" : "String"
15 | },
16 | "internal_subnet" : {
17 | "Description" : "UUID of an existing internal subnet",
18 | "Type" : "String"
19 | }
20 | },
21 |
22 | "Resources" : {
23 |
24 | "port_floating": {
25 | "Type": "OS::Neutron::Port",
26 | "Properties": {
27 | "network_id": { "Ref" : "internal_network" },
28 | "fixed_ips": [{
29 | "subnet_id": { "Ref" : "internal_subnet" },
30 | "ip_address": "10.0.0.10"
31 | }]
32 | }
33 | },
34 |
35 | "floating_ip": {
36 | "Type": "OS::Neutron::FloatingIP",
37 | "Properties": {
38 | "floating_network_id": { "Ref" : "external_network" }
39 | }
40 | },
41 |
42 | "floating_ip_assoc": {
43 | "Type": "OS::Neutron::FloatingIPAssociation",
44 | "Properties": {
45 | "floatingip_id": { "Ref" : "floating_ip" },
46 | "port_id": { "Ref" : "port_floating" }
47 | }
48 | }
49 | },
50 | "Outputs" : {
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/cfn/F17/S3_Single_Instance.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 |
4 | "Description" : "Template to test S3 Bucket resources",
5 |
6 | "Resources" : {
7 | "S3BucketWebsite" : {
8 | "Type" : "AWS::S3::Bucket",
9 | "DeletionPolicy" : "Delete",
10 | "Properties" : {
11 | "AccessControl" : "PublicRead",
12 | "WebsiteConfiguration" : {
13 | "IndexDocument" : "index.html",
14 | "ErrorDocument" : "error.html"
15 | }
16 | }
17 | },
18 | "S3Bucket" : {
19 | "Type" : "AWS::S3::Bucket",
20 | "Properties" : {
21 | "AccessControl" : "Private"
22 | }
23 | }
24 | },
25 |
26 | "Outputs" : {
27 | "WebsiteURL" : {
28 | "Value" : { "Fn::GetAtt" : [ "S3Bucket", "WebsiteURL" ] },
29 | "Description" : "URL for website hosted on S3"
30 | },
31 | "DomainName" : {
32 | "Value" : { "Fn::GetAtt" : [ "S3Bucket", "DomainName" ] },
33 | "Description" : "Domain of S3 host"
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/cfn/F17/Swift.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 |
4 | "Description" : "Template to test OS::Swift::Container resources",
5 |
6 | "Resources" : {
7 | "SwiftContainerWebsite" : {
8 | "Type" : "OS::Swift::Container",
9 | "DeletionPolicy" : "Delete",
10 | "Properties" : {
11 | "X-Container-Read" : ".r:*",
12 | "X-Container-Meta" : {
13 | "Web-Index" : "index.html",
14 | "Web-Error" : "error.html"
15 | }
16 | }
17 | },
18 | "SwiftContainer" : {
19 | "Type" : "OS::Swift::Container",
20 | "Properties" : {
21 | }
22 | }
23 | },
24 |
25 | "Outputs" : {
26 | "WebsiteURL" : {
27 | "Value" : { "Fn::GetAtt" : [ "SwiftContainer", "WebsiteURL" ] },
28 | "Description" : "URL for website hosted on S3"
29 | },
30 | "DomainName" : {
31 | "Value" : { "Fn::GetAtt" : [ "SwiftContainer", "DomainName" ] },
32 | "Description" : "Domain of Swift host"
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/cfn/F17/getting_started.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 | "Parameters" : {
4 | "KeyName" : {
5 | "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
6 | "Type" : "String"
7 | }
8 | },
9 |
10 | "Resources" : {
11 | "MyInstance" : {
12 | "Type" : "AWS::EC2::Instance",
13 | "Properties" : {
14 | "KeyName" : { "Ref" : "KeyName" },
15 | "ImageId" : "F17-x86_64-cfntools",
16 | "InstanceType": "m1.small",
17 | "UserData" : { "Fn::Base64" : "80" }
18 | }
19 | }
20 | },
21 | "Outputs" : {
22 | "InstanceIp" : {
23 | "Value" : { "Fn::Join" : ["", ["ssh ec2-user@",
24 | {"Fn::GetAtt": ["MyInstance",
25 | "PublicIp"]}]]},
26 | "Description" : "My ssh command"
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/cfn/aws_asg.template:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion" : "2010-09-09",
3 |
4 | "Description" : "This is a very simple template that illustrates the basic features of an AWS::AutoScaling::AutoScalingGroup. By virtue of its simplicity this example should be usable in many contexts. In particular, this example does not require Neutron nor any particular support for software in the VMs. In fact, the VMs in this example do not actually do anything. This example does no automatic scaling, but does discuss manual scaling. For a more complete example, see autoscaling.yaml.",
5 |
6 | "Parameters" : {
7 | "KeyName" : {
8 | "Type" : "String",
9 | "Description" : "Name of an existing key pair to use for the instances"
10 | },
11 | "Flavor" : {
12 | "Type" : "String",
13 | "Description" : "Flavor for the instances to be created",
14 | "Default" : "m1.small"
15 | },
16 | "Image" : {
17 | "Type" : "String",
18 | "Description" : "Name or ID of the image to use for the instances. You can get Fedora 20 images with cloud-init from http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2 . There is also http://cloud.fedoraproject.org/fedora-20.i386.qcow2 . Any image should work since this template does not ask the VMs to do anything."
19 | }
20 | },
21 |
22 | "Resources" : {
23 | "ASG" : {
24 | "Type" : "AWS::AutoScaling::AutoScalingGroup",
25 | "Properties" : {
26 | "AvailabilityZones" : {"Fn::GetAZs": ""},
27 | "LaunchConfigurationName" : {"Ref": "LaunchConfig"},
28 | "MinSize" : 1,
29 | "DesiredCapacity" : 3,
30 | "MaxSize" : 5
31 | }
32 | },
33 |
34 | "LaunchConfig" : {
35 | "Type" : "AWS::AutoScaling::LaunchConfiguration",
36 | "Properties" : {
37 | "ImageId" : {"Ref": "Image"},
38 | "InstanceType" : {"Ref": "Flavor"},
39 | "KeyName" : { "Ref": "KeyName" }
40 | }
41 | },
42 |
43 | "ScaleUpPolicy" : {
44 | "Type" : "AWS::AutoScaling::ScalingPolicy",
45 | "Properties" : {
46 | "AdjustmentType": "ChangeInCapacity",
47 | "AutoScalingGroupName" : {"Ref": "ASG"},
48 | "Cooldown": 60,
49 | "ScalingAdjustment": 1
50 | }
51 | },
52 |
53 | "ScaleDnPolicy" : {
54 | "Type" : "AWS::AutoScaling::ScalingPolicy",
55 | "Properties" : {
56 | "AdjustmentType" : "ChangeInCapacity",
57 | "AutoScalingGroupName" : {"Ref": "ASG"},
58 | "Cooldown": 60,
59 | "ScalingAdjustment": -1
60 | }
61 | }
62 | },
63 |
64 | "Outputs" : {
65 | "scale_up_url" : {
66 | "Description" : "This URL is the webhook to scale up the group. You can invoke the scale-up operation by doing an HTTP POST to this URL; no body nor extra headers are needed.",
67 | "Value" : {"Fn::GetAtt": ["ScaleUpPolicy", "AlarmUrl"]}
68 | },
69 | "scale_dn_url" : {
70 | "Description" : "This URL is the webhook to scale down the group. You can invoke the scale-dwon operation by doing an HTTP POST to this URL; no body nor extra headers are needed.",
71 | "Value" : {"Fn::GetAtt": ["ScaleDnPolicy", "AlarmUrl"]}
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/doc/source/contributor/contributing.rst:
--------------------------------------------------------------------------------
1 | ============================
2 | So You Want to Contribute...
3 | ============================
4 | For general information on contributing to OpenStack, please check out the
5 | `contributor guide `_ to get started.
6 | It covers all the basics that are common to all OpenStack projects: the accounts
7 | you need, the basics of interacting with our Gerrit review system, how we
8 | communicate as a community, etc.
9 | Below will cover the more project specific information you need to get started
10 | with heat-templates.
11 |
12 | Communication
13 | ~~~~~~~~~~~~~
14 | * IRC channel #heat at OFTC
15 | * Mailing list (prefix subjects with ``[heat]`` for faster responses)
16 | http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-discuss
17 |
18 | Contacting the Core Team
19 | ~~~~~~~~~~~~~~~~~~~~~~~~
20 | Please refer the `heat-templates Core Team
21 | `_ contacts.
22 |
23 | New Feature Planning
24 | ~~~~~~~~~~~~~~~~~~~~
25 | heat-templates features are tracked on `Storyboard `_.
26 | Please specify the reported story with `heat-templates`.
27 |
28 | Task Tracking
29 | ~~~~~~~~~~~~~
30 | We track our tasks in `Storyboard `_.
31 | Please specify the reported story with `heat-templates`.
32 |
33 | Reporting a Bug
34 | ~~~~~~~~~~~~~~~
35 | You found an issue and want to make sure we are aware of it? You can do so on
36 | `Storyboard `_.
37 | Please specify the reported story with `heat-templates`.
38 |
39 | Getting Your Patch Merged
40 | ~~~~~~~~~~~~~~~~~~~~~~~~~
41 | All changes proposed to the heat-templates project require one or two +2 votes
42 | from heat-templates core reviewers before one of the core reviewers can approve
43 | patch by giving ``Workflow +1`` vote.
44 |
45 | Project Team Lead Duties
46 | ~~~~~~~~~~~~~~~~~~~~~~~~
47 | All common PTL duties are enumerated in the `PTL guide
48 | `_.
49 |
--------------------------------------------------------------------------------
/hot/F18/NovaInstanceWithCinderVolume_Native.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | A template showing how to create a Nova instance, a Cinder volume and attach
5 | the volume to the instance. The template uses only Heat OpenStack native
6 | resource types.
7 |
8 | parameters:
9 | key_name:
10 | type: string
11 | description:
12 | Name of an existing key pair to enable SSH access to the instance.
13 | instance_type:
14 | type: string
15 | description: Type of the instance to be created.
16 | default: m1.small
17 | constraints:
18 | - allowed_values: [m1.small, m1.medium, m1.large]
19 | description:
20 | Value must be one of 'm1.small', 'm1.medium' or 'm1.large'.
21 | image_id:
22 | type: string
23 | description: ID of the image to use for the instance to be created.
24 | default: F18-x86_64-cfntools
25 | constraints:
26 | - allowed_values: [ F18-i386-cfntools, F18-x86_64-cfntools ]
27 | description:
28 | Image ID must be either F18-i386-cfntools or F18-x86_64-cfntools.
29 | availability_zone:
30 | type: string
31 | description: The Availability Zone to launch the instance.
32 | default: nova
33 | volume_size:
34 | type: number
35 | description: Size of the volume to be created.
36 | default: 1
37 | constraints:
38 | - range: { min: 1, max: 1024 }
39 | description: must be between 1 and 1024 Gb.
40 | resources:
41 | nova_instance:
42 | type: OS::Nova::Server
43 | properties:
44 | availability_zone: { get_param: availability_zone }
45 | image: { get_param: image_id }
46 | flavor: { get_param: instance_type }
47 | key_name: { get_param: key_name }
48 | cinder_volume:
49 | type: OS::Cinder::Volume
50 | properties:
51 | size: { get_param: volume_size }
52 | availability_zone: { get_param: availability_zone }
53 | volume_attachment:
54 | type: OS::Cinder::VolumeAttachment
55 | properties:
56 | volume_id: { get_resource: cinder_volume }
57 | instance_uuid: { get_resource: nova_instance }
58 | mountpoint: /dev/vdc
59 | outputs:
60 | instance_ip:
61 | description: Public IP address of the newly created Nova instance.
62 | value: { get_attr: [nova_instance, first_address] }
63 |
--------------------------------------------------------------------------------
/hot/Windows/ActiveDirectoryController/ActiveDirectoryDomainController.ps1:
--------------------------------------------------------------------------------
1 | #ps1_sysnative
2 |
3 | # Copyright 2016 Cloudbase Solutions Srl
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 | # not use this file except in compliance with the License. You may obtain
7 | # a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | # License for the specific language governing permissions and limitations
15 | # under the License.
16 |
17 | $ErrorActionPreference = 'Stop'
18 |
19 | $moduleName = "AD.psm1"
20 | $cfnFolder = "C:\cfn"
21 | $modulePath = Join-Path $cfnFolder $moduleName
22 | Import-Module -Name $modulePath -DisableNameChecking -Force
23 |
24 |
25 | $safeModePwd = "safe_mode_administrator_password"
26 | $DomainName = "domain_name"
27 | $DomainNetbiosName = "domain_netbios_name"
28 | $ADWaitConditionEndpoint = "ad_wait_condition_endpoint"
29 | $ADWaitConditionToken = "ad_wait_condition_token"
30 |
31 | Install-ActiveDirectoryDomainController -SafeModePwd $safeModePwd `
32 | -DomainName $DomainName `
33 | -DomainNetbiosName $DomainNetbiosName `
34 | -ADWaitConditionEndpoint $ADWaitConditionEndpoint `
35 | -ADWaitConditionToken $ADWaitConditionToken
36 |
37 |
--------------------------------------------------------------------------------
/hot/Windows/IIS_Drupal/IIS_Drupal.ps1:
--------------------------------------------------------------------------------
1 | #ps1_sysnative
2 |
3 | <#
4 | Copyright 2014 Cloudbase Solutions Srl
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License");
7 | you may not use this file except in compliance with the License.
8 | You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS,
14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | See the License for the specific language governing permissions and
16 | limitations under the License.
17 | #>
18 |
19 | $ErrorActionPreference = 'Stop'
20 |
21 | $cfnFolder = Join-Path $env:SystemDrive "cfn"
22 | $moduleName = "IIS_Drupal.psm1"
23 | $modulePath = Join-Path $cfnFolder $moduleName
24 | Import-Module -Name $modulePath -DisableNameChecking
25 |
26 | $parameters = @{
27 | 'ENDPOINT' = 'wait_handle_endpoint';
28 | 'TOKEN' = 'wait_handle_token';
29 | 'SA_PASS' = 'sa_password';
30 | 'ADMIN_USER' = 'admin_username';
31 | 'ADMIN_PASS' = 'admin_password';
32 | 'ADMIN_EMAIL' = 'admin_email';
33 | 'SITE_NAME' = 'website_name'
34 | }
35 |
36 | Initialize-Server $parameters
37 |
--------------------------------------------------------------------------------
/hot/Windows/MSSQLServer/MSSQL.ps1:
--------------------------------------------------------------------------------
1 | #ps1_sysnative
2 |
3 | # Copyright 2014 Cloudbase Solutions Srl
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 | # not use this file except in compliance with the License. You may obtain
7 | # a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | # License for the specific language governing permissions and limitations
15 | # under the License.
16 |
17 | $ErrorActionPreference = 'Stop'
18 |
19 | $moduleName = "MSSQL.psm1"
20 | $cfnFolder = "C:\cfn"
21 | $modulePath = Join-Path $cfnFolder $moduleName
22 | Import-Module -Name $modulePath -DisableNameChecking -Force
23 |
24 |
25 | $mssqlServiceUsername="mssql-service-username"
26 | $mssqlServicePassword = "mssql-service-user-password"
27 | $mssqlSaPassword = "mssql-sa-password"
28 | $mssqlFeatures = "mssql-features"
29 | $mssqlInstanceName = "mssql-instance-name"
30 | $mssqlIsoUNCPath = "mssql_iso_unc_path"
31 | $mssqlWaitConditionEndpoint = "mssql_wait_condition_endpoint"
32 | $mssqlWaitConditionToken = "mssql_wait_condition_token"
33 |
34 | Install-MSSQL -MssqlServiceUsername $mssqlServiceUsername `
35 | -MssqlServicePassword $mssqlServicePassword `
36 | -MssqlSaPassword $mssqlSaPassword `
37 | -MssqlFeatures $mssqlFeatures `
38 | -MssqlInstanceName $mssqlInstanceName `
39 | -MssqlIsoUNCPath $mssqlIsoUNCPath `
40 | -MssqlWaitConditionEndpoint $mssqlWaitConditionEndpoint `
41 | -MssqlWaitConditionToken $MssqlWaitConditionToken
--------------------------------------------------------------------------------
/hot/Windows/PuppetAgent/PuppetAgent.ps1:
--------------------------------------------------------------------------------
1 | #ps1_sysnative
2 |
3 | # Copyright 2014 Cloudbase Solutions Srl
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 | # not use this file except in compliance with the License. You may obtain
7 | # a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | # License for the specific language governing permissions and limitations
15 | # under the License.
16 |
17 | $ErrorActionPreference = 'Stop'
18 |
19 | $moduleName = "PuppetAgent.psm1"
20 | $cfnFolder = "C:\cfn"
21 | $modulePath = Join-Path $cfnFolder $moduleName
22 | Import-Module -Name $modulePath -DisableNameChecking -Force
23 |
24 | $puppetMasterServerName = "puppet_master_server_hostname"
25 | $puppetMasterServerIp = "puppet_master_server_ip_address"
26 | $puppetAgent_WaitConditionEndpoint = "puppet_agent_wait_condition_endpoint"
27 | $puppetAgent_WaitConditionToken = "puppet_agent_wait_condition_token"
28 |
29 | Install-PuppetAgent -PuppetMasterServerName $puppetMasterServerName `
30 | -PuppetMasterServerIp $puppetMasterServerIp `
31 | -PuppetAgent_WaitConditionEndpoint $puppetAgent_WaitConditionEndpoint `
32 | -PuppetAgent_WaitConditionToken $puppetAgent_WaitConditionToken
33 |
--------------------------------------------------------------------------------
/hot/Windows/PuppetAgent/Tests/PuppetAgent.Tests.ps1:
--------------------------------------------------------------------------------
1 | #ps1_sysnative
2 |
3 | <#
4 | Copyright 2014 Cloudbase Solutions Srl
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License");
7 | you may not use this file except in compliance with the License.
8 | You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS,
14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | See the License for the specific language governing permissions and
16 | limitations under the License.
17 | #>
18 |
19 | $utilsPath = (Resolve-Path '..\heat-powershell-utils.psm1').Path
20 | $modulePath = (Resolve-Path '..\PuppetAgent.psm1').Path
21 |
22 | Remove-Module PuppetAgent -ErrorAction SilentlyContinue
23 | Remove-Module heat-powershell-utils -ErrorAction SilentlyContinue
24 | Import-Module -Name $modulePath -DisableNameChecking
25 | Import-Module -Name $utilsPath -DisableNameChecking
26 |
27 | InModuleScope PuppetAgent {
28 | Describe "Install-PuppetAgent" {
29 | Context "Puppet Agent installed" {
30 | $puppetMasterServerName = "puppet_master_server_hostname"
31 | $puppetMasterServerIp = "puppet_master_server_ip_address"
32 | $puppetAgent_WaitConditionEndpoint = `
33 | "puppet_agent_wait_condition_endpoint"
34 | $puppetAgent_WaitConditionToken = `
35 | "puppet_agent_wait_condition_token"
36 |
37 | Mock Log { return 0 } -Verifiable
38 | Mock Send-HeatWaitSignal { return 0 } -Verifiable
39 | Mock Install-PuppetAgentInternal { return 0 } -Verifiable
40 |
41 | Install-PuppetAgent `
42 | -PuppetMasterServerName $puppetMasterServerName `
43 | -PuppetMasterServerIp $puppetMasterServerIp `
44 | -PuppetAgent_WaitConditionEndpoint `
45 | $puppetAgent_WaitConditionEndpoint `
46 | -PuppetAgent_WaitConditionToken $puppetAgent_WaitConditionToken
47 |
48 | It "should verify mocks called" {
49 | Assert-VerifiableMocks
50 | }
51 |
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/hot/autohealing/autohealing_group.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2017-02-24
2 |
3 | description: >
4 | A stack containing an Autoscaling Group whose members automatically heal
5 | themselves if they are stopped, deleted, or go into an error state, using an
6 | Aodh alarm delivered to a Zaqar queue that triggers a Mistral workflow to
7 | replace the stopped server. Note that this requires event alarms to be
8 | enabled in Aodh, following the instructions at
9 | https://docs.openstack.org/aodh/latest/contributor/event-alarm.html#configuration
10 | (specifically by adding the publisher "notifier://?topic=alarm.all" in
11 | /etc/ceilometer/event_pipeline.yaml).
12 |
13 | parameters:
14 | flavor:
15 | type: string
16 | description: Flavor for the instances to be created
17 | default: cirros256
18 | constraints:
19 | - custom_constraint: nova.flavor
20 | description: Must be a flavor known to Nova
21 | image:
22 | type: string
23 | description: >
24 | Name or ID of the image to use for the instances.
25 | default: cirros-0.3.4-x86_64-uec
26 | constraints:
27 | - custom_constraint: glance.image
28 | description: Must identify an image known to Glance
29 | network:
30 | type: string
31 | description: The network for the VM
32 | default: private
33 | port:
34 | type: number
35 | description: The port to reply to requests on
36 | default: 8080
37 |
38 | resources:
39 | servers:
40 | type: OS::Heat::AutoScalingGroup
41 | properties:
42 | resource:
43 | type: autohealing_server.yaml
44 | properties:
45 | flavor: {get_param: flavor}
46 | image: {get_param: image}
47 | network: {get_param: network}
48 | port: {get_param: port}
49 | root_stack_id: {get_param: "OS::stack_id"}
50 | min_size: 1
51 | desired_capacity: 2
52 | max_size: 4
53 |
54 | outputs:
55 | server_ids:
56 | description: A list of the current server UUIDs
57 | value: {get_attr: [servers, refs]}
58 | ip_addresses:
59 | description: A list of server IP addresses
60 | value: {get_attr: [servers, outputs_list, first_address]}
61 |
--------------------------------------------------------------------------------
/hot/barbican/container_generic.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | This template demostrates how to create Barbican generic container.
5 |
6 | parameters:
7 | name:
8 | description: (optional) Human readable name for the container.
9 | type: string
10 | default: test_container
11 |
12 |
13 | resources:
14 | secret:
15 | type: ./secret.yaml
16 | container:
17 | type: OS::Barbican::GenericContainer
18 | properties:
19 | name: { get_param: name }
20 | secrets:
21 | - name: test_secret
22 | ref: { get_attr: [secret, secret_ref] }
23 |
24 |
25 | outputs:
26 | container_status:
27 | description: The status of the container.
28 | value: { get_attr: [container, status] }
29 | container_ref:
30 | description: The URI to the container.
31 | value: { get_attr: [container, container_ref] }
32 | secret_refs:
33 | description: The URIs to secrets stored in container.
34 | value: { get_attr: [container, secret_refs] }
35 | consumers:
36 | description: The URIs to container consumers.
37 | value: { get_attr: [container, consumers] }
38 |
--------------------------------------------------------------------------------
/hot/barbican/order.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | This template demostrates how to create Barbican Order - resource which
5 | allows to generate some secret material.
6 |
7 | parameters:
8 | name:
9 | description: (optional) Human readable name for the generated secret.
10 | type: string
11 | default: test_order
12 | type:
13 | description: The type of the order.
14 | type: string
15 | default: key
16 | payload_content_type:
17 | description: (optional) The type/format the secret data is provided in.
18 | type: string
19 | default: application/octet-stream
20 | expiration:
21 | description: >
22 | (optional) The expiration date for the secret in ISO-8601 format.
23 | If set, the secret will not be available after this time.
24 | type: string
25 | default: 2017-12-28T19:14:44.180394
26 | algorithm:
27 | description: >
28 | (optional) The algorithm type used to generate the secret.
29 | Required for key and asymmetric types of order.
30 | type: string
31 | default: aes
32 | bit_length:
33 | description: >
34 | (optional) The bit-length of the secret.
35 | Required for key and asymmetric types of order.
36 | type: number
37 | default: 256
38 | mode:
39 | description: >
40 | (optional) The type/mode of the algorithm associated
41 | with the secret information.
42 | type: string
43 | default: cbc
44 |
45 |
46 | resources:
47 | order:
48 | type: OS::Barbican::Order
49 | properties:
50 | name: { get_param: name }
51 | type: { get_param: type }
52 | payload_content_type: { get_param: payload_content_type }
53 | expiration: { get_param: expiration }
54 | algorithm: { get_param: algorithm }
55 | bit_length: { get_param: bit_length }
56 | mode: { get_param: mode }
57 |
58 |
59 | outputs:
60 | order_status:
61 | description: The status of the order.
62 | value: { get_attr: [order, status] }
63 | order_ref:
64 | description: The URI to the order.
65 | value: { get_attr: [order, order_ref] }
66 | secret_ref:
67 | description: The URI to the created secret.
68 | value: { get_attr: [order, secret_ref] }
69 |
--------------------------------------------------------------------------------
/hot/barbican/secret.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | This template demostrates how to create Barbican secret.
5 |
6 | parameters:
7 | name:
8 | description: (optional) Human readable name for the secret.
9 | type: string
10 | default: test_secret
11 | payload:
12 | description: (optional) The unencrypted plain text of the secret.
13 | type: string
14 | default: VGVzdCBzdHJpbmcgZm9yIGJhcmJpY2FuIHNlY3JldCB0ZXN0IHRlbXBsYXRl
15 | secret_type:
16 | description: (optional) The type of the secret.
17 | type: string
18 | default: opaque
19 | payload_content_type:
20 | description: >
21 | (optional) The type/format the secret data is provided in.
22 | payload_content_type must also be supplied if payload is included.
23 | type: string
24 | default: application/octet-stream
25 | payload_content_encoding:
26 | description: >
27 | (optional) (required if payload is encoded)
28 | The encoding format used to provide the payload data.
29 | type: string
30 | default: base64
31 | expiration:
32 | description: >
33 | (optional) The expiration date for the secret in ISO-8601 format.
34 | If set, the secret will not be available after this time.
35 | type: string
36 | default: 2017-12-28T19:14:44.180394
37 | algorithm:
38 | description: (optional) The algorithm type used to generate the secret.
39 | type: string
40 | default: aes
41 | bit_length:
42 | description: (optional) The bit-length of the secret.
43 | type: number
44 | default: 256
45 | mode:
46 | description: >
47 | (optional) The type/mode of the algorithm associated
48 | with the secret information.
49 | type: string
50 | default: cbc
51 |
52 |
53 | resources:
54 | secret:
55 | type: OS::Barbican::Secret
56 | properties:
57 | name: { get_param: name }
58 | payload: { get_param: payload }
59 | secret_type: { get_param: secret_type }
60 | payload_content_type: { get_param: payload_content_type }
61 | payload_content_encoding: { get_param: payload_content_encoding }
62 | expiration: { get_param: expiration }
63 | algorithm: { get_param: algorithm }
64 | bit_length: { get_param: bit_length }
65 | mode: { get_param: mode }
66 |
67 |
68 | outputs:
69 | secret_status:
70 | description: The status of the secret.
71 | value: { get_attr: [secret, status] }
72 | secret_payload:
73 | description: The decrypted secret payload.
74 | value: { get_attr: [secret, status] }
75 | secret_ref:
76 | description: Reference for created secret.
77 | value: { get_resource: secret }
78 |
--------------------------------------------------------------------------------
/hot/blazar/blazar_host.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2018-08-31
2 |
3 | description: Sample Blazar host template
4 |
5 | parameters:
6 | name:
7 | type: string
8 | description: The name of the host
9 | default: sample_blazar_host
10 |
11 | resources:
12 | sample_host:
13 | type: OS::Blazar::Host
14 | properties:
15 | name: {get_param: name}
16 |
17 | outputs:
18 | cpu_info:
19 | value: {get_attr: [sample_host, cpu_info]}
20 | description: Information of the CPU of the host
21 |
--------------------------------------------------------------------------------
/hot/blazar/blazar_lease.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2018-08-31
2 |
3 | description: Sample Blazar lease template
4 |
5 | parameters:
6 | name:
7 | type: string
8 | description: The name of the lease
9 | default: sample_blazar_lease
10 |
11 | resources:
12 | sample_lease:
13 | type: OS::Blazar::Lease
14 | properties:
15 | name: {get_param: name}
16 | start_date: "2030-01-01 10:00"
17 | end_date: "2030-01-10 10:00"
18 | reservations:
19 | - resource_type: "physical:host"
20 | min: 4
21 | max: 6
22 | hypervisor_properties: "[\">=\", \"$vcpus\", \"4\"]"
23 | resource_properties: ""
24 | - resource_type: "virtual:instance"
25 | amount: 4
26 | vcpus: 2
27 | memory_mb: 4096
28 | disk_gb: 100
29 | affinity: false
30 |
31 | outputs:
32 | host_reservation_id:
33 | value: {get_attr: [sample_lease, reservations, 0, id]}
34 | description: ID of host reservation
35 | instance_reservation_id:
36 | value: {get_attr: [sample_lease, reservations, 1, id]}
37 | description: ID of instance reservation
38 |
--------------------------------------------------------------------------------
/hot/condition.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2017-02-24
2 | parameters:
3 | env_type:
4 | default: test
5 | type: string
6 | constraints:
7 | - allowed_values: [prod, test]
8 | zone:
9 | type: string
10 | default: beijing
11 | conditions:
12 | prod: {equals: [{get_param: env_type}, "prod"]}
13 | test:
14 | not:
15 | equals:
16 | - get_param: env_type
17 | - prod
18 | beijing_prod:
19 | and:
20 | - equals:
21 | - get_param: zone
22 | - beijing
23 | - equals:
24 | - get_param: env_type
25 | - prod
26 | xian_zone:
27 | equals:
28 | - get_param: zone
29 | - xian
30 | xianyang_zone:
31 | equals:
32 | - get_param: zone
33 | - xianyang
34 | fujian_zone:
35 | or:
36 | - equals:
37 | - get_param: zone
38 | - fuzhou
39 | - equals:
40 | - get_param: zone
41 | - xiamen
42 | fujian_prod:
43 | and:
44 | - fujian_zone
45 | - prod
46 | shannxi_province:
47 | or:
48 | - xian_zone
49 | - xianyang_zone
50 | resources:
51 | test_res:
52 | type: OS::Heat::TestResource
53 | properties:
54 | value: {if: ["prod", "env_is_prod", "env_is_test"]}
55 | prod_res:
56 | type: OS::Heat::TestResource
57 | properties:
58 | value: prod_res
59 | condition: prod
60 | test_res1:
61 | type: OS::Heat::TestResource
62 | properties:
63 | value: just in test env
64 | condition: test
65 | beijing_prod_res:
66 | type: OS::Heat::TestResource
67 | properties:
68 | value: beijing_prod_res
69 | condition: beijing_prod
70 | fujian_res:
71 | type: OS::Heat::TestResource
72 | condition: fujian_zone
73 | properties:
74 | value: fujian_res
75 | fujian_prod_res:
76 | type: OS::Heat::TestResource
77 | condition: fujian_prod
78 | properties:
79 | value: fujian_prod_res
80 | shannxi_res:
81 | type: OS::Heat::TestResource
82 | condition: shannxi_province
83 | properties:
84 | value: shannxi_res
85 | not_shannxi_res:
86 | type: OS::Heat::TestResource
87 | condition: {not: shannxi_province}
88 | properties:
89 | value: not_shannxi_res
90 | outputs:
91 | res_value:
92 | value: {get_attr: [prod_res, output]}
93 | condition: prod
94 | test_res_value:
95 | value: {get_attr: [test_res, output]}
96 | prod_resource:
97 | value: {if: [prod, {get_resource: prod_res}, 'no_prod_res']}
98 | test_res1_value:
99 | value: {if: [test, {get_attr: [test_res1, output]}, 'no_test_res1']}
100 | beijing_prod_res:
101 | value: {if: [beijing_prod, {get_resource: beijing_prod_res},
102 | 'no_prod_res']}
103 |
--------------------------------------------------------------------------------
/hot/designate/desginate_domain.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-04-30
2 |
3 | description: Sample designate domain template
4 |
5 | parameters:
6 | name:
7 | type: string
8 | description: Domain name
9 | default: test1-domain.com.
10 |
11 | email:
12 | type: string
13 | description: Domain description
14 | default: abc@xyz.com
15 |
16 | ttl:
17 | type: number
18 | description: Time to live in seconds
19 | default: 3600
20 |
21 | description:
22 | type: string
23 | description: Domain description
24 | default: Sample test domain
25 |
26 | resources:
27 | sample_domain:
28 | type: OS::Designate::Domain
29 | properties:
30 | name: {get_param: name}
31 | email: {get_param: email}
32 | ttl: {get_param: ttl}
33 | description: {get_param: description}
34 |
35 | outputs:
36 | serial:
37 | value: {get_attr: [sample_domain, serial]}
38 | description: Domain serial number
39 |
--------------------------------------------------------------------------------
/hot/designate/desginate_record.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-04-30
2 |
3 | description: >
4 | Designate sample template used to create records under the domain
5 | 'designate-example.com'. This same template can be used to create
6 | different record types supported by designate. To note, Only for
7 | MX and SRV records, priority will be considered, otherwise, it
8 | will be ignored. To findout the data format for the given record
9 | type, please refer RFC 1035.
10 |
11 | parameters:
12 | name:
13 | type: string
14 | description: Record name
15 | default: test.designate-example.com.
16 |
17 | type:
18 | type: string
19 | description: Record type
20 | default: MX
21 |
22 | ttl:
23 | type: number
24 | description: Time to live in seconds
25 | default: 3600
26 |
27 | description:
28 | type: string
29 | description: Record description
30 | default: sample dns MX record
31 |
32 | data:
33 | type: string
34 | description: Record data
35 | default: sample.mailserver.com.
36 |
37 | priority:
38 | type: number
39 | description: Record priority
40 | default: 10
41 |
42 | domain_name:
43 | type: string
44 | description: Domain id or name
45 | default: designate-example.com.
46 |
47 | domain_email:
48 | type: string
49 | description: Domain email-id
50 | default: admin@designate-example.com
51 |
52 | resources:
53 | sample_domain:
54 | type: OS::Designate::Domain
55 | properties:
56 | name: {get_param: domain_name}
57 | email: {get_param: domain_email}
58 | sample_record:
59 | type: OS::Designate::Record
60 | properties:
61 | name: {get_param: name}
62 | type: {get_param: type}
63 | description: {get_param: description}
64 | data: {get_param: data}
65 | domain: {get_resource: sample_domain}
66 | ttl: {get_param: ttl}
67 | priority: {get_param: priority}
68 |
--------------------------------------------------------------------------------
/hot/external_resource.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: newton
2 |
3 | description: >
4 | This template shows use case for external resource.
5 | external resource can be any resource (create by
6 | heat or not) that heat got type for it.
7 |
8 | parameters:
9 | external_server_id:
10 | type: string
11 | default: da5b940a-14ff-4884-8e95-5cf6a3a1028f
12 | description: ID of external server
13 |
14 | resources:
15 | external_server:
16 | type: OS::Nova::Server
17 | external_id: { get_param: external_server_id }
18 |
19 | outputs:
20 | server_address:
21 | value: { get_attr: [external_server, networks, private, 0 ] }
22 |
--------------------------------------------------------------------------------
/hot/hello_world.yaml:
--------------------------------------------------------------------------------
1 | #
2 | # This is a hello world HOT template just defining a single compute
3 | # server.
4 | #
5 | heat_template_version: 2013-05-23
6 |
7 | description: >
8 | Hello world HOT template that just defines a single server.
9 | Contains just base features to verify base HOT support.
10 |
11 | parameters:
12 | key_name:
13 | type: string
14 | description: Name of an existing key pair to use for the server
15 | constraints:
16 | - custom_constraint: nova.keypair
17 | flavor:
18 | type: string
19 | description: Flavor for the server to be created
20 | default: m1.small
21 | constraints:
22 | - custom_constraint: nova.flavor
23 | image:
24 | type: string
25 | description: Image ID or image name to use for the server
26 | constraints:
27 | - custom_constraint: glance.image
28 | admin_pass:
29 | type: string
30 | description: Admin password
31 | hidden: true
32 | constraints:
33 | - length: { min: 6, max: 8 }
34 | description: Password length must be between 6 and 8 characters
35 | - allowed_pattern: "[a-zA-Z0-9]+"
36 | description: Password must consist of characters and numbers only
37 | - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*"
38 | description: Password must start with an uppercase character
39 | db_port:
40 | type: number
41 | description: Database port number
42 | default: 50000
43 | constraints:
44 | - range: { min: 40000, max: 60000 }
45 | description: Port number must be between 40000 and 60000
46 |
47 | resources:
48 | server:
49 | type: OS::Nova::Server
50 | properties:
51 | key_name: { get_param: key_name }
52 | image: { get_param: image }
53 | flavor: { get_param: flavor }
54 | admin_pass: { get_param: admin_pass }
55 | user_data:
56 | str_replace:
57 | template: |
58 | #!/bin/bash
59 | echo db_port
60 | params:
61 | db_port: { get_param: db_port }
62 |
63 | outputs:
64 | server_networks:
65 | description: The networks of the deployed server
66 | value: { get_attr: [server, networks] }
67 |
--------------------------------------------------------------------------------
/hot/instance_group.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | description: >
3 | Template to create multiple instances.
4 |
5 | parameters:
6 | image_id:
7 | type: string
8 | description: Image used for servers
9 | key_name:
10 | type: string
11 | description: Name of SSH key to connect to the servers
12 | instance_type:
13 | type: string
14 | description: flavor used by the servers
15 | default: m1.small
16 | constraints:
17 | - custom_constraint: nova.flavor
18 | num_instances:
19 | type: number
20 | description: Number of instances to create
21 | default: 1
22 |
23 | resources:
24 | server_group:
25 | type: OS::Heat::InstanceGroup
26 | properties:
27 | LaunchConfigurationName: { get_resource: server_config }
28 | AvailabilityZones: []
29 | Size: { get_param: num_instances }
30 | server_config:
31 | type: AWS::AutoScaling::LaunchConfiguration
32 | properties:
33 | ImageId: { get_param: image_id }
34 | InstanceType: { get_param: instance_type}
35 | KeyName: { get_param: key_name }
36 |
37 | outputs:
38 | server_group_addresses:
39 | value: { get_attr: [server_group, InstanceList] }
40 |
--------------------------------------------------------------------------------
/hot/keystone/keystone.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone template
4 |
5 | resources:
6 | test_role_a:
7 | type: OS::Keystone::Role
8 | properties:
9 | name: test_role_a
10 |
11 | test_project_a:
12 | type: OS::Keystone::Project
13 | properties:
14 | name: test_project_a
15 | domain: default
16 | description: Test project
17 | enabled: true
18 |
19 | test_group_a:
20 | type: OS::Keystone::Group
21 | properties:
22 | name: test_group_a
23 | domain: default
24 | description: Test group
25 | roles:
26 | - role: {get_resource: test_role_a}
27 | domain: default
28 | - role: {get_resource: test_role_a}
29 | project: {get_resource: test_project_a}
30 |
31 | test_user_a:
32 | type: OS::Keystone::User
33 | properties:
34 | name: test_user_a
35 | domain: default
36 | description: Test user
37 | enabled: true
38 | email: abc@xyz.com
39 | password: password
40 | default_project: {get_resource: test_project_a}
41 | groups:
42 | - {get_resource: test_group_a}
43 | roles:
44 | - role: {get_resource: test_role_a}
45 | domain: default
46 | - role: {get_resource: test_role_a}
47 | project: {get_resource: test_project_a}
48 |
49 | outputs:
50 | test_user_a_id:
51 | value: {get_resource: test_user_a}
52 | test_group_a_id:
53 | value: {get_resource: test_group_a}
54 | test_project_a_id:
55 | value: {get_resource: test_project_a}
56 | test_role_a_id:
57 | value: {get_resource: test_role_a}
58 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_domain.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2017-02-24
2 |
3 | description: Sample Keystone Domain template
4 |
5 | parameters:
6 | domain_name:
7 | type: string
8 | description: Keystone domain name
9 | domain_description:
10 | type: string
11 | description: Keystone domain description
12 | default: sample domain
13 | domain_enabled:
14 | type: boolean
15 | description: Keystone domain is enabled or disabled
16 | default: True
17 |
18 | resources:
19 | domain:
20 | type: OS::Keystone::Domain
21 | properties:
22 | name: {get_param: domain_name}
23 | description: {get_param: domain_description}
24 | enabled: {get_param: domain_enabled}
25 |
26 | outputs:
27 | domain_id:
28 | value: {get_resource: domain}
29 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_group.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone Group template
4 |
5 | parameters:
6 | group_name:
7 | type: string
8 | description: Keystone group name
9 | group_description:
10 | type: string
11 | description: Keystone group description
12 | group_domain:
13 | type: string
14 | description: Keystone group domain name
15 | group_role:
16 | type: string
17 | description: role
18 | group_role_domain:
19 | type: string
20 | description: group role domain
21 | group_role_project:
22 | type: string
23 | description: group role project
24 |
25 |
26 | resources:
27 | admin_group:
28 | type: OS::Keystone::Group
29 | properties:
30 | name: {get_param: group_name}
31 | domain: {get_param: group_domain}
32 | description: {get_param: group_description}
33 | roles:
34 | - role: {get_param: group_role}
35 | domain: {get_param: group_role_domain}
36 | - role: {get_param: group_role}
37 | project: {get_param: group_role_project}
38 |
39 | outputs:
40 | admin_group_id:
41 | value: {get_resource: admin_group}
42 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_project.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone Project template
4 |
5 | parameters:
6 | project_name:
7 | type: string
8 | description: Keystone project name
9 | project_description:
10 | type: string
11 | description: Keystone project description
12 | project_enabled:
13 | type: boolean
14 | description: Keystone project is enabled or disabled
15 | project_domain:
16 | type: string
17 | description: Keystone project domain name
18 |
19 | resources:
20 | admin_project:
21 | type: OS::Keystone::Project
22 | properties:
23 | name: {get_param: project_name}
24 | domain: {get_param: project_domain}
25 | description: {get_param: project_description}
26 | enabled: {get_param: project_enabled}
27 | outputs:
28 | admin_project_id:
29 | value: {get_resource: admin_project}
30 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_region.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-10-15
2 |
3 | description: Sample Keystone Region template
4 |
5 | parameters:
6 | region_id:
7 | type: string
8 | description: Keystone region id
9 | region_description:
10 | type: string
11 | description: Keystone region description
12 | default: sample region
13 | region_enabled:
14 | type: boolean
15 | description: Keystone region is enabled or disabled
16 | default: True
17 | parent_region_id:
18 | type: string
19 | description: Keystone region parent
20 |
21 | resources:
22 | parent_region:
23 | type: OS::Keystone::Region
24 | properties:
25 | id: {get_param: parent_region_id}
26 | description: {get_param: region_description}
27 | enabled: {get_param: region_enabled}
28 | child_region:
29 | type: OS::Keystone::Region
30 | properties:
31 | id: {get_param: region_id}
32 | parent_region: {get_resource: parent_region}
33 | description: {get_param: region_description}
34 | enabled: {get_param: region_enabled}
35 |
36 | outputs:
37 | parent_region_id:
38 | value: {get_resource: parent_region}
39 | child_region_id:
40 | value: {get_resource: child_region}
41 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_role.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone Role template
4 |
5 | parameters:
6 | role_name:
7 | type: string
8 | description: Keystone role name
9 |
10 | resources:
11 | sample_role:
12 | type: OS::Keystone::Role
13 | properties:
14 | name: {get_param: role_name}
15 |
16 | outputs:
17 | sample_role_id:
18 | value: {get_resource: sample_role}
19 | description: Sample keystone role identifier
20 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_service.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone Service template
4 |
5 | parameters:
6 | name:
7 | type: string
8 | description: Keystone service name
9 | description:
10 | type: string
11 | description: Keystone service description
12 | type:
13 | type: string
14 | description: Keystone service type
15 |
16 | resources:
17 | sample_service:
18 | type: OS::Keystone::Service
19 | properties:
20 | name: {get_param: name}
21 | type: {get_param: type}
22 | description: {get_param: description}
23 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_service_endpoint.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone Service Endpoint template
4 |
5 | parameters:
6 | name:
7 | type: string
8 | description: Keystone service name
9 | description:
10 | type: string
11 | description: Keystone service description
12 | type:
13 | type: string
14 | description: Keystone service type
15 | region:
16 | type: string
17 | description: Keystone region name
18 | public_url:
19 | type: string
20 | description: Public endpoint url
21 | internal_url:
22 | type: string
23 | description: Internal endpoint url
24 | admin_url:
25 | type: string
26 | description: Admin endpoint url
27 |
28 | resources:
29 | sample_service:
30 | type: OS::Keystone::Service
31 | properties:
32 | name: {get_param: name}
33 | type: {get_param: type}
34 | description: {get_param: description}
35 |
36 | public_endpoint:
37 | type: OS::Keystone::Endpoint
38 | properties:
39 | service: {get_resource: sample_service}
40 | url: {get_param: public_url}
41 | region: {get_param: region}
42 | interface: public
43 |
44 | internal_endpoint:
45 | type: OS::Keystone::Endpoint
46 | properties:
47 | service: {get_resource: sample_service}
48 | url: {get_param: internal_url}
49 | region: {get_param: region}
50 | interface: internal
51 |
52 | admin_endpoint:
53 | type: OS::Keystone::Endpoint
54 | properties:
55 | service: {get_resource: sample_service}
56 | url: {get_param: admin_url}
57 | region: {get_param: region}
58 | interface: admin
59 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_updated.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone template updated all resources except domain field
4 |
5 | resources:
6 | test_role_a:
7 | type: OS::Keystone::Role
8 | properties:
9 | name: test_role_a_updated
10 |
11 | test_role_b:
12 | type: OS::Keystone::Role
13 | properties:
14 | name: test_role_b
15 |
16 | test_project_a:
17 | type: OS::Keystone::Project
18 | properties:
19 | name: test_project_a_updated
20 | domain: default
21 | description: Test project updated
22 | enabled: false
23 |
24 | test_project_b:
25 | type: OS::Keystone::Project
26 | properties:
27 | name: test_project_b
28 | domain: default
29 | description: Test project updated
30 | enabled: false
31 |
32 | test_group_a:
33 | type: OS::Keystone::Group
34 | properties:
35 | name: test_group_a_updated
36 | domain: default
37 | description: Test group updated
38 | roles:
39 | - role: {get_resource: test_role_b}
40 | domain: default
41 | - role: {get_resource: test_role_b}
42 | project: {get_resource: test_project_a}
43 |
44 | test_group_b:
45 | type: OS::Keystone::Group
46 | properties:
47 | name: test_group_b
48 | domain: default
49 | description: Test group
50 |
51 | test_user_a:
52 | type: OS::Keystone::User
53 | properties:
54 | name: test_user_a_updated
55 | domain: default
56 | description: Test user updated
57 | enabled: false
58 | email: xyz@abc.com
59 | password: passWORD
60 | default_project: {get_resource: test_project_b}
61 | groups:
62 | - {get_resource: test_group_b}
63 | roles:
64 | - role: {get_resource: test_role_b}
65 | domain: default
66 | - role: {get_resource: test_role_b}
67 | project: {get_resource: test_project_a}
68 |
69 | outputs:
70 | test_user_a_id:
71 | value: {get_resource: test_user_a}
72 | test_group_a_id:
73 | value: {get_resource: test_group_a}
74 | test_group_b_id:
75 | value: {get_resource: test_group_b}
76 | test_project_a_id:
77 | value: {get_resource: test_project_a}
78 | test_project_b_id:
79 | value: {get_resource: test_project_b}
80 | test_role_a_id:
81 | value: {get_resource: test_role_a}
82 | test_role_b_id:
83 | value: {get_resource: test_role_b}
84 |
--------------------------------------------------------------------------------
/hot/keystone/keystone_user.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: Sample Keystone User template
4 |
5 | parameters:
6 | user_name:
7 | type: string
8 | description: Keystone user name
9 | user_description:
10 | type: string
11 | description: Keystone user description
12 | user_enabled:
13 | type: boolean
14 | description: Keystone user is enabled or disabled
15 | user_domain:
16 | type: string
17 | description: Keystone user domain name
18 | user_email:
19 | type: string
20 | description: Keystone user email
21 | user_password:
22 | type: string
23 | description: Keystone user password
24 | user_default_project:
25 | type: string
26 | description: Keystone user default project id
27 | user_groups:
28 | type: comma_delimited_list
29 | description: Keystone groups, where this user is part of
30 | group_role:
31 | type: string
32 | description: role
33 | group_role_domain:
34 | type: string
35 | description: group role domain
36 | group_role_project:
37 | type: string
38 | description: group role project
39 |
40 | resources:
41 | admin_user:
42 | type: OS::Keystone::User
43 | properties:
44 | name: {get_param: user_name}
45 | domain: {get_param: user_domain}
46 | description: {get_param: user_description}
47 | enabled: {get_param: user_enabled}
48 | email: {get_param: user_email}
49 | password: {get_param: user_password}
50 | default_project: {get_param: user_default_project}
51 | groups: {get_param: user_groups}
52 | roles:
53 | - role: {get_param: group_role}
54 | domain: {get_param: group_role_domain}
55 | - role: {get_param: group_role}
56 | project: {get_param: group_role_project}
57 | outputs:
58 | admin_user_id:
59 | value: {get_resource: admin_user}
60 |
--------------------------------------------------------------------------------
/hot/lb_server.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2016-10-14
2 | description: A load-balancer server
3 | parameters:
4 | image:
5 | type: string
6 | description: Image used for servers
7 | key_name:
8 | type: string
9 | description: SSH key to connect to the servers
10 | flavor:
11 | type: string
12 | description: flavor used by the servers
13 | pool_id:
14 | type: string
15 | description: Pool to contact
16 | user_data:
17 | type: string
18 | description: Server user_data
19 | metadata:
20 | type: json
21 | network:
22 | type: string
23 | description: Network used by the server
24 | subnet:
25 | type: string
26 | description: Subnet used by the server
27 |
28 | resources:
29 | server:
30 | type: OS::Nova::Server
31 | properties:
32 | flavor: {get_param: flavor}
33 | image: {get_param: image}
34 | key_name: {get_param: key_name}
35 | metadata: {get_param: metadata}
36 | user_data: {get_param: user_data}
37 | user_data_format: RAW
38 | networks: [{network: {get_param: network} }]
39 | member:
40 | type: OS::Octavia::PoolMember
41 | properties:
42 | pool: {get_param: pool_id}
43 | address: {get_attr: [server, first_address]}
44 | protocol_port: 80
45 | subnet: {get_param: subnet}
46 |
47 | outputs:
48 | server_ip:
49 | description: IP Address of the load-balanced server.
50 | value: { get_attr: [server, first_address] }
51 | lb_member:
52 | description: LB member details.
53 | value: { get_attr: [member, show] }
54 |
--------------------------------------------------------------------------------
/hot/mistral/nova_networking_server_with_ip_env.yaml:
--------------------------------------------------------------------------------
1 | # Specifies server resource which uses nova networking
2 |
3 | resource_registry:
4 | "NovaNetwork::Server": templates/server_with_ip.yaml
5 |
--------------------------------------------------------------------------------
/hot/mistral/templates/server_with_ip.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-04-30
2 |
3 | parameters:
4 | image:
5 | type: string
6 | flavor:
7 | type: string
8 | security_group_name:
9 | type: string
10 | metadata:
11 | type: json
12 |
13 | resources:
14 | server:
15 | type: OS::Nova::Server
16 | properties:
17 | flavor: {get_param: flavor}
18 | image: {get_param: image}
19 | metadata: {get_param: metadata}
20 | security_groups:
21 | - get_param: security_group_name
22 |
23 | floating_ip:
24 | type: OS::Nova::FloatingIP
25 |
26 | floating_ip_association:
27 | type: OS::Nova::FloatingIPAssociation
28 | properties:
29 | floating_ip: {get_resource: floating_ip}
30 | server_id: {get_resource: server}
31 |
32 | security_group:
33 | type: AWS::EC2::SecurityGroup
34 | properties:
35 | GroupDescription: 'Enable SSH access'
36 | SecurityGroupIngress:
37 | - IpProtocol: 'tcp'
38 | FromPort: '22'
39 | ToPort: '22'
40 | CidrIp: '0.0.0.0/0'
41 |
42 | outputs:
43 | ip:
44 | value: {get_attr: [floating_ip, ip]}
45 | server_id:
46 | value: {get_resource: server}
47 |
--------------------------------------------------------------------------------
/hot/mistral/templates/stack_restarter.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-04-30
2 |
3 | description: >
4 | This template creates a stack that will observe the status of some VM
5 | in the given stack. If VM has ERROR status or doesn't exist, the stack with
6 | VM will be recreated. VM id status of which is needed to check obtained from
7 | observed stack outputs.
8 | Run "heat resource-signal " for staring execution,
9 | where resource name is tne name of workflow in the created stack.
10 |
11 |
12 | parameters:
13 | stack_name:
14 | type: string
15 | description: Name of the stack with VM status of which is needed to check.
16 |
17 | output_name:
18 | type: string
19 | description: Name of output that contains id of VM status of which is needed to check.
20 | default: vm_id
21 |
22 | pause:
23 | type: number
24 | description: Number of seconds to wait before status checks.
25 | default: 30
26 |
27 | resources:
28 | workflow:
29 | type: OS::Mistral::Workflow
30 | properties:
31 | type: direct
32 | tasks:
33 | - name: get_template
34 | action: heat.stacks_template stack_id=<% $.stack_name %>
35 | publish:
36 | template: <% $.get_template %>
37 | on_success:
38 | - get_vm_id
39 | - name: get_vm_id
40 | action: heat.stacks_get stack_id=<% $.stack_name %>
41 | publish:
42 | vm_id: {list_join: ["", ['<% $.get_vm_id.outputs.where($.output_key="', {get_param: output_name}, '").first().output_value %>']]}
43 | on_success:
44 | - get_vm_status
45 | - name: get_vm_status
46 | action: nova.servers_get server=<% $.vm_id %>
47 | on_error:
48 | - delete_stack
49 | on_success:
50 | - delete_stack: <% $.get_vm_status.status = ERROR %>
51 | - get_vm_status: <% $.get_vm_status.status != ERROR %>
52 | wait_before: { get_param: pause }
53 | - name: delete_stack
54 | action: heat.stacks_delete stack_id=<% $.stack_name %>
55 | on_success:
56 | - recreate_stack
57 | - name: recreate_stack
58 | action: heat.stacks_create stack_name=<% $.stack_name %> template=<% $.template %>
59 | retry:
60 | delay: 5
61 | count: 10
62 | on_success:
63 | - wait_stack_complete
64 | - name: wait_stack_complete
65 | action: heat.stacks_get stack_id=<% $.stack_name %>
66 | wait_before: 5
67 | on_success:
68 | - wait_stack_complete: <% $.wait_stack_complete.stack_status=CREATE_IN_PROGRESS %>
69 | - get_vm_id: <% $.wait_stack_complete.stack_status=CREATE_COMPLETE %>
70 | input:
71 | stack_name: {get_param: stack_name}
72 |
--------------------------------------------------------------------------------
/hot/mistral_external.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: rocky
2 |
3 | resources:
4 |
5 | workflow:
6 | type: OS::Mistral::Workflow
7 | properties:
8 | type: direct
9 | tasks:
10 | - name: hello
11 | action: std.echo output='Good morning!'
12 | publish:
13 | result: 'Bye'
14 |
15 | external_resource:
16 | type: OS::Mistral::ExternalResource
17 | properties:
18 | actions:
19 | CREATE:
20 | workflow: {get_resource: workflow}
21 |
--------------------------------------------------------------------------------
/hot/monasca/autoscaling.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-10-15
2 |
3 | description: >
4 | Example of using monasca resources for auto-scale testing. In this template,
5 | sample scale-group is created with given nova instance to auto-scale
6 | when cpu utilization varies between 15 to 50 percent for 3 times consequently.
7 |
8 | parameters:
9 | flavor:
10 | type: string
11 | description: Flavor for the instances to be created
12 | default: m1.nano
13 | image:
14 | type: string
15 | description: Name or ID of the image to use for the instances.
16 |
17 | resources:
18 | group:
19 | type: OS::Heat::AutoScalingGroup
20 | properties:
21 | cooldown: 60
22 | desired_capacity: 2
23 | max_size: 5
24 | min_size: 1
25 | resource:
26 | type: OS::Nova::Server
27 | properties:
28 | flavor: { get_param: flavor }
29 | image: { get_param: image }
30 | metadata: {"scale_group": {get_param: "OS::stack_id"}}
31 |
32 | scale_up_policy:
33 | type: OS::Heat::ScalingPolicy
34 | properties:
35 | adjustment_type: change_in_capacity
36 | auto_scaling_group_id: { get_resource: group }
37 | cooldown: 60
38 | scaling_adjustment: 1
39 |
40 | scale_down_policy:
41 | type: OS::Heat::ScalingPolicy
42 | properties:
43 | adjustment_type: change_in_capacity
44 | auto_scaling_group_id: { get_resource: group }
45 | cooldown: 60
46 | scaling_adjustment: -1
47 |
48 | up_notification:
49 | type: OS::Monasca::Notification
50 | properties:
51 | type: webhook
52 | address: {get_attr: [scale_up_policy, alarm_url]}
53 |
54 | down_notification:
55 | type: OS::Monasca::Notification
56 | properties:
57 | type: webhook
58 | address: {get_attr: [scale_down_policy, alarm_url]}
59 |
60 | cpu_alarm_high:
61 | type: OS::Monasca::AlarmDefinition
62 | properties:
63 | name: CPU utilization beyond 50 percent
64 | description: CPU utilization reached beyond 50 percent
65 | expression:
66 | str_replace:
67 | template: avg(cpu.utilization_perc{scale_group=scale_group_id}) > 50 times 3
68 | params:
69 | scale_group_id: {get_param: "OS::stack_id"}
70 | severity: high
71 | alarm_actions:
72 | - {get_resource: up_notification }
73 |
74 | cpu_alarm_low:
75 | type: OS::Monasca::AlarmDefinition
76 | properties:
77 | name: CPU utilization less than 15 percent
78 | description: CPU utilization less than 15 percent
79 | expression:
80 | str_replace:
81 | template: avg(cpu.utilization_perc{scale_group=scale_group_id}) < 15 times 3
82 | params:
83 | scale_group_id: {get_param: "OS::stack_id"}
84 | severity: low
85 | alarm_actions:
86 | - {get_resource: down_notification}
87 |
--------------------------------------------------------------------------------
/hot/multi_region_hello_world.yaml:
--------------------------------------------------------------------------------
1 | #
2 | # This is a multi region hello world HOT template defining two remote stacks
3 | # in different regions.
4 | #
5 | heat_template_version: 2013-05-23
6 |
7 | description: >
8 | Hello world HOT template that defines two remote stacks, one for RegionOne
9 | and one for RegionTwo, using the hello_world.yaml template.
10 |
11 | parameters:
12 | key_name:
13 | type: string
14 | description: Name of an existing key pair to use for the server
15 | constraints:
16 | - custom_constraint: nova.keypair
17 | flavor:
18 | type: string
19 | description: Flavor for the server to be created
20 | default: m1.small
21 | constraints:
22 | - custom_constraint: nova.flavor
23 | image:
24 | type: string
25 | description: Image ID or image name to use for the server
26 | constraints:
27 | - custom_constraint: glance.image
28 | admin_pass:
29 | type: string
30 | description: Admin password
31 | hidden: true
32 | constraints:
33 | - length: { min: 6, max: 8 }
34 | description: Password length must be between 6 and 8 characters
35 | - allowed_pattern: "[a-zA-Z0-9]+"
36 | description: Password must consist of characters and numbers only
37 | - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*"
38 | description: Password must start with an uppercase character
39 | db_port:
40 | type: number
41 | description: Database port number
42 | default: 50000
43 | constraints:
44 | - range: { min: 40000, max: 60000 }
45 | description: Port number must be between 40000 and 60000
46 |
47 | resources:
48 | stack_one:
49 | type: OS::Heat::Stack
50 | properties:
51 | context:
52 | region_name: RegionOne
53 | template: { get_file: "hello_world.yaml" }
54 | timeout: 60
55 | parameters:
56 | key_name: { get_param: key_name }
57 | image: { get_param: image }
58 | flavor: { get_param: flavor }
59 | admin_pass: { get_param: admin_pass }
60 | db_port: { get_param: db_port }
61 |
62 | stack_two:
63 | type: OS::Heat::Stack
64 | properties:
65 | context:
66 | region_name: RegionTwo
67 | template: { get_file: "hello_world.yaml" }
68 | timeout: 60
69 | parameters:
70 | key_name: { get_param: key_name }
71 | image: { get_param: image }
72 | flavor: { get_param: flavor }
73 | admin_pass: { get_param: admin_pass }
74 | db_port: { get_param: db_port }
75 |
76 | outputs:
77 | stack_one_outputs:
78 | description: Output of stack_one.
79 | value: { get_attr: [stack_one, outputs] }
80 | stack_two_outputs:
81 | description: Output of stack_two.
82 | value: { get_attr: [stack_two, outputs] }
83 |
--------------------------------------------------------------------------------
/hot/native_waitcondition.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | HOT template to demonstrate usage of the Heat native waitcondition resources
5 | This is expected to work with any image containing curl and something which
6 | runs the raw user-data script, e.g cirros or some image containing cloud-init
7 |
8 | parameters:
9 | key_name:
10 | type: string
11 | description: Name of keypair to assign to server
12 | default: stack_key
13 | image:
14 | type: string
15 | description: Name of image to use for server
16 | default: cirros-0.3.2-x86_64-disk
17 | flavor:
18 | type: string
19 | description: Flavor to use for server
20 | default: m1.tiny
21 | timeout:
22 | type: number
23 | description: Timeout for WaitCondition, depends on your image and environment
24 | default: 300
25 |
26 | resources:
27 | wait_condition:
28 | type: OS::Heat::WaitCondition
29 | properties:
30 | handle: {get_resource: wait_handle}
31 | # Note, count of 5 vs 6 is due to duplicate signal ID 5 sent below
32 | count: 5
33 | timeout: {get_param: timeout}
34 |
35 | wait_handle:
36 | type: OS::Heat::WaitConditionHandle
37 |
38 | instance1:
39 | type: OS::Nova::Server
40 | properties:
41 | image: {get_param: image}
42 | flavor: {get_param: flavor}
43 | key_name: {get_param: key_name}
44 | user_data_format: RAW
45 | user_data:
46 | str_replace:
47 | template: |
48 | #!/bin/sh
49 | # Below are some examples of the various ways signals
50 | # can be sent to the Handle resource
51 |
52 | # Simple success signal
53 | wc_notify --data-binary '{"status": "SUCCESS"}'
54 |
55 | # Or you optionally can specify any of the additional fields
56 | wc_notify --data-binary '{"status": "SUCCESS", "reason": "signal2"}'
57 | wc_notify --data-binary '{"status": "SUCCESS", "reason": "signal3", "data": "data3"}'
58 | wc_notify --data-binary '{"status": "SUCCESS", "reason": "signal4", "data": "data4"}'
59 |
60 | # If you require control of the ID, you can pass it.
61 | # The ID should be unique, unless you intend for duplicate
62 | # signals to overrite each other. The following two calls
63 | # do the exact same thing, and will be treated as one signal
64 | # (You can prove this by changing count above to 7)
65 | wc_notify --data-binary '{"status": "SUCCESS", "id": "5"}'
66 | wc_notify --data-binary '{"status": "SUCCESS", "id": "5"}'
67 |
68 | # Example of sending a failure signal, optionally
69 | # reason, id, and data can be specified as above
70 | # wc_notify --data-binary '{"status": "FAILURE"}'
71 |
72 | params:
73 | wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
74 |
75 | outputs:
76 | curl_cli:
77 | value: { get_attr: ['wait_handle', 'curl_cli'] }
78 | wc_data:
79 | value: { get_attr: ['wait_condition', 'data'] }
80 |
--------------------------------------------------------------------------------
/hot/nova/host_aggregate.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-10-15
2 |
3 | description: Sample Nova Host Aggregate template
4 |
5 | parameters:
6 | host_aggregate_name:
7 | type: string
8 | description: Nova host aggregate name
9 | availability_zone_name:
10 | type: string
11 | description: Nova availability zone name
12 | hosts:
13 | type: comma_delimited_list
14 | description: Nova host name list
15 | metadata:
16 | type: json
17 | description: Arbitrary key/value metadata
18 |
19 | resources:
20 | sample_host_aggregate:
21 | type: OS::Nova::HostAggregate
22 | properties:
23 | name: {get_param: host_aggregate_name}
24 | availability_zone: {get_param: availability_zone_name}
25 | hosts: {get_param: hosts}
26 | metadata: {get_param: metadata}
27 |
28 | outputs:
29 | sample_host_aggregate_id:
30 | value: {get_resource: sample_host_aggregate}
31 | description: Sample nova host_aggregate
32 |
--------------------------------------------------------------------------------
/hot/resource_group/random.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-10-15
2 |
3 | parameters:
4 | lengths:
5 | type: comma_delimited_list
6 | index:
7 | type: number
8 |
9 | resources:
10 | random:
11 | type: OS::Heat::RandomString
12 | properties:
13 | length: {get_param: [lengths, {get_param: index}]}
14 |
15 | outputs:
16 | value:
17 | value: {get_attr: [random, value]}
18 |
--------------------------------------------------------------------------------
/hot/resource_group/resource_group.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | resources:
4 | random_group:
5 | type: OS::Heat::ResourceGroup
6 | properties:
7 | count: 2
8 | resource_def:
9 | type: OS::Heat::RandomString
10 |
11 | outputs:
12 | # Note for RandomString the resource ID is set to the random string
13 | # value, for other resources the ID returned will be the uuid of the
14 | # actual resource
15 | resource1_id:
16 | value: { get_attr: [random_group, resource.0] }
17 | resource2_id:
18 | value: { get_attr: [random_group, resource.1] }
19 | # The last part of the resource.0.value specifies the attribute of the
20 | # nested resource to access, e.g in this case 'value'
21 | resource1_value:
22 | value: { get_attr: [random_group, resource.0.value] }
23 | resource2_value:
24 | value: { get_attr: [random_group, resource.1.value] }
25 | # You can also get a list of all values in the group
26 | all_values:
27 | value: { get_attr: [random_group, value] }
28 |
--------------------------------------------------------------------------------
/hot/resource_group/resource_group_index_lookup.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-04-30
2 |
3 | description: Shows how to look up list/map values by group index
4 |
5 | parameters:
6 | random_lengths:
7 | type: comma_delimited_list
8 | default: [4, 5, 6]
9 |
10 | resources:
11 | random_group:
12 | type: OS::Heat::ResourceGroup
13 | properties:
14 | count: 3
15 | resource_def:
16 | type: random.yaml
17 | properties:
18 | # Note you have to pass the index and the entire list into the
19 | # nested template, resolving via %index% doesn't work directly
20 | # in the get_param here
21 | index: "%index%"
22 | lengths: {get_param: random_lengths}
23 |
24 | outputs:
25 | all_values:
26 | value: {get_attr: [random_group, value]}
27 |
--------------------------------------------------------------------------------
/hot/resource_group/server_with_volumes.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | Example of using ResourceGroup to attach multiple volumes to an instance
5 |
6 | parameters:
7 | key_name:
8 | type: string
9 | description: keypair to enable SSH access to the instance.
10 | default: stack_key
11 |
12 | image_id:
13 | type: string
14 | description: ID of the image to use for the instance to be created.
15 | default: cirros-0.3.2-x86_64-disk
16 |
17 | volume_size:
18 | type: number
19 | description: Size of volume to attach to instance
20 | default: 1
21 | constraints:
22 | - range: { min: 1, max: 10 }
23 |
24 | num_volumes:
25 | type: number
26 | description: Number of volumes to attach to instance
27 | default: 2
28 | constraints:
29 | - range: { min: 1, max: 10 }
30 |
31 | instance_type:
32 | type: string
33 | description: Type of the instance to be created.
34 | default: m1.nano
35 |
36 | resources:
37 | instance:
38 | type: OS::Nova::Server
39 | properties:
40 | image: { get_param: image_id }
41 | flavor: { get_param: instance_type }
42 | key_name: { get_param: key_name }
43 |
44 | group_of_volumes:
45 | type: OS::Heat::ResourceGroup
46 | properties:
47 | count: { get_param: num_volumes }
48 | resource_def:
49 | type: volume_with_attachment.yaml
50 | properties:
51 | instance_id: { get_resource: instance }
52 | volume_size: { get_param: volume_size }
53 |
54 | outputs:
55 | server_ip:
56 | description: IP Address of server having volumes attached.
57 | value: { get_attr: [instance, first_address] }
58 |
--------------------------------------------------------------------------------
/hot/resource_group/volume_with_attachment.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | parameters:
4 | volume_size:
5 | type: number
6 | description: Size of volume to attach to instance
7 | default: 1
8 | constraints:
9 | - range: { min: 1, max: 10 }
10 |
11 | instance_id:
12 | type: string
13 | description: Server to attach volume to
14 |
15 | resources:
16 | volume:
17 | type: OS::Cinder::Volume
18 | properties:
19 | size: { get_param: volume_size }
20 | description: Volume for stack
21 |
22 | volume_attachment:
23 | type: OS::Cinder::VolumeAttachment
24 | properties:
25 | volume_id: { get_resource: volume }
26 | instance_uuid: { get_param: instance_id }
27 |
--------------------------------------------------------------------------------
/hot/senlin/cluster.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2016-04-08
2 |
3 | description: >
4 | This template demostrate how to use senlin resources to create
5 | a flexible cluster.
6 |
7 | parameters:
8 | flavor:
9 | description: Flavor for the instances to be created.
10 | type: string
11 | default: m1.nano
12 | image:
13 | description: Name or ID of the image to use for the instances.
14 | type: string
15 | default: cirros-0.3.4-x86_64-uec
16 | key_name:
17 | description: Name of an existing key pair to use for the instances.
18 | type: string
19 | network:
20 | description: The network for the instances.
21 | type: string
22 | default: private
23 |
24 | resources:
25 | profile:
26 | type: OS::Senlin::Profile
27 | properties:
28 | type: os.nova.server-1.0
29 | properties:
30 | flavor: {get_param: flavor}
31 | image: {get_param: image}
32 | key_name: {get_param: key_name}
33 | networks:
34 | - network: {get_param: network}
35 |
36 | cluster:
37 | type: OS::Senlin::Cluster
38 | properties:
39 | desired_capacity: 1
40 | profile: {get_resource: profile}
41 |
42 | scale_in_policy:
43 | type: OS::Senlin::Policy
44 | properties:
45 | type: senlin.policy.scaling-1.0
46 | bindings:
47 | - cluster: {get_resource: cluster}
48 | properties:
49 | event: CLUSTER_SCALE_IN
50 | adjustment:
51 | type: CHANGE_IN_CAPACITY
52 | number: 1
53 |
54 | scale_out_policy:
55 | type: OS::Senlin::Policy
56 | properties:
57 | type: senlin.policy.scaling-1.0
58 | bindings:
59 | - cluster: {get_resource: cluster}
60 | properties:
61 | event: CLUSTER_SCALE_OUT
62 | adjustment:
63 | type: CHANGE_IN_CAPACITY
64 | number: 1
65 |
66 | receiver_scale_out:
67 | type: OS::Senlin::Receiver
68 | properties:
69 | cluster: {get_resource: cluster}
70 | action: CLUSTER_SCALE_OUT
71 | type: webhook
72 |
73 | receiver_scale_in:
74 | type: OS::Senlin::Receiver
75 | properties:
76 | cluster: {get_resource: cluster}
77 | action: CLUSTER_SCALE_IN
78 | type: webhook
79 |
80 | outputs:
81 | webhook_scale_out:
82 | description: Webhook to scale out cluster.
83 | value:
84 | str_replace:
85 | template: curl -X POST LINK
86 | params:
87 | LINK: {get_attr: [receiver_scale_out, channel, alarm_url]}
88 |
89 | webhook_scale_in:
90 | description: Webhook to scale in cluster.
91 | value:
92 | str_replace:
93 | template: curl -X POST LINK
94 | params:
95 | LINK: {get_attr: [receiver_scale_in, channel, alarm_url]}
96 |
--------------------------------------------------------------------------------
/hot/server_console.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: |
4 | The heat template is used to demo the 'console_urls' attribute
5 | of OS::Nova::Server.
6 |
7 | parameters:
8 | image:
9 | type: string
10 | flavor:
11 | type: string
12 | default: m1.small
13 |
14 | resources:
15 | server:
16 | type: OS::Nova::Server
17 | properties:
18 | image: { get_param: image }
19 | flavor: { get_param: flavor }
20 |
21 | outputs:
22 | single_console_type:
23 | value: { get_attr: server, console_urls, novnc }
24 | description: console URL for the server (novnc in this case)
25 | all_console_urls:
26 | value: { get_attr: [server, console_urls] }
27 | description: all available console URLs for the server
28 |
--------------------------------------------------------------------------------
/hot/server_with_encrpyted_volume.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2015-04-30
2 |
3 | description: >
4 | A template showing how to create an encrypted cinder volume and attach
5 | it to a nova instance. The template uses only Heat OpenStack native
6 | resource types.
7 |
8 | parameters:
9 | key_name:
10 | type: string
11 | description:
12 | Name of an existing key pair to enable SSH access to the instance.
13 | image_id:
14 | type: string
15 | description: ID of the image to use for the instance to be created.
16 | instance_type:
17 | type: string
18 | description: Type of the instance to be created.
19 | default: m1.small
20 | availability_zone:
21 | type: string
22 | description: The Availability Zone to launch the instance.
23 | default: nova
24 | volume_type_name:
25 | type: string
26 | description: Name of new volume type to be created.
27 | default: my_vol_type
28 | encryption_cipher:
29 | type: string
30 | description: The encryption algorithm/mode to use.
31 | default: aes-xts-plain64
32 | encryption_key_size:
33 | type: number
34 | description: Size of the encryption key, in bits.
35 | default: 512
36 | volume_size:
37 | type: number
38 | description: Size of the volume to be created.
39 | default: 1
40 | constraints:
41 | - range: { min: 1, max: 1024 }
42 | description: must be between 1 and 1024 Gb.
43 | volume_mountpoint:
44 | type: string
45 | description: The location where the volume is exposed on the instance.
46 | default: /dev/vdc
47 |
48 | resources:
49 | cinder_volume_type:
50 | type: OS::Cinder::VolumeType
51 | properties:
52 | name: { get_param: volume_type_name }
53 | cinder_encryption_vol_type:
54 | type: OS::Cinder::EncryptedVolumeType
55 | properties:
56 | provider: nova.volume.encryptors.luks.LuksEncryptor
57 | control_location: front-end
58 | cipher: { get_param: encryption_cipher }
59 | key_size: { get_param: encryption_key_size }
60 | volume_type: { get_resource: cinder_volume_type }
61 | cinder_volume:
62 | type: OS::Cinder::Volume
63 | properties:
64 | size: { get_param: volume_size }
65 | availability_zone: { get_param: availability_zone }
66 | volume_type: { get_resource: cinder_encryption_vol_type }
67 | nova_instance:
68 | type: OS::Nova::Server
69 | properties:
70 | availability_zone: { get_param: availability_zone }
71 | image: { get_param: image_id }
72 | flavor: { get_param: instance_type }
73 | key_name: { get_param: key_name }
74 | cinder_volume_attachment:
75 | type: OS::Cinder::VolumeAttachment
76 | properties:
77 | volume_id: { get_resource: cinder_volume }
78 | instance_uuid: { get_resource: nova_instance }
79 | mountpoint: { get_param: volume_mountpoint }
80 |
81 | outputs:
82 | instance_ip:
83 | description: Public IP address of the newly created Nova instance.
84 | value: { get_attr: [nova_instance, first_address] }
85 |
--------------------------------------------------------------------------------
/hot/servers_in_existing_neutron_network_no_floating_ips.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: HOT template to deploy two servers to an existing Neutron network.
4 |
5 | parameters:
6 | key_name:
7 | type: string
8 | description: Name of keypair to assign to servers
9 | image:
10 | type: string
11 | description: Name of image to use for servers
12 | flavor:
13 | type: string
14 | description: Flavor to use for servers
15 | net_id:
16 | type: string
17 | description: ID of Neutron network into which servers get deployed
18 | subnet_id:
19 | type: string
20 | description: ID of Neutron sub network into which servers get deployed
21 |
22 | resources:
23 | server1:
24 | type: OS::Nova::Server
25 | properties:
26 | name: Server1
27 | image: { get_param: image }
28 | flavor: { get_param: flavor }
29 | key_name: { get_param: key_name }
30 | networks:
31 | - port: { get_resource: server1_port }
32 |
33 | server1_port:
34 | type: OS::Neutron::Port
35 | properties:
36 | network_id: { get_param: net_id }
37 | fixed_ips:
38 | - subnet_id: { get_param: subnet_id }
39 | security_groups: [{ get_resource: server_security_group }]
40 |
41 | server2:
42 | type: OS::Nova::Server
43 | properties:
44 | name: Server2
45 | image: { get_param: image }
46 | flavor: { get_param: flavor }
47 | key_name: { get_param: key_name }
48 | networks:
49 | - port: { get_resource: server2_port }
50 |
51 | server2_port:
52 | type: OS::Neutron::Port
53 | properties:
54 | network_id: { get_param: net_id }
55 | fixed_ips:
56 | - subnet_id: { get_param: subnet_id }
57 | security_groups: [{ get_resource: server_security_group }]
58 |
59 | server_security_group:
60 | type: OS::Neutron::SecurityGroup
61 | properties:
62 | description: Test group to demonstrate Neutron security group functionality with Heat.
63 | name: test-security-group
64 | rules: [
65 | {remote_ip_prefix: 0.0.0.0/0,
66 | protocol: tcp,
67 | port_range_min: 22,
68 | port_range_max: 22},
69 | {remote_ip_prefix: 0.0.0.0/0,
70 | protocol: icmp}]
71 |
72 | outputs:
73 | server1_provider_ip:
74 | description: IP address of server1 in provider network
75 | value: { get_attr: [ server1, first_address ] }
76 | server2_provider_ip:
77 | description: IP address of server2 in provider network
78 | value: { get_attr: [ server2, first_address ] }
79 |
--------------------------------------------------------------------------------
/hot/software-config/README.rst:
--------------------------------------------------------------------------------
1 | =============================================
2 | HOT software configuration hooks and examples
3 | =============================================
4 |
5 | The Heat software configuration resources can be combined with a server agent
6 | and hooks to configure software on servers using a variety of techniques.
7 |
8 | Contained here are the following directories:
9 |
10 | boot-config
11 | -----------
12 | This directory has environment files which each declare a resource type
13 | Heat::InstallConfigAgent.
14 |
15 | This can be used by server user_data when booting a pristine image
16 | to install the agent required to use software deployment resources in
17 | templates.
18 |
19 | elements
20 | --------
21 | This contains `diskimage-builder `_
22 | elements which will install the hooks for different configuration tools onto
23 | a custom-built image.
24 |
25 | example-templates
26 | -----------------
27 | This contains example heat templates which demonstrate how the software config
28 | resources and the hooks work together to perform software configuration.
29 |
30 | test-image
31 | ----------
32 | This contains `diskimage-builder `_
33 | elements which will install the distro packages required for a base test image.
--------------------------------------------------------------------------------
/hot/software-config/boot-config/README.rst:
--------------------------------------------------------------------------------
1 | ================================================
2 | Boot config for installing software-config agent
3 | ================================================
4 |
5 | This directory has environment files which each declare a resource type
6 | Heat::InstallConfigAgent.
7 |
8 | This can be used by server user_data when booting a pristine image
9 | to install the agent required to use software deployment resources in
10 | templates. The templates assume that you have the heat-agents
11 | repository checked out alongside the heat-templates repository; if the
12 | agent code is in a different location you will need to adjust the paths
13 | in the templates.
14 |
15 | The environments only install the heat-config-script hook. If other hooks are
16 | required then define your own environment file which defines a resource
17 | template based on one of the templates in template/
18 |
19 | To install the agent during boot, include the following in the template:
20 |
21 | boot_config:
22 | type: Heat::InstallConfigAgent
23 |
24 | server:
25 | type: OS::Nova::Server
26 | properties:
27 | user_data_format: SOFTWARE_CONFIG
28 | user_data: {get_attr: [boot_config, config]}
29 | # ...
30 |
31 | When creating the stack, reference the desired environment, eg:
32 |
33 | openstack stack create -e fedora_yum_env.yaml \
34 | -t ../example-templates/example-config-pristine-image.yaml \
35 | deploy-to-pristine
36 |
37 | =====================================
38 | Boot config with heat-container-agent
39 | =====================================
40 |
41 | When creating the stack to deploy containers with docker-compose,
42 | include the following in the template:
43 |
44 | boot_config:
45 | type: Heat::InstallConfigAgent
46 |
47 | server:
48 | type: OS::Nova::Server
49 | properties:
50 | user_data_format: SOFTWARE_CONFIG
51 | user_data: {get_attr: [boot_config, config]}
52 | # ...
53 |
54 | and reference the desired environment, eg:
55 |
56 | openstack stack create -e container_agent_env.yaml \
57 | -t ../example-templates/example-pristine-atomic-docker-compose.yaml \
58 | deploy-to-pristine
59 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/centos7_rdo_env.yaml:
--------------------------------------------------------------------------------
1 | # Installs software-config agent on boot for fedora with yum
2 |
3 | parameters:
4 | image: CentOS-7-x86_64-GenericCloud
5 |
6 | resource_registry:
7 | "Heat::InstallConfigAgent": templates/install_config_agent_centos7_rdo.yaml
8 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/container_agent_env.yaml:
--------------------------------------------------------------------------------
1 | # Installs heat-container-agent on boot in a container
2 |
3 | resource_registry:
4 | "Heat::InstallConfigAgent": templates/install_container_agent.yaml
5 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/fedora_pip_env.yaml:
--------------------------------------------------------------------------------
1 | # Installs software-config agent on boot for fedora with pip install
2 |
3 | parameters:
4 | image: Fedora-x86_64-20-20140618-sda
5 |
6 | resource_registry:
7 | "Heat::InstallConfigAgent": templates/install_config_agent_fedora_pip.yaml
8 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/fedora_yum_env.yaml:
--------------------------------------------------------------------------------
1 | # Installs software-config agent on boot for fedora with yum
2 |
3 | parameters:
4 | image: Fedora-x86_64-20-20140618-sda
5 |
6 | resource_registry:
7 | "Heat::InstallConfigAgent": templates/install_config_agent_fedora_yum.yaml
8 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/none_env.yaml:
--------------------------------------------------------------------------------
1 | # Defines a Heat::InstallConfigAgent config resource which performs no config.
2 | # This environment can be used when the image already has the required agents
3 | # installed and configured.
4 | resource_registry:
5 | "Heat::InstallConfigAgent": "OS::Heat::SoftwareConfig"
6 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/20-os-apply-config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ue
3 |
4 | exec os-apply-config
5 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/configure_config_agent.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | # os-apply-config templates directory
5 | oac_templates=/usr/libexec/os-apply-config/templates
6 | mkdir -p $oac_templates/etc
7 |
8 | # initial /etc/os-collect-config.conf
9 | cat </etc/os-collect-config.conf
10 | [DEFAULT]
11 | command = os-refresh-config
12 | EOF
13 |
14 | # template for building os-collect-config.conf for polling heat
15 | cat <$oac_templates/etc/os-collect-config.conf
16 | $occ_conf
17 | EOF
18 | mkdir -p $oac_templates/var/run/heat-config
19 |
20 | # template for writing heat deployments data to a file
21 | echo "{{deployments}}" > $oac_templates/var/run/heat-config/heat-config
22 |
23 | # os-refresh-config scripts directory.
24 | # For older version, this path might be `/opt/stack/os-config-refresh`
25 | orc_scripts=/usr/libexec/os-refresh-config
26 | for d in pre-configure.d configure.d migration.d post-configure.d; do
27 | install -m 0755 -o root -g root -d $orc_scripts/$d
28 | done
29 |
30 | # os-refresh-config script for running os-apply-config
31 | cat <$orc_scripts/configure.d/20-os-apply-config
32 | $orc_oac
33 | EOF
34 | chmod 700 $orc_scripts/configure.d/20-os-apply-config
35 |
36 | # os-refresh-config script for running heat config hooks
37 | cat <$orc_scripts/configure.d/55-heat-config
38 | $heat_config_script
39 | EOF
40 | chmod 700 $orc_scripts/configure.d/55-heat-config
41 |
42 | # config hook for shell scripts
43 | hooks_dir=/var/lib/heat-config/hooks
44 | mkdir -p $hooks_dir
45 |
46 | # install hook for configuring with shell scripts
47 | cat <$hooks_dir/script
48 | $hook_script
49 | EOF
50 | chmod 755 $hooks_dir/script
51 |
52 | # install heat-config-notify command
53 | cat </usr/bin/heat-config-notify
54 | $heat_config_notify
55 | EOF
56 | chmod 755 /usr/bin/heat-config-notify
57 |
58 | # run once to write out /etc/os-collect-config.conf
59 | os-collect-config --one-time --debug
60 | cat /etc/os-collect-config.conf
61 |
62 | # run again to poll for deployments and run hooks
63 | os-collect-config --one-time --debug
64 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/get_container_agent_image.frag:
--------------------------------------------------------------------------------
1 | #cloud-config
2 | merge_how: dict(recurse_array)+list(append)
3 | write_files:
4 | - path: /opt/container_agent/get_container_agent_image.sh
5 | owner: "root:root"
6 | permissions: "0644"
7 | content: |
8 | #!/bin/bash
9 | set -eux
10 | regex='(https?|http)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
11 | agent_image="$1"
12 | if [[ $agent_image =~ $regex ]]
13 | then
14 | cd /tmp && { curl $agent_image > heat_container_image.tar ; cd -; }
15 | /usr/bin/docker load -i /tmp/heat_container_image.tar
16 | else
17 | /usr/bin/docker pull $agent_image
18 | fi
19 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/install_config_agent_pip.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | pip install os-collect-config os-apply-config os-refresh-config heat-cfntools
5 |
6 | cfn-create-aws-symlinks
7 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/install_config_agent_rdo.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | yum -y install https://www.rdoproject.org/repos/rdo-release.rpm
5 | yum -y install python-zaqarclient os-collect-config os-apply-config os-refresh-config
6 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/install_config_agent_yum.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | yum -y install os-collect-config os-apply-config os-refresh-config
5 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/install_python_build_env_apt.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | apt-get -y update
5 | apt-get -y install python-pip git gcc python-dev libyaml-dev libssl-dev libffi-dev libxml2-dev libxslt1-dev
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/install_python_build_env_yum.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | yum -y install python-pip gcc git-core python-devel libyaml-devel openssl-devel libffi-devel libxml2-devel libxslt-devel
5 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/os-collect-config.conf:
--------------------------------------------------------------------------------
1 | [DEFAULT]
2 | {{^os-collect-config.command}}
3 | command = os-refresh-config
4 | {{/os-collect-config.command}}
5 | {{#os-collect-config}}
6 | {{#command}}
7 | command = {{command}}
8 | {{/command}}
9 | {{#polling_interval}}
10 | polling_interval = {{polling_interval}}
11 | {{/polling_interval}}
12 | {{#cachedir}}
13 | cachedir = {{cachedir}}
14 | {{/cachedir}}
15 | {{#collectors}}
16 | collectors = {{.}}
17 | {{/collectors}}
18 | {{#splay}}
19 | splay = {{.}}
20 | {{/splay}}
21 |
22 | {{#cfn}}
23 | [cfn]
24 | {{#metadata_url}}
25 | metadata_url = {{metadata_url}}
26 | {{/metadata_url}}
27 | stack_name = {{stack_name}}
28 | secret_access_key = {{secret_access_key}}
29 | access_key_id = {{access_key_id}}
30 | path = {{path}}
31 | {{#ca_certificate}}
32 | ca_certificate = {{.}}
33 | {{/ca_certificate}}
34 | {{/cfn}}
35 |
36 | {{#heat}}
37 | [heat]
38 | auth_url = {{auth_url}}
39 | user_id = {{user_id}}
40 | password = {{password}}
41 | project_id = {{project_id}}
42 | stack_id = {{stack_id}}
43 | resource_name = {{resource_name}}
44 | {{/heat}}
45 |
46 | {{#zaqar}}
47 | [zaqar]
48 | auth_url = {{auth_url}}
49 | user_id = {{user_id}}
50 | password = {{password}}
51 | project_id = {{project_id}}
52 | queue_id = {{queue_id}}
53 | {{#use_websockets}}
54 | use_websockets = {{.}}
55 | {{/use_websockets}}
56 | {{/zaqar}}
57 |
58 | {{#request}}
59 | [request]
60 | metadata_url = {{metadata_url}}
61 | {{/request}}
62 |
63 | {{/os-collect-config}}
64 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/start_config_agent.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | if [[ `systemctl` =~ -\.mount ]]; then
5 |
6 | # if there is no system unit file, install a local unit
7 | if [ ! -f /usr/lib/systemd/system/os-collect-config.service ]; then
8 |
9 | cat </etc/systemd/system/os-collect-config.service
10 | [Unit]
11 | Description=Collect metadata and run hook commands.
12 |
13 | [Service]
14 | ExecStart=/usr/bin/os-collect-config
15 | Restart=on-failure
16 |
17 | [Install]
18 | WantedBy=multi-user.target
19 | EOF
20 |
21 | cat </etc/os-collect-config.conf
22 | [DEFAULT]
23 | command=os-refresh-config
24 | EOF
25 | fi
26 |
27 | # enable and start service to poll for deployment changes
28 | systemctl enable os-collect-config
29 | systemctl start --no-block os-collect-config
30 | elif [[ `/sbin/init --version` =~ upstart ]]; then
31 | if [ ! -f /etc/init/os-collect-config.conf ]; then
32 |
33 | cat </etc/init/os-collect-config.conf
34 | start on runlevel [2345]
35 | stop on runlevel [016]
36 | respawn
37 |
38 | # We're logging to syslog
39 | console none
40 |
41 | exec os-collect-config 2>&1 | logger -t os-collect-config
42 | EOF
43 | fi
44 | initctl reload-configuration
45 | service os-collect-config start
46 | else
47 | echo "ERROR: only systemd or upstart supported" 1>&2
48 | exit 1
49 | fi
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/fragments/start_container_agent.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | # heat-docker-agent service
5 | cat < /etc/systemd/system/heat-container-agent.service
6 |
7 | [Unit]
8 | Description=Heat Container Agent
9 | After=docker.service
10 | Requires=docker.service
11 |
12 | [Service]
13 | User=root
14 | Restart=on-failure
15 | ExecStartPre=-/usr/bin/docker kill heat-container-agent
16 | ExecStartPre=-/usr/bin/docker rm heat-container-agent
17 | ExecStartPre=/opt/container_agent/get_container_agent_image.sh $agent_image
18 | ExecStart=/usr/bin/docker run --name heat-container-agent --privileged --net=host -v /usr/bin/atomic:/usr/bin/atomic -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/atomic:/usr/bin/atomic -v /var/lib/cloud:/var/lib/cloud -v /var/lib/heat-cfntools:/var/lib/heat-cfntools $agent_image
19 | ExecStop=/usr/bin/docker stop heat-container-agent
20 |
21 | [Install]
22 | WantedBy=multi-user.target
23 |
24 | EOF
25 |
26 | # enable and start docker
27 | /usr/bin/systemctl enable docker.service
28 | /usr/bin/systemctl start --no-block docker.service
29 |
30 | # enable and start heat-container-agent
31 | chmod 0640 /etc/systemd/system/heat-container-agent.service
32 | chmod 0755 /opt/container_agent/get_container_agent_image.sh
33 | /usr/bin/systemctl enable heat-container-agent.service
34 | /usr/bin/systemctl start --no-block heat-container-agent.service
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/install_config_agent_centos7_rdo.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | resources:
4 |
5 | install_config_agent_rdo:
6 | type: "OS::Heat::SoftwareConfig"
7 | properties:
8 | group: ungrouped
9 | config: {get_file: fragments/install_config_agent_rdo.sh}
10 |
11 | configure_config_agent:
12 | type: "OS::Heat::SoftwareConfig"
13 | properties:
14 | group: ungrouped
15 | config:
16 | str_replace:
17 | params:
18 | $heat_config_script: {get_file: ../../../../../heat-agents/heat-config/os-refresh-config/configure.d/55-heat-config}
19 | $hook_script: {get_file: ../../../../../heat-agents/heat-config-script/install.d/hook-script.py}
20 | $heat_config_notify: {get_file: ../../../../../heat-agents/heat-config/bin/heat-config-notify}
21 | $occ_conf: {get_file: fragments/os-collect-config.conf}
22 | $orc_oac: {get_file: fragments/20-os-apply-config}
23 | template: {get_file: fragments/configure_config_agent.sh}
24 |
25 | start_config_agent:
26 | type: "OS::Heat::SoftwareConfig"
27 | properties:
28 | group: ungrouped
29 | config: {get_file: fragments/start_config_agent.sh}
30 |
31 | install_config_agent:
32 | type: "OS::Heat::MultipartMime"
33 | properties:
34 | parts:
35 | - config: {get_resource: install_config_agent_rdo}
36 | - config: {get_resource: configure_config_agent}
37 | - config: {get_resource: start_config_agent}
38 |
39 | outputs:
40 | config:
41 | value: {get_resource: install_config_agent}
42 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/install_config_agent_fedora_pip.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | resources:
4 |
5 | install_python_build_env:
6 | type: "OS::Heat::SoftwareConfig"
7 | properties:
8 | group: ungrouped
9 | config: {get_file: fragments/install_python_build_env_yum.sh}
10 |
11 | install_config_agent_pip:
12 | type: "OS::Heat::SoftwareConfig"
13 | properties:
14 | group: ungrouped
15 | config: {get_file: fragments/install_config_agent_pip.sh}
16 |
17 | configure_config_agent:
18 | type: "OS::Heat::SoftwareConfig"
19 | properties:
20 | group: ungrouped
21 | config:
22 | str_replace:
23 | params:
24 | $heat_config_script: {get_file: ../../../../../heat-agents/heat-config/os-refresh-config/configure.d/55-heat-config}
25 | $hook_script: {get_file: ../../../../../heat-agents/heat-config-script/install.d/hook-script.py}
26 | $heat_config_notify: {get_file: ../../../../../heat-agents/heat-config/bin/heat-config-notify}
27 | $occ_conf: {get_file: fragments/os-collect-config.conf}
28 | $orc_oac: {get_file: fragments/20-os-apply-config}
29 | template: {get_file: fragments/configure_config_agent.sh}
30 |
31 | start_config_agent:
32 | type: "OS::Heat::SoftwareConfig"
33 | properties:
34 | group: ungrouped
35 | config: {get_file: fragments/start_config_agent.sh}
36 |
37 | install_config_agent:
38 | type: "OS::Heat::MultipartMime"
39 | properties:
40 | parts:
41 | - config: {get_resource: install_python_build_env}
42 | - config: {get_resource: install_config_agent_pip}
43 | - config: {get_resource: configure_config_agent}
44 | - config: {get_resource: start_config_agent}
45 |
46 | outputs:
47 | config:
48 | value: {get_resource: install_config_agent}
49 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/install_config_agent_fedora_yum.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | resources:
4 |
5 | install_config_agent_yum:
6 | type: "OS::Heat::SoftwareConfig"
7 | properties:
8 | group: ungrouped
9 | config: {get_file: fragments/install_config_agent_yum.sh}
10 |
11 | configure_config_agent:
12 | type: "OS::Heat::SoftwareConfig"
13 | properties:
14 | group: ungrouped
15 | config:
16 | str_replace:
17 | params:
18 | $heat_config_script: {get_file: ../../../../../heat-agents/heat-config/os-refresh-config/configure.d/55-heat-config}
19 | $hook_script: {get_file: ../../../../../heat-agents/heat-config-script/install.d/hook-script.py}
20 | $heat_config_notify: {get_file: ../../../../../heat-agents/heat-config/bin/heat-config-notify}
21 | $occ_conf: {get_file: fragments/os-collect-config.conf}
22 | $orc_oac: {get_file: fragments/20-os-apply-config}
23 | template: {get_file: fragments/configure_config_agent.sh}
24 |
25 | start_config_agent:
26 | type: "OS::Heat::SoftwareConfig"
27 | properties:
28 | group: ungrouped
29 | config: {get_file: fragments/start_config_agent.sh}
30 |
31 | install_config_agent:
32 | type: "OS::Heat::MultipartMime"
33 | properties:
34 | parts:
35 | - config: {get_resource: install_config_agent_yum}
36 | - config: {get_resource: configure_config_agent}
37 | - config: {get_resource: start_config_agent}
38 |
39 | outputs:
40 | config:
41 | value: {get_resource: install_config_agent}
42 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/install_config_agent_test_image.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | parameters:
4 | pip_mirror:
5 | type: string
6 | default: https://pypi.python.org/simple
7 |
8 | resources:
9 |
10 | install_config_agent_pip:
11 | type: "OS::Heat::SoftwareConfig"
12 | properties:
13 | group: ungrouped
14 | config:
15 | str_replace:
16 | params:
17 | $pip_mirror: {get_param: pip_mirror}
18 | template: |
19 | #!/bin/bash
20 | set -eux
21 |
22 | pip freeze
23 |
24 | pip install --index-url "$pip_mirror" --pre --no-deps os-collect-config os-apply-config os-refresh-config heat-cfntools
25 | pip freeze
26 | cfn-create-aws-symlinks --force
27 |
28 | configure_config_agent:
29 | type: "OS::Heat::SoftwareConfig"
30 | properties:
31 | group: ungrouped
32 | config:
33 | str_replace:
34 | params:
35 | $heat_config_script: {get_file: ../../../../../heat-agents/heat-config/os-refresh-config/configure.d/55-heat-config}
36 | $hook_script: {get_file: ../../../../../heat-agents/heat-config-script/install.d/hook-script.py}
37 | $heat_config_notify: {get_file: ../../../../../heat-agents/heat-config/bin/heat-config-notify}
38 | $occ_conf: {get_file: fragments/os-collect-config.conf}
39 | $orc_oac: {get_file: fragments/20-os-apply-config}
40 | template: {get_file: fragments/configure_config_agent.sh}
41 |
42 | install_puppet_hook:
43 | type: "OS::Heat::CloudConfig"
44 | properties:
45 | cloud_config:
46 | merge_how: dict(recurse_array)+list(append)
47 | write_files:
48 | - path: /var/lib/heat-config/hooks/puppet
49 | owner: "root:root"
50 | permissions: "0755"
51 | content: {get_file: ../../../../../heat-agents/heat-config-puppet/install.d/hook-puppet.py}
52 |
53 | install_cfn_init_hook:
54 | type: "OS::Heat::CloudConfig"
55 | properties:
56 | cloud_config:
57 | merge_how: dict(recurse_array)+list(append)
58 | write_files:
59 | - path: /var/lib/heat-config/hooks/cfn-init
60 | owner: "root:root"
61 | permissions: "0755"
62 | content: {get_file: ../../../../../heat-agents/heat-config-cfn-init/install.d/hook-cfn-init.py}
63 |
64 | start_config_agent:
65 | type: "OS::Heat::SoftwareConfig"
66 | properties:
67 | group: ungrouped
68 | config: {get_file: fragments/start_config_agent.sh}
69 |
70 | install_config_agent:
71 | type: "OS::Heat::MultipartMime"
72 | properties:
73 | parts:
74 | - config: {get_resource: install_config_agent_pip}
75 | - config: {get_resource: configure_config_agent}
76 | - config: {get_resource: install_puppet_hook}
77 | - config: {get_resource: install_cfn_init_hook}
78 | - config: {get_resource: start_config_agent}
79 |
80 | outputs:
81 | config:
82 | value: {get_resource: install_config_agent}
83 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/install_config_agent_ubuntu_pip.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | resources:
4 |
5 | install_python_build_env:
6 | type: "OS::Heat::SoftwareConfig"
7 | properties:
8 | group: ungrouped
9 | config: {get_file: fragments/install_python_build_env_apt.sh}
10 |
11 | install_config_agent_pip:
12 | type: "OS::Heat::SoftwareConfig"
13 | properties:
14 | group: ungrouped
15 | config: {get_file: fragments/install_config_agent_pip.sh}
16 |
17 | configure_config_agent:
18 | type: "OS::Heat::SoftwareConfig"
19 | properties:
20 | group: ungrouped
21 | config:
22 | str_replace:
23 | params:
24 | $heat_config_script: {get_file: ../../../../../heat-agents/heat-config/os-refresh-config/configure.d/55-heat-config}
25 | $hook_script: {get_file: ../../../../../heat-agents/heat-config-script/install.d/hook-script.py}
26 | $heat_config_notify: {get_file: ../../../../../heat-agents/heat-config/bin/heat-config-notify}
27 | $occ_conf: {get_file: fragments/os-collect-config.conf}
28 | $orc_oac: {get_file: fragments/20-os-apply-config}
29 | template: {get_file: fragments/configure_config_agent.sh}
30 |
31 | start_config_agent:
32 | type: "OS::Heat::SoftwareConfig"
33 | properties:
34 | group: ungrouped
35 | config: {get_file: fragments/start_config_agent.sh}
36 |
37 | install_config_agent:
38 | type: "OS::Heat::MultipartMime"
39 | properties:
40 | parts:
41 | - config: {get_resource: install_python_build_env}
42 | - config: {get_resource: install_config_agent_pip}
43 | - config: {get_resource: configure_config_agent}
44 | - config: {get_resource: start_config_agent}
45 |
46 | outputs:
47 | config:
48 | value: {get_resource: install_config_agent}
49 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/templates/install_container_agent.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | parameters:
4 | agent_image:
5 | type: string
6 | default: ramishra/heat-container-agent
7 |
8 | resources:
9 | write_image_pull_script:
10 | type: OS::Heat::SoftwareConfig
11 | properties:
12 | group: ungrouped
13 | config: {get_file: ./fragments/get_container_agent_image.frag}
14 |
15 | install_container_agent:
16 | type: OS::Heat::SoftwareConfig
17 | properties:
18 | group: script
19 | config:
20 | str_replace:
21 | params:
22 | $agent_image: {get_param: agent_image}
23 | template: {get_file: ./fragments/start_container_agent.sh}
24 |
25 | node_init:
26 | type: OS::Heat::MultipartMime
27 | properties:
28 | parts:
29 | - config: {get_resource: write_image_pull_script}
30 | - config: {get_resource: install_container_agent}
31 | outputs:
32 | config:
33 | value: {get_resource: node_init}
34 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/test_image_env.yaml:
--------------------------------------------------------------------------------
1 | # Installs software-config agent on boot with pip install.
2 | # It is assumed that the image has the required python build
3 | # environment so that no distro packages or pip dependencies
4 | # need to be installed.
5 | #
6 | # See hot/software-config/test-image for instructions on building a
7 | # test image to work with this environment
8 |
9 | resource_registry:
10 | "Heat::InstallConfigAgent": templates/install_config_agent_test_image.yaml
11 |
--------------------------------------------------------------------------------
/hot/software-config/boot-config/ubuntu_pip_env.yaml:
--------------------------------------------------------------------------------
1 | # Installs software-config agent on boot for ubuntu with pip install
2 |
3 | parameters:
4 | image: trusty-server-cloudimg-amd64-disk1
5 |
6 | resource_registry:
7 | "Heat::InstallConfigAgent": templates/install_config_agent_ubuntu_pip.yaml
8 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/README.rst:
--------------------------------------------------------------------------------
1 | ========================================
2 | Example software configuration templates
3 | ========================================
4 |
5 | These example templates demonstrate various aspects of using Heat's
6 | software configuration templates. The description in each template describes what
7 | that template demonstrates.
8 |
9 | See heat-templates/hot/software-config/elements/README.rst for instructions on
10 | building an image which works with these templates.
--------------------------------------------------------------------------------
/hot/software-config/example-templates/certificates/ca_1.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDiTCCAnGgAwIBAgIJAMj+Lfpqc9lLMA0GCSqGSIb3DQEBCwUAMFsxCzAJBgNV
3 | BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAlPcGVuU3RhY2sx
4 | DzANBgNVBAsMBkdsYW5jZTESMBAGA1UEAwwJR2xhbmNlIENBMB4XDTE1MDEzMTA1
5 | MzAyNloXDTI1MDEyODA1MzAyNlowWzELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNv
6 | bWUtU3RhdGUxEjAQBgNVBAoMCU9wZW5TdGFjazEPMA0GA1UECwwGR2xhbmNlMRIw
7 | EAYDVQQDDAlHbGFuY2UgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
8 | AQDcW4cRtw96/ZYsx3UB1jWWT0pAlsMQ03En7dueh9o4UZYChY2NMqTJ3gVqy1vf
9 | 4wyRU1ROb/N5L4KdQiJARH/ARbV+qrWoRvkcWBfg9w/4uZ9ZFhCBbaa2cAtTIGzV
10 | ta6HP9UPeyfXrS+jgjqU2QN3bcc0ZCMAiQbtW7Vpw8RNr0NvTJDaSCzmpGQ7TQtB
11 | 0jXm1nSG7FZUbojUCYB6TBGd01Cg8GzAai3ngXDq6foVJEwfmaV2Zapb0A4FLquX
12 | OzebskY5EL/okQGPofSRCu/ar+HV4HN3+PgIIrfa8RhDDdlv6qE1iEuS6isSH1s+
13 | 7BA2ZKfzT5t8G/8lSjKa/r2pAgMBAAGjUDBOMB0GA1UdDgQWBBT3M/WuigtS7JYZ
14 | QD0XJEDD8JSZrTAfBgNVHSMEGDAWgBT3M/WuigtS7JYZQD0XJEDD8JSZrTAMBgNV
15 | HRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCWOhC9kBZAJalQhAeNGIiiJ2bV
16 | HpvzSCEXSEAdh3A0XDK1KxoMHy1LhNGYrMmN2a+2O3SoX0FLB4p9zOifq4ACwaMD
17 | CjQeB/whsfPt5s0gV3mGMCR+V2b8r5H/30KRbIzQGXmy+/r6Wfe012jcVVXsQawW
18 | Omd4d+Bduf5iiL1OCKEMepqjQLu7Yg41ucRpUewBA+A9hoKp7jpwSnzSALX7FWEQ
19 | TBJtJ9jEnZl36S81eZJvOXSzeptHyomSAt8eGFCVuPB0dZCXuBNLu4Gsn+dIhfyj
20 | NwK4noYZXMndPwGy92KDhjxVnHzd9HwImgr6atmWhPPz5hm50BrA7sv06Nto
21 | -----END CERTIFICATE-----
22 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/certificates/ca_2.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIHADCCBOigAwIBAgIJAOjPGLL9VDhjMA0GCSqGSIb3DQEBDQUAMIGwMQswCQYD
3 | VQQGEwJVUzEOMAwGA1UECBMFVGV4YXMxDzANBgNVBAcTBkF1c3RpbjEdMBsGA1UE
4 | ChMUT3BlblN0YWNrIEZvdW5kYXRpb24xHTAbBgNVBAsTFE9wZW5TdGFjayBEZXZl
5 | bG9wZXJzMRAwDgYDVQQDEwdUZXN0IENBMTAwLgYJKoZIhvcNAQkBFiFvcGVuc3Rh
6 | Y2stZGV2QGxpc3RzLm9wZW5zdGFjay5vcmcwHhcNMTUwMTA4MDIyOTEzWhcNMjUw
7 | MTA4MDIyOTEzWjCBsDELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMQ8wDQYD
8 | VQQHEwZBdXN0aW4xHTAbBgNVBAoTFE9wZW5TdGFjayBGb3VuZGF0aW9uMR0wGwYD
9 | VQQLExRPcGVuU3RhY2sgRGV2ZWxvcGVyczEQMA4GA1UEAxMHVGVzdCBDQTEwMC4G
10 | CSqGSIb3DQEJARYhb3BlbnN0YWNrLWRldkBsaXN0cy5vcGVuc3RhY2sub3JnMIIC
11 | IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAwILIMebpHYK1E1zhyi6713GG
12 | TQ9DFeLOE1T25+XTJqAkO7efQzZfB8QwCXy/8bmbhmKgQQ7APuuDci8SKCkYeWCx
13 | qJRGmg0tZVlj5gCfrV2u+olwS+XyaOGCFkYScs6D34BaE2rGD2GDryoSPc2feAt6
14 | X4+ZkDPZnvaHQP6j9Ofq/4WmsECEas0IO5X8SDF8afA47U9ZXFkcgQK6HCHDcokL
15 | aaZxEyZFSaPex6ZAESNthkGOxEThRPxAkJhqYCeMl3Hff98XEUcFNzuAOmcnQJJg
16 | RemwJO2hS5KS3Y3p9/nBRlh3tSAG1nbY5kXSpyaq296D9x/esnXlt+9JUmn1rKyv
17 | maFBC/SbzyyQoO3MT5r8rKte0bulLw1bZOZNlhxSv2KCg5RD6vlNrnpsZszw4nj2
18 | 8fBroeFp0JMeT8jcqGs3qdm8sXLcBgiTalLYtiCNV9wZjOduQotuFN6mDwZvfa6h
19 | zZjcBNfqeLyTEnFb5k6pIla0wydWx/jvBAzoxOkEcVjak747A+p/rriD5hVUBH0B
20 | uNaWcEgKe9jcHnLvU8hUxFtgPxUHOOR+eMa+FS3ApKf9sJ/zVUq0uxyA9hUnsvnq
21 | v/CywLSvaNKBiKQTL0QLEXnw6EQb7g/XuwC5mmt+l30wGh9M1U/QMaU/+YzT4sVL
22 | TXIHJ7ExRTbEecbNbjsCAwEAAaOCARkwggEVMB0GA1UdDgQWBBQTWz2WEB0sJg9c
23 | xfM5JeJMIAJq0jCB5QYDVR0jBIHdMIHagBQTWz2WEB0sJg9cxfM5JeJMIAJq0qGB
24 | tqSBszCBsDELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMQ8wDQYDVQQHEwZB
25 | dXN0aW4xHTAbBgNVBAoTFE9wZW5TdGFjayBGb3VuZGF0aW9uMR0wGwYDVQQLExRP
26 | cGVuU3RhY2sgRGV2ZWxvcGVyczEQMA4GA1UEAxMHVGVzdCBDQTEwMC4GCSqGSIb3
27 | DQEJARYhb3BlbnN0YWNrLWRldkBsaXN0cy5vcGVuc3RhY2sub3JnggkA6M8Ysv1U
28 | OGMwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOCAgEAIfAD6uVorT5WomG1
29 | 2DWRm3kuwa+EDimgVF6VRvxCzyHx7e/6KJQj149KpMQ6e0ZPjqQw+pZ+jJSgq6TP
30 | MEjCHgIDwdKhi9LmQWIlo8xdzgfZW2VQkVLvwkqAnWWhCy9oGc/Ypk8pjiZfCx+/
31 | DSJBbFnopI9f8epAKMq7N3jJyEMoTctzmI0KckrZnJ1Gq4MZpoxGmkJiGhWoUk8p
32 | r8apXZ6B1DzO1XxpGw2BIcrUC3bQS/vPrg5/XbyaAu2BSgu6iF7ULqkBsEd0yK/L
33 | i2gO9eTacaX3zJBQOlMJFsIAgIiVw6Rq6BuhU9zxDoopY4feta/NDOpk1OjY3MV7
34 | 4rcLTU6XYaItMDRe+dmjBOK+xspsaCU4kHEkA7mHL5YZhEEWLHj6QY8tAiIQMVQZ
35 | RuTpQIbNkjLW8Ls+CbwL2LkUFB19rKu9tFpzEJ1IIeFmt5HZsL5ri6W2qkSPIbIe
36 | Qq15kl/a45jgBbgn2VNA5ecjW20hhXyaS9AKWXK+AeFBaFIFDUrB2UP4YSDbJWUJ
37 | 0LKe+QuumXdl+iRdkgb1Tll7qme8gXAeyzVGHK2AsaBg+gkEeSyVLRKIixceyy+3
38 | 6yqlKJhk2qeV3ceOfVm9ZdvRlzWyVctaTcGIpDFqf4y8YyVhL1e2KGKcmYtbLq+m
39 | rtku4CM3HldxcM4wqSB1VcaTX8o=
40 | -----END CERTIFICATE-----
41 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/cirros-example/README.rst:
--------------------------------------------------------------------------------
1 | =====================
2 | Simple Cirros example
3 | =====================
4 |
5 | This directory contains a very simple proof-of-concept hook script and
6 | template which shows how you can use SoftwareDeployment resources with
7 | a cirros image (which doesn't contain cloud-init or python), which may
8 | be useful for testing.
9 |
10 | Since cirros images don't currently support multi-part mime user-data,
11 | it's necessary to inject the hook script to the image and upload the
12 | modified image to glance:
13 |
14 | 1. wget http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
15 | 2. virt-copy-in -a cirros-0.3.2-x86_64-disk.img init.d/heat-deploy-hook /etc/init.d
16 | 3. virt-copy-in -a cirros-0.3.2-x86_64-disk.img rc3.d/S99-heat-deploy-hook /etc/rc3.d
17 | 4. openstack image create cirros-0.3.2-sc --disk-format=qcow2 --container-format=bare < cirros-0.3.2-x86_64-disk.img
18 | 5. openstack stack create sc1 -t cirros-hello-world.yaml --parameter "image=cirros-0.3.2-sc"
19 |
20 | *NOTE*: The hook script is very basic and has a number of TODO items related to
21 | security and functionality - please don't use it for "real" deployments, it's
22 | intended to enable easier testing and for developer experimentation only.
23 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/cirros-example/cirros-hello-world.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | This template demonstrates a minimal SoftwareDeployment example
5 |
6 | parameters:
7 | key_name:
8 | type: string
9 | default: stack_key
10 | flavor:
11 | type: string
12 | default: m1.small
13 | image:
14 | type: string
15 |
16 | resources:
17 | sc:
18 | type: OS::Heat::SoftwareConfig
19 | properties:
20 | inputs:
21 | - name: message
22 | default: 'NONE'
23 | outputs:
24 | - name: file_content
25 | group: script
26 | config: |
27 | #!/bin/sh
28 | echo "${message}" > /hello
29 | cat /hello > ${heat_outputs_path}.file_content
30 |
31 | sd:
32 | type: OS::Heat::SoftwareDeployment
33 | properties:
34 | config: {get_resource: sc}
35 | server: {get_resource: server}
36 | signal_transport: HEAT_SIGNAL
37 | input_values:
38 | message: 'Hello, world!'
39 |
40 | server:
41 | type: OS::Nova::Server
42 | properties:
43 | image: {get_param: image}
44 | flavor: {get_param: flavor}
45 | key_name: {get_param: key_name}
46 | user_data_format: SOFTWARE_CONFIG
47 | software_config_transport: POLL_SERVER_HEAT
48 |
49 | outputs:
50 | deploy_output:
51 | value:
52 | get_attr: [sd, file_content]
53 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/cirros-example/rc3.d/S99-heat-deploy-hook:
--------------------------------------------------------------------------------
1 | ../init.d/heat-deploy-hook
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-ansible-template.ansible:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Hello Ansible - quick start
3 | connection: local
4 | hosts: localhost
5 |
6 | tasks:
7 | - name: Hello touch_file
8 | shell: echo {{ foo }} >> /tmp/{{ bar }}
9 |
10 | - name: Hello echo
11 | shell: echo "The file /tmp/{{ bar }} contains {{ foo }}" >> {{ heat_outputs_path }}.result
12 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-ca-certs-config.yml:
--------------------------------------------------------------------------------
1 | #cloud-config
2 | #
3 | # This is an example file to configure an instance's trusted CA certificates
4 | # system-wide for SSL/TLS trust establishment when the instance boots for the
5 | # first time.
6 | #
7 | # Make sure that this file is valid yaml before starting instances.
8 | # It should be passed as user-data when starting the instance.
9 |
10 | ca-certs:
11 | # If present and set to True, the 'remove-defaults' parameter will remove
12 | # all the default trusted CA certificates that are normally shipped with
13 | # Ubuntu.
14 | # This is mainly for paranoid admins - most users will not need this
15 | # functionality.
16 | remove-defaults: true
17 |
18 | # If present, the 'trusted' parameter should contain a certificate (or list
19 | # of certificates) to add to the system as trusted CA certificates.
20 | # Pay close attention to the YAML multiline list syntax. The example shown
21 | # here is for a list of multiline certificates.
22 | trusted:
23 | - |
24 | -----BEGIN CERTIFICATE-----
25 | MIIDiTCCAnGgAwIBAgIJAMj+Lfpqc9lLMA0GCSqGSIb3DQEBCwUAMFsxCzAJBgNV
26 | BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAlPcGVuU3RhY2sx
27 | DzANBgNVBAsMBkdsYW5jZTESMBAGA1UEAwwJR2xhbmNlIENBMB4XDTE1MDEzMTA1
28 | MzAyNloXDTI1MDEyODA1MzAyNlowWzELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNv
29 | bWUtU3RhdGUxEjAQBgNVBAoMCU9wZW5TdGFjazEPMA0GA1UECwwGR2xhbmNlMRIw
30 | EAYDVQQDDAlHbGFuY2UgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
31 | AQDcW4cRtw96/ZYsx3UB1jWWT0pAlsMQ03En7dueh9o4UZYChY2NMqTJ3gVqy1vf
32 | 4wyRU1ROb/N5L4KdQiJARH/ARbV+qrWoRvkcWBfg9w/4uZ9ZFhCBbaa2cAtTIGzV
33 | ta6HP9UPeyfXrS+jgjqU2QN3bcc0ZCMAiQbtW7Vpw8RNr0NvTJDaSCzmpGQ7TQtB
34 | 0jXm1nSG7FZUbojUCYB6TBGd01Cg8GzAai3ngXDq6foVJEwfmaV2Zapb0A4FLquX
35 | OzebskY5EL/okQGPofSRCu/ar+HV4HN3+PgIIrfa8RhDDdlv6qE1iEuS6isSH1s+
36 | 7BA2ZKfzT5t8G/8lSjKa/r2pAgMBAAGjUDBOMB0GA1UdDgQWBBT3M/WuigtS7JYZ
37 | QD0XJEDD8JSZrTAfBgNVHSMEGDAWgBT3M/WuigtS7JYZQD0XJEDD8JSZrTAMBgNV
38 | HRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCWOhC9kBZAJalQhAeNGIiiJ2bV
39 | HpvzSCEXSEAdh3A0XDK1KxoMHy1LhNGYrMmN2a+2O3SoX0FLB4p9zOifq4ACwaMD
40 | CjQeB/whsfPt5s0gV3mGMCR+V2b8r5H/30KRbIzQGXmy+/r6Wfe012jcVVXsQawW
41 | Omd4d+Bduf5iiL1OCKEMepqjQLu7Yg41ucRpUewBA+A9hoKp7jpwSnzSALX7FWEQ
42 | TBJtJ9jEnZl36S81eZJvOXSzeptHyomSAt8eGFCVuPB0dZCXuBNLu4Gsn+dIhfyj
43 | NwK4noYZXMndPwGy92KDhjxVnHzd9HwImgr6atmWhPPz5hm50BrA7sv06Nto
44 | -----END CERTIFICATE-----
45 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-container-config.pod:
--------------------------------------------------------------------------------
1 | version: v1beta2
2 | containers:
3 | - name: hello_world
4 | image: fedora
5 | command: ['/bin/sh', '-c', 'while true; do echo fedora world; sleep 1; done']
6 | workingDir:
7 | volumeMounts:
8 | - name: data
9 | mountPath: /data
10 | readOnly: true
11 | ports:
12 | - name: http_port
13 | containerPort: 80
14 | hostPort: 8081
15 | protocol: tcp
16 | env:
17 | - name: GOPATH
18 | value: /mnt
19 | - name: other_world
20 | image: ubuntu
21 | command: ['/bin/sh', '-c', 'while true; do echo ubuntu world; sleep 1; done']
22 | workingDir:
23 | volumeMounts:
24 | - name: data
25 | mountPath: /data
26 | readOnly: false
27 | ports:
28 | - name: http_port
29 | containerPort: 80
30 | hostPort: 8082
31 | protocol: tcp
32 | env:
33 | - name: GOPATH
34 | value: /mnt
35 | volumes:
36 | - name: data
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-docker-compose.yml:
--------------------------------------------------------------------------------
1 | busybox:
2 | env_file: ./busybox.env
3 | image: busybox
4 | command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!']
5 | ports:
6 | - 8080:8080
7 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-puppet-manifest.pp:
--------------------------------------------------------------------------------
1 | file { 'barfile':
2 | ensure => file,
3 | mode => '0644',
4 | path => "/tmp/$::bar",
5 | content => "$::foo",
6 | }
7 |
8 | file { 'output_result':
9 | ensure => file,
10 | path => "$::heat_outputs_path.result",
11 | mode => '0644',
12 | content => "The file /tmp/$::bar contains $::foo",
13 | }
14 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-salt-state.sls:
--------------------------------------------------------------------------------
1 | testsls:
2 | pkg.installed:
3 | {% if grains['os_family'] == 'RedHat' %}
4 | - name: {{ pillar['master']['pkg-redhat'] }}
5 | {% elif grains['os_family'] == 'Debian' %}
6 | - name: {{ pillar['master']['pkg-apache'] }}
7 | {% endif %}
--------------------------------------------------------------------------------
/hot/software-config/example-templates/config-scripts/example-script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -x
2 | echo "Writing to /tmp/$bar"
3 | echo $foo > /tmp/$bar
4 | echo -n "The file /tmp/$bar contains `cat /tmp/$bar` for server $deploy_server_id during $deploy_action" > $heat_outputs_path.result
5 | echo "Written to /tmp/$bar"
6 | echo "Output to stderr" 1>&2
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-ansible-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | parameters:
3 | key_name:
4 | type: string
5 | default: test_key
6 | flavor:
7 | type: string
8 | default: m1.heat
9 | image:
10 | type: string
11 | default: fedora-software-config
12 |
13 | resources:
14 | the_sg:
15 | type: OS::Neutron::SecurityGroup
16 | properties:
17 | name: the_sg
18 | description: Ping and SSH
19 | rules:
20 | - protocol: icmp
21 | - protocol: tcp
22 | port_range_min: 22
23 | port_range_max: 22
24 |
25 | config:
26 | type: OS::Heat::SoftwareConfig
27 | properties:
28 | group: ansible
29 | inputs:
30 | - name: foo
31 | - name: bar
32 | outputs:
33 | - name: result
34 | config:
35 | get_file: config-scripts/example-ansible-template.ansible
36 |
37 | deployment:
38 | type: OS::Heat::SoftwareDeployment
39 | properties:
40 | config:
41 | get_resource: config
42 | server:
43 | get_resource: server
44 | input_values:
45 | foo: fooooo
46 | bar: baaaaa
47 |
48 | other_deployment:
49 | type: OS::Heat::SoftwareDeployment
50 | properties:
51 | config:
52 | get_resource: config
53 | server:
54 | get_resource: server
55 | input_values:
56 | foo: fu
57 | bar: barmy
58 | actions:
59 | - CREATE
60 | - UPDATE
61 | - SUSPEND
62 | - RESUME
63 |
64 | server:
65 | type: OS::Nova::Server
66 | properties:
67 | image: {get_param: image}
68 | flavor: {get_param: flavor}
69 | key_name: {get_param: key_name}
70 | security_groups:
71 | - {get_resource: the_sg}
72 | user_data_format: SOFTWARE_CONFIG
73 |
74 | outputs:
75 | result:
76 | value:
77 | get_attr: [deployment, result]
78 | stdout:
79 | value:
80 | get_attr: [deployment, deploy_stdout]
81 | stderr:
82 | value:
83 | get_attr: [deployment, deploy_stderr]
84 | status_code:
85 | value:
86 | get_attr: [deployment, deploy_status_code]
87 | other_result:
88 | value:
89 | get_attr: [other_deployment, result]
90 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-cfn-init-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | parameters:
3 | key_name:
4 | type: string
5 | flavor:
6 | type: string
7 | image:
8 | type: string
9 | default: fedora-software-config
10 |
11 | resources:
12 | the_sg:
13 | type: OS::Neutron::SecurityGroup
14 | properties:
15 | name: the_sg
16 | description: Ping and SSH
17 | rules:
18 | - protocol: icmp
19 | - protocol: tcp
20 | port_range_min: 22
21 | port_range_max: 22
22 |
23 | config:
24 | type: OS::Heat::StructuredConfig
25 | properties:
26 | group: cfn-init
27 | inputs:
28 | - name: bar
29 | config:
30 | config:
31 | files:
32 | /tmp/foo:
33 | content:
34 | get_input: bar
35 | mode: '000644'
36 |
37 | check_tmp_foo:
38 | type: OS::Heat::SoftwareConfig
39 | properties:
40 | group: script
41 | outputs:
42 | - name: result
43 | config: |
44 | #!/bin/sh
45 | echo -n "The file /tmp/foo contains `cat /tmp/foo` for server $deploy_server_id during $deploy_action" > $heat_outputs_path.result
46 |
47 | deployment:
48 | type: OS::Heat::StructuredDeployment
49 | properties:
50 | name: 10_deployment
51 | signal_transport: NO_SIGNAL
52 | config:
53 | get_resource: config
54 | server:
55 | get_resource: server
56 | input_values:
57 | bar: baaaaa
58 |
59 | other_deployment:
60 | type: OS::Heat::StructuredDeployment
61 | properties:
62 | name: 20_other_deployment
63 | signal_transport: NO_SIGNAL
64 | config:
65 | get_resource: config
66 | server:
67 | get_resource: server
68 | input_values:
69 | bar: barmy
70 | actions:
71 | - CREATE
72 | - UPDATE
73 | - SUSPEND
74 | - RESUME
75 |
76 | deploy_check_tmp_foo:
77 | type: OS::Heat::SoftwareDeployment
78 | properties:
79 | name: 30_deploy_check_tmp_foo
80 | config:
81 | get_resource: check_tmp_foo
82 | server:
83 | get_resource: server
84 |
85 | server:
86 | type: OS::Nova::Server
87 | properties:
88 | image: {get_param: image}
89 | flavor: {get_param: flavor}
90 | key_name: {get_param: key_name}
91 | security_groups:
92 | - {get_resource: the_sg}
93 | user_data_format: SOFTWARE_CONFIG
94 |
95 | outputs:
96 | result:
97 | value:
98 | get_attr: [deploy_check_tmp_foo, result]
99 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-chef-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 |
3 | parameters:
4 |
5 | key_name:
6 | type: string
7 |
8 | flavor:
9 | type: string
10 | default: m1.small
11 |
12 | image:
13 | type: string
14 | default: fedora-software-config
15 |
16 | resources:
17 |
18 | the_sg:
19 | type: OS::Neutron::SecurityGroup
20 | properties:
21 | name: the_sg
22 | description: Ping and SSH
23 | rules:
24 | - protocol: icmp
25 | - protocol: tcp
26 | port_range_min: 22
27 | port_range_max: 22
28 |
29 | structured_config:
30 | type: OS::Heat::StructuredConfig
31 | properties:
32 | group: chef
33 | inputs:
34 | - name: nginx-pkg
35 | type: Json
36 | config:
37 | - "recipe[nginx-pkg]"
38 | options:
39 | kitchen: "https://github.com/st-isidore-de-seville/cookbook-nginx-pkg.git"
40 | kitchen_path: "/opt/heat/chef"
41 |
42 | deployment:
43 | type: OS::Heat::StructuredDeployment
44 | properties:
45 | config:
46 | get_resource: structured_config
47 | server:
48 | get_resource: server
49 | input_values:
50 | nginx-pkg:
51 | package:
52 | name: nginx
53 |
54 | server:
55 | type: OS::Nova::Server
56 | properties:
57 | image: {get_param: image}
58 | flavor: {get_param: flavor}
59 | key_name: {get_param: key_name}
60 | security_groups:
61 | - {get_resource: the_sg}
62 | user_data_format: SOFTWARE_CONFIG
63 |
64 | outputs:
65 |
66 | status_code_deployment:
67 | value:
68 | get_attr: [deployment, deploy_status_code]
69 |
70 | stdout:
71 | value:
72 | get_attr: [deployment, deploy_stdout]
73 |
74 | stderr:
75 | value:
76 | get_attr: [deployment, deploy_stderr]
77 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-cloud-init-configure-ca-cert.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: newton
2 | description: >
3 | This template demonstrates the different ways to configure
4 | an instance's trusted CA certificates when the instance boots
5 | for the first time.
6 | parameters:
7 | key_name:
8 | type: string
9 | flavor:
10 | type: string
11 | image:
12 | type: string
13 | default: ubuntu-software-config
14 |
15 | resources:
16 | the_sg:
17 | type: OS::Neutron::SecurityGroup
18 | properties:
19 | name: the_sg
20 | description: Ping and SSH
21 | rules:
22 | - protocol: icmp
23 | - protocol: tcp
24 | port_range_min: 22
25 | port_range_max: 22
26 |
27 | ca_1_init:
28 | type: OS::Heat::CloudConfig
29 | properties:
30 | cloud_config:
31 | ca-certs:
32 | trusted:
33 | - {get_file: certificates/ca_1.crt}
34 |
35 | ca_2_init:
36 | type: OS::Heat::CloudConfig
37 | properties:
38 | cloud_config:
39 | ca-certs:
40 | trusted:
41 | - {get_file: certificates/ca_2.crt}
42 |
43 | server_1_init:
44 | type: OS::Heat::MultipartMime
45 | properties:
46 | parts:
47 | - config: {get_resource: ca_1_init}
48 |
49 | server_one:
50 | type: OS::Nova::Server
51 | properties:
52 | image: {get_param: image}
53 | flavor: {get_param: flavor}
54 | key_name: {get_param: key_name}
55 | security_groups:
56 | - {get_resource: the_sg}
57 | user_data_format: SOFTWARE_CONFIG
58 | user_data:
59 | get_resource: server_1_init
60 |
61 | server_two:
62 | type: OS::Nova::Server
63 | properties:
64 | image: {get_param: image}
65 | flavor: {get_param: flavor}
66 | key_name: {get_param: key_name}
67 | security_groups:
68 | - {get_resource: the_sg}
69 | user_data_format: RAW
70 | user_data: {get_resource: ca_2_init}
71 |
72 | server_three:
73 | type: OS::Nova::Server
74 | properties:
75 | image: {get_param: image}
76 | flavor: {get_param: flavor}
77 | key_name: {get_param: key_name}
78 | security_groups:
79 | - {get_resource: the_sg}
80 | user_data_format: RAW
81 | user_data: {get_file: config-scripts/example-ca-certs-config.yml}
82 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-config-pristine-image_env.yaml:
--------------------------------------------------------------------------------
1 | # Defines a Heat::InstallConfigAgent config resource which performs no config.
2 | # This environment can be used when the image already has the required agents
3 | # installed and configured.
4 | #
5 | # See heat-templates/hot/software-config/boot-config for environments
6 | # for different distros and install methods
7 | resource_registry:
8 | "Heat::InstallConfigAgent": "OS::Heat::SoftwareConfig"
9 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-kubelet-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 | parameters:
3 | key_name:
4 | type: string
5 | default: heat_key
6 | flavor:
7 | type: string
8 | default: m1.small
9 | image:
10 | type: string
11 | default: fedora-software-config
12 | private_net:
13 | type: string
14 | default: private
15 | public_net:
16 | type: string
17 | default: public
18 |
19 | resources:
20 | the_sg:
21 | type: OS::Neutron::SecurityGroup
22 | properties:
23 | name: the_sg
24 | description: Ping and SSH
25 | rules:
26 | - protocol: icmp
27 | - protocol: tcp
28 | port_range_min: 22
29 | port_range_max: 22
30 | - protocol: tcp
31 | port_range_min: 8080
32 | port_range_max: 8080
33 |
34 | kubelet_config:
35 | type: OS::Heat::StructuredConfig
36 | properties:
37 | group: kubelet
38 | options:
39 | images_timeout: 600
40 | containers_timeout: 120
41 | poll_period: 10
42 | config:
43 | version: v1beta2
44 | containers:
45 | - name: simple-echo
46 | image: busybox
47 | command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!']
48 | ports:
49 | - name: nc-echo
50 | hostPort: 8080
51 | containerPort: 8080
52 |
53 | kubelet_deployment:
54 | type: OS::Heat::SoftwareDeployment
55 | properties:
56 | name: kubelet_deployment
57 | config:
58 | get_resource: kubelet_config
59 | server:
60 | get_resource: server
61 |
62 | server:
63 | type: OS::Nova::Server
64 | properties:
65 | image: {get_param: image}
66 | flavor: {get_param: flavor}
67 | key_name: {get_param: key_name}
68 | security_groups:
69 | - {get_resource: the_sg}
70 | user_data_format: SOFTWARE_CONFIG
71 |
72 | server_floating_ip_assoc:
73 | type: OS::Neutron::FloatingIPAssociation
74 | properties:
75 | floatingip_id: {get_resource: floating_ip}
76 | port_id: {get_attr: [server, addresses, {get_param: private_net}, 0, port]}
77 |
78 | floating_ip:
79 | type: OS::Neutron::FloatingIP
80 | properties:
81 | floating_network: {get_param: public_net}
82 |
83 | outputs:
84 | status_code_deployment:
85 | value:
86 | get_attr: [kubelet_deployment, deploy_status_code]
87 | stdout:
88 | value:
89 | get_attr: [kubelet_deployment, deploy_stdout]
90 | stderr:
91 | value:
92 | get_attr: [kubelet_deployment, deploy_stderr]
93 | server_floating_ip:
94 | value:
95 | get_attr: [floating_ip, floating_ip_address]
96 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-os-apply-config-plus-cloud-config.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | description: >
3 | This template demonstrates how to use OS::Heat::StructuredDeployment
4 | to apply config via os-apply-config. Note this requires your image to
5 | be built with the ntp element added (not included in the instructions
6 | in this repo by default, you'll have to add it and rebuild).
7 | This example includes additional configuration of cloud-init via
8 | the user-data in addition to the StructuredDeployment
9 | parameters:
10 | key_name:
11 | type: string
12 | default: default
13 | flavor:
14 | type: string
15 | default: m1.small
16 | image:
17 | type: string
18 | default: heat-functional-tests-image
19 | ntp_server:
20 | type: string
21 | default: 0.uk.pool.ntp.org
22 |
23 | resources:
24 | config:
25 | type: OS::Heat::StructuredConfig
26 | properties:
27 | group: os-apply-config
28 | config:
29 | ntp:
30 | servers:
31 | - {server: {get_param: ntp_server}}
32 |
33 | deployment:
34 | type: OS::Heat::StructuredDeployment
35 | properties:
36 | config:
37 | get_resource: config
38 | server:
39 | get_resource: server
40 |
41 |
42 | cloud_init_userdata:
43 | type: OS::Heat::MultipartMime
44 | properties:
45 | parts:
46 | - config: {get_resource: cloud_config}
47 |
48 | cloud_config:
49 | type: OS::Heat::CloudConfig
50 | properties:
51 | cloud_config:
52 | write_files:
53 | - path: /tmp/one
54 | content: "The one is bar"
55 |
56 | server:
57 | type: OS::Nova::Server
58 | properties:
59 | image: {get_param: image}
60 | flavor: {get_param: flavor}
61 | key_name: {get_param: key_name}
62 | user_data_format: SOFTWARE_CONFIG
63 | user_data:
64 | get_resource: cloud_init_userdata
65 |
66 |
67 | outputs:
68 | server_ip:
69 | description: IP Address of server.
70 | value: { get_attr: [server, first_address] }
71 | deployment_status:
72 | description: Status code of configuration execution.
73 | value: { get_attr: [deployment, deploy_status_code] }
74 | deployment_stdout:
75 | description: Standard output captured from the configuration execution.
76 | value: { get_attr: [deployment, deploy_stdout] }
77 | deployment_stderr:
78 | description: Standard error captured from the configuration execution.
79 | value: { get_attr: [deployment, deploy_stderr] }
80 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-os-apply-config.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | description: >
3 | This template demonstrates how to use OS::Heat::StructuredDeployment
4 | to apply config via os-apply-config. Note this requires your image to
5 | be built with the ntp element added (not included in the instructions
6 | in this repo by default, you'll have to add it and rebuild).
7 | parameters:
8 | key_name:
9 | type: string
10 | default: default
11 | flavor:
12 | type: string
13 | default: m1.small
14 | image:
15 | type: string
16 | default: fedora-software-config
17 | ntp_server:
18 | type: string
19 | default: 0.uk.pool.ntp.org
20 |
21 | resources:
22 | config:
23 | type: OS::Heat::StructuredConfig
24 | properties:
25 | group: os-apply-config
26 | config:
27 | ntp:
28 | servers:
29 | - {server: {get_param: ntp_server}}
30 |
31 | deployment:
32 | type: OS::Heat::StructuredDeployment
33 | properties:
34 | config:
35 | get_resource: config
36 | server:
37 | get_resource: server
38 |
39 | server:
40 | type: OS::Nova::Server
41 | properties:
42 | image: {get_param: image}
43 | flavor: {get_param: flavor}
44 | key_name: {get_param: key_name}
45 | user_data_format: SOFTWARE_CONFIG
46 |
47 | outputs:
48 | server_ip:
49 | description: IP Address of server.
50 | value: { get_attr: [server, first_address] }
51 | deployment_status:
52 | description: Status code of configuration execution.
53 | value: { get_attr: [deployment, deploy_status_code] }
54 | deployment_stdout:
55 | description: Standard output captured from the configuration execution.
56 | value: { get_attr: [deployment, deploy_stdout] }
57 | deployment_stderr:
58 | description: Standard error captured from the configuration execution.
59 | value: { get_attr: [deployment, deploy_stderr] }
60 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-pristine-atomic-docker-compose.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 | description: >
3 | A template which demonstrates doing boot-time deployment of docker
4 | container with docker-compose agent.
5 | This template expects to be created with an environment which defines
6 | the resource type Heat::InstallConfigAgent such as
7 | ../boot-config/heat_container_agent_env.yaml
8 | parameters:
9 | key_name:
10 | type: string
11 | default: heat_key
12 | flavor:
13 | type: string
14 | default: m1.small
15 | image:
16 | type: string
17 | default: fedora-atomic
18 | private_net:
19 | type: string
20 | default: private
21 | public_net:
22 | type: string
23 | default: public
24 |
25 | resources:
26 | the_sg:
27 | type: OS::Neutron::SecurityGroup
28 | properties:
29 | name: the_sg
30 | description: Ping and SSH
31 | rules:
32 | - protocol: icmp
33 | - protocol: tcp
34 | port_range_min: 22
35 | port_range_max: 22
36 | - protocol: tcp
37 | port_range_min: 5000
38 | port_range_max: 5000
39 |
40 | config:
41 | type: OS::Heat::StructuredConfig
42 | properties:
43 | group: docker-compose
44 | config:
45 | web:
46 | image: training/webapp
47 | ports:
48 | - 5000:5000
49 |
50 | deployment:
51 | type: OS::Heat::StructuredDeployment
52 | properties:
53 | name: test_deployment
54 | config:
55 | get_resource: config
56 | server:
57 | get_resource: server
58 |
59 | boot_config:
60 | type: Heat::InstallConfigAgent
61 |
62 | server:
63 | type: OS::Nova::Server
64 | properties:
65 | image: {get_param: image}
66 | flavor: {get_param: flavor}
67 | key_name: {get_param: key_name}
68 | networks:
69 | - network: {get_param: private_net}
70 | security_groups:
71 | - {get_resource: the_sg}
72 | user_data_format: SOFTWARE_CONFIG
73 | user_data: {get_attr: [boot_config, config]}
74 |
75 | server_floating_ip_assoc:
76 | type: OS::Neutron::FloatingIPAssociation
77 | properties:
78 | floatingip_id: {get_resource: floating_ip}
79 | port_id: {get_attr: [server, addresses, {get_param: private_net}, 0, port]}
80 |
81 | floating_ip:
82 | type: OS::Neutron::FloatingIP
83 | properties:
84 | floating_network: {get_param: public_net}
85 |
86 | outputs:
87 | result:
88 | value:
89 | get_attr: [deployment, result]
90 | stdout:
91 | value:
92 | get_attr: [deployment, deploy_stdout]
93 | stderr:
94 | value:
95 | get_attr: [deployment, deploy_stderr]
96 | status_code:
97 | value:
98 | get_attr: [deployment, deploy_status_code]
99 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-pristine-atomic-docker-compose_env.yaml:
--------------------------------------------------------------------------------
1 | # Defines a Heat::InstallConfigAgent config resource which performs no config.
2 | # This environment can be used when the image already has the required agents
3 | # installed and configured.
4 | #
5 | resource_registry:
6 | "Heat::InstallConfigAgent": "OS::Heat::SoftwareConfig"
7 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-pristine-atomic-tool.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2014-10-16
2 | description: >
3 | A template which demonstrates doing boot-time deployment of docker
4 | container with atomic tool.
5 | This template expects to be created with an environment which defines
6 | the resource type Heat::InstallConfigAgent such as
7 | ../boot-config/container_agent_env.yaml
8 | parameters:
9 | key_name:
10 | type: string
11 | default: heat_key
12 | flavor:
13 | type: string
14 | default: m1.small
15 | image:
16 | type: string
17 | default: rhel-atomic
18 | private_net:
19 | type: string
20 | default: private
21 | public_net:
22 | type: string
23 | default: public
24 | resources:
25 | atomic_install_config:
26 | type: OS::Heat::StructuredConfig
27 | properties:
28 | group: atomic
29 | config:
30 | command: install
31 | image: imain/atomic-install-rabbitmq
32 |
33 | atomic_install_deployment:
34 | type: OS::Heat::StructuredDeployment
35 | properties:
36 | name: atomic_deployment
37 | config:
38 | get_resource: atomic_install_config
39 | server:
40 | get_resource: server
41 |
42 | boot_config:
43 | type: Heat::InstallConfigAgent
44 |
45 | server:
46 | type: OS::Nova::Server
47 | properties:
48 | image: {get_param: image}
49 | flavor: {get_param: flavor}
50 | key_name: {get_param: key_name}
51 | networks:
52 | - network: {get_param: private_net}
53 | user_data_format: SOFTWARE_CONFIG
54 | user_data: {get_attr: [boot_config, config]}
55 |
56 | outputs:
57 | result:
58 | value:
59 | get_attr: [atomic_install_deployment, result]
60 | stdout:
61 | value:
62 | get_attr: [atomic_install_deployment, deploy_stdout]
63 | stderr:
64 | value:
65 | get_attr: [atomic_install_deployment, deploy_stderr]
66 | status_code:
67 | value:
68 | get_attr: [atomic_install_deployment, deploy_status_code]
69 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-pristine-atomic-tool_env.yaml:
--------------------------------------------------------------------------------
1 | resource_registry:
2 | "Heat::InstallConfigAgent": ../boot-config/templates/install_container_agent.yaml
3 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-puppet-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | parameters:
3 | key_name:
4 | type: string
5 | flavor:
6 | type: string
7 | image:
8 | type: string
9 | default: fedora-software-config
10 |
11 | resources:
12 | the_sg:
13 | type: OS::Neutron::SecurityGroup
14 | properties:
15 | name: the_sg
16 | description: Ping and SSH
17 | rules:
18 | - protocol: icmp
19 | - protocol: tcp
20 | port_range_min: 22
21 | port_range_max: 22
22 |
23 | config:
24 | type: OS::Heat::SoftwareConfig
25 | properties:
26 | group: puppet
27 | inputs:
28 | - name: foo
29 | - name: bar
30 | outputs:
31 | - name: result
32 | config:
33 | get_file: config-scripts/example-puppet-manifest.pp
34 |
35 | deployment:
36 | type: OS::Heat::SoftwareDeployment
37 | properties:
38 | config:
39 | get_resource: config
40 | server:
41 | get_resource: server
42 | input_values:
43 | foo: fooooo
44 | bar: baaaaa
45 |
46 | other_deployment:
47 | type: OS::Heat::SoftwareDeployment
48 | properties:
49 | config:
50 | get_resource: config
51 | server:
52 | get_resource: server
53 | input_values:
54 | foo: fu
55 | bar: barmy
56 | actions:
57 | - CREATE
58 | - UPDATE
59 | - SUSPEND
60 | - RESUME
61 |
62 | server:
63 | type: OS::Nova::Server
64 | properties:
65 | image: {get_param: image}
66 | flavor: {get_param: flavor}
67 | key_name: {get_param: key_name}
68 | security_groups:
69 | - {get_resource: the_sg}
70 | user_data_format: SOFTWARE_CONFIG
71 |
72 | outputs:
73 | result:
74 | value:
75 | get_attr: [deployment, result]
76 | stdout:
77 | value:
78 | get_attr: [deployment, deploy_stdout]
79 | stderr:
80 | value:
81 | get_attr: [deployment, deploy_stderr]
82 | status_code:
83 | value:
84 | get_attr: [deployment, deploy_status_code]
85 | other_result:
86 | value:
87 | get_attr: [other_deployment, result]
88 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-salt-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | parameters:
3 | key_name:
4 | type: string
5 | flavor:
6 | type: string
7 | default: m1.small
8 | image:
9 | type: string
10 | default: fedora-software-config
11 |
12 | resources:
13 | the_sg:
14 | type: OS::Neutron::SecurityGroup
15 | properties:
16 | name: the_sg
17 | description: Ping and SSH
18 | rules:
19 | - protocol: icmp
20 | - protocol: tcp
21 | port_range_min: 22
22 | port_range_max: 22
23 |
24 | config:
25 | type: OS::Heat::SoftwareConfig
26 | properties:
27 | group: salt
28 | inputs:
29 | - name: pkg-redhat
30 | - name: pkg-debian
31 | outputs:
32 | - name: out
33 | config:
34 | get_file: config-scripts/example-salt-state.sls
35 |
36 | structured_config:
37 | type: OS::Heat::StructuredConfig
38 | properties:
39 | group: salt
40 | inputs:
41 | - name: pkg-redhat
42 | - name: svc-redhat
43 | config:
44 | inline_sls:
45 | pkg.installed:
46 | - name: {get_input: pkg-redhat}
47 | service.running:
48 | - name: {get_input: svc-redhat}
49 | - require:
50 | - pkg: {get_input: pkg-redhat}
51 |
52 | deployment:
53 | type: OS::Heat::SoftwareDeployment
54 | properties:
55 | config:
56 | get_resource: config
57 | server:
58 | get_resource: server
59 | input_values:
60 | pkg-redhat: httpd
61 | pkg-debian: apache2
62 |
63 | other_deployment:
64 | type: OS::Heat::SoftwareDeployment
65 | properties:
66 | config:
67 | get_resource: config
68 | server:
69 | get_resource: server
70 | input_values:
71 | pkg-redhat: mariadb-server
72 | pkg-debian: mysql-server
73 |
74 | structured_deployment:
75 | type: OS::Heat::StructuredDeployment
76 | properties:
77 | config:
78 | get_resource: structured_config
79 | server:
80 | get_resource: server
81 | input_values:
82 | pkg-redhat: mariadb-server
83 | svc-redhat: mysqld
84 |
85 | server:
86 | type: OS::Nova::Server
87 | properties:
88 | image: {get_param: image}
89 | flavor: {get_param: flavor}
90 | key_name: {get_param: key_name}
91 | security_groups:
92 | - {get_resource: the_sg}
93 | user_data_format: SOFTWARE_CONFIG
94 |
95 | outputs:
96 | status_code_deployment:
97 | value:
98 | get_attr: [deployment, deploy_status_code]
99 | status_code_other_deployment:
100 | value:
101 | get_attr: [other_deployment, deploy_status_code]
102 | status_code_structured_deployment:
103 | value:
104 | get_attr: [structured_deployment, deploy_status_code]
105 | stdout:
106 | value:
107 | get_attr: [deployment, deploy_stdout]
108 | stderr:
109 | value:
110 | get_attr: [deployment, deploy_stderr]
111 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-script-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | parameters:
3 | key_name:
4 | type: string
5 | flavor:
6 | type: string
7 | image:
8 | type: string
9 | default: fedora-software-config
10 |
11 | resources:
12 | the_sg:
13 | type: OS::Neutron::SecurityGroup
14 | properties:
15 | name: the_sg
16 | description: Ping and SSH
17 | rules:
18 | - protocol: icmp
19 | - protocol: tcp
20 | port_range_min: 22
21 | port_range_max: 22
22 |
23 | config:
24 | type: OS::Heat::SoftwareConfig
25 | properties:
26 | group: script
27 | inputs:
28 | - name: foo
29 | - name: bar
30 | outputs:
31 | - name: result
32 | config:
33 | get_file: config-scripts/example-script.sh
34 |
35 | deployment:
36 | type: OS::Heat::SoftwareDeployment
37 | properties:
38 | config:
39 | get_resource: config
40 | server:
41 | get_resource: server
42 | input_values:
43 | foo: fooooo
44 | bar: baaaaa
45 |
46 | other_deployment:
47 | type: OS::Heat::SoftwareDeployment
48 | properties:
49 | config:
50 | get_resource: config
51 | server:
52 | get_resource: server
53 | input_values:
54 | foo: fu
55 | bar: barmy
56 | actions:
57 | - CREATE
58 | - UPDATE
59 | - SUSPEND
60 | - RESUME
61 |
62 | server:
63 | type: OS::Nova::Server
64 | properties:
65 | image: {get_param: image}
66 | flavor: {get_param: flavor}
67 | key_name: {get_param: key_name}
68 | security_groups:
69 | - {get_resource: the_sg}
70 | user_data_format: SOFTWARE_CONFIG
71 |
72 | outputs:
73 | result:
74 | value:
75 | get_attr: [deployment, result]
76 | stdout:
77 | value:
78 | get_attr: [deployment, deploy_stdout]
79 | stderr:
80 | value:
81 | get_attr: [deployment, deploy_stderr]
82 | status_code:
83 | value:
84 | get_attr: [deployment, deploy_status_code]
85 | other_result:
86 | value:
87 | get_attr: [other_deployment, result]
88 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-software-deploymentgroup-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | description: >
3 | This template demonstrates a minimal SoftwareDeployment example
4 | parameters:
5 | key_name:
6 | type: string
7 | constraints:
8 | - custom_constraint: nova.keypair
9 | flavor:
10 | type: string
11 | constraints:
12 | - custom_constraint: nova.flavor
13 | ubuntu_image:
14 | type: string
15 | constraints:
16 | - custom_constraint: glance.image
17 | fedora_image:
18 | type: string
19 | constraints:
20 | - custom_constraint: glance.image
21 | network:
22 | type: string
23 | constraints:
24 | - custom_constraint: neutron.network
25 |
26 | resources:
27 | my_deps:
28 | type: OS::Heat::SoftwareDeploymentGroup
29 | properties:
30 | config: {get_resource: config}
31 | servers: {'0': {get_resource: server_ubuntu},
32 | '1': {get_resource: server_fedora}
33 | }
34 | signal_transport: NO_SIGNAL
35 |
36 | config:
37 | type: OS::Heat::SoftwareConfig
38 | properties:
39 | group: ansible
40 | inputs:
41 | - name: foo
42 | - name: bar
43 | outputs:
44 | - name: result
45 | config:
46 | get_file: config-scripts/example-ansible-template.ansible
47 |
48 | server_fedora:
49 | type: OS::Nova::Server
50 | properties:
51 | image: {get_param: fedora_image}
52 | flavor: {get_param: flavor}
53 | key_name: {get_param: key_name}
54 | networks: [{network: {get_param: network}}]
55 | user_data_format: SOFTWARE_CONFIG
56 | server_ubuntu:
57 | type: OS::Nova::Server
58 | properties:
59 | image: {get_param: ubuntu_image}
60 | flavor: {get_param: flavor}
61 | key_name: {get_param: key_name}
62 | networks: [{network: {get_param: network}}]
63 | user_data_format: SOFTWARE_CONFIG
64 |
65 | outputs:
66 | result:
67 | value:
68 | get_attr: [my_deps, result]
69 | stdout:
70 | value:
71 | get_attr: [my_deps, deploy_stdout]
72 | stderr:
73 | value:
74 | get_attr: [my_deps, deploy_stderr]
75 | status_code:
76 | value:
77 | get_attr: [my_deps, deploy_status_code]
78 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/example-structured-template.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | description: >
3 | This template demonstrates how to use OS::Heat::StructuredDeployment
4 | to override substitute get_input placeholders defined in
5 | OS::Heat::StructuredConfig config.
6 |
7 | As there is no hook on the server to act on the configuration data,
8 | these deployment resource will perform no actual configuration.
9 | parameters:
10 | key_name:
11 | type: string
12 | flavor:
13 | type: string
14 | image:
15 | type: string
16 | default: fedora-software-config
17 |
18 | resources:
19 | the_sg:
20 | type: OS::Neutron::SecurityGroup
21 | properties:
22 | name: the_sg
23 | description: Ping and SSH
24 | rules:
25 | - protocol: icmp
26 | - protocol: tcp
27 | port_range_min: 22
28 | port_range_max: 22
29 |
30 | config:
31 | type: OS::Heat::StructuredConfig
32 | properties:
33 | config:
34 | config_value_foo: {get_input: foo}
35 | config_value_bar: {get_input: bar}
36 |
37 | deployment:
38 | type: OS::Heat::StructuredDeployment
39 | properties:
40 | signal_transport: NO_SIGNAL
41 | config:
42 | get_resource: config
43 | server:
44 | get_resource: server
45 | input_values:
46 | foo: fooooo
47 | bar: baaaaa
48 |
49 | other_deployment:
50 | type: OS::Heat::StructuredDeployment
51 | properties:
52 | signal_transport: NO_SIGNAL
53 | config:
54 | get_resource: config
55 | server:
56 | get_resource: server
57 | input_values:
58 | foo: fu
59 | bar: barmy
60 |
61 | server:
62 | type: OS::Nova::Server
63 | properties:
64 | image: {get_param: image}
65 | flavor: {get_param: flavor}
66 | key_name: {get_param: key_name}
67 | security_groups:
68 | - {get_resource: the_sg}
69 | user_data_format: SOFTWARE_CONFIG
70 |
71 |
72 | outputs:
73 | server_ip:
74 | description: IP Address of server.
75 | value: { get_attr: [server, first_address] }
76 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/wordpress/db_install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | yum -y install mariadb mariadb-server
4 | touch /var/log/mariadb/mariadb.log
5 | chown mysql.mysql /var/log/mariadb/mariadb.log
6 | systemctl start mariadb.service
7 |
8 | # Setup MySQL root password and create a user
9 | mysqladmin -u root password $db_rootpassword
10 | cat << EOF | mysql -u root --password=$db_rootpassword
11 | CREATE DATABASE $db_name;
12 | GRANT ALL PRIVILEGES ON $db_name.* TO '$db_user'@'%'
13 | IDENTIFIED BY '$db_password';
14 | FLUSH PRIVILEGES;
15 | EXIT
16 | EOF
17 |
--------------------------------------------------------------------------------
/hot/software-config/example-templates/wordpress/wp_install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | yum -y install httpd wordpress
4 |
5 | sed -i "/Deny from All/d" /etc/httpd/conf.d/wordpress.conf
6 | sed -i "s/Require local/Require all granted/" /etc/httpd/conf.d/wordpress.conf
7 | sed -i s/database_name_here/$db_name/ /etc/wordpress/wp-config.php
8 | sed -i s/username_here/$db_user/ /etc/wordpress/wp-config.php
9 | sed -i s/password_here/$db_password/ /etc/wordpress/wp-config.php
10 | sed -i s/localhost/$db_ipaddr/ /etc/wordpress/wp-config.php
11 |
12 | setenforce 0 # Otherwise net traffic with DB is disabled
13 |
14 | systemctl start httpd.service
15 |
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM registry.fedoraproject.org/fedora:25
2 | MAINTAINER “Rabi Mishra”
3 | ENV container docker
4 |
5 | RUN dnf -y --setopt=tsflags=nodocs install \
6 | findutils os-collect-config os-apply-config \
7 | os-refresh-config python-pip python-docker-py \
8 | python-yaml python-zaqarclient && \
9 | dnf clean all
10 |
11 | # pip installing dpath as python-dpath is an older version of dpath
12 | # install docker-compose
13 | RUN pip --no-cache-dir install dpath docker-compose
14 |
15 | ADD ./scripts/55-heat-config \
16 | /opt/stack/os-config-refresh/configure.d/
17 |
18 | ADD ./scripts/50-heat-config-docker-compose \
19 | /opt/stack/os-config-refresh/configure.d/
20 |
21 | ADD ./scripts/hooks/* \
22 | /var/lib/heat-config/hooks/
23 |
24 | ADD ./scripts/heat-config-notify \
25 | /usr/bin/heat-config-notify
26 |
27 | ADD ./scripts/configure_container_agent.sh /tmp/
28 | RUN chmod 700 /tmp/configure_container_agent.sh
29 | RUN /tmp/configure_container_agent.sh
30 |
31 | #create volumes to share the host directories
32 | VOLUME [ "/var/lib/cloud"]
33 | VOLUME [ "/var/lib/heat-cfntools" ]
34 |
35 | #set DOCKER_HOST environment variable that docker-compose would use
36 | ENV DOCKER_HOST unix:///var/run/docker.sock
37 |
38 | CMD /usr/bin/os-collect-config
39 |
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/README.rst:
--------------------------------------------------------------------------------
1 | =======================================================
2 | Steps to build container image with all container hooks
3 | =======================================================
4 |
5 | Install the heat-agents repo alongside heat-templates. Some file in this
6 | directory are symlinks that assume the presence of the heat-agents directory in
7 | the same directory as the heat-templates directory.
8 |
9 | Docker build does not work with soft links. Therefore, convert all
10 | soft links to hardlinks.
11 |
12 | $ find -type l -exec bash -c 'ln -f "$(readlink -m "$0")" "$0"' {} \;
13 |
14 | Build docker image with container hooks.
15 |
16 | $docker build -t xxxx/heat-container-agent ./
17 |
18 | Push the image to docker hub.
19 |
20 | $docker push xxxx/heat-container-agent
21 |
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/scripts/50-heat-config-docker-compose:
--------------------------------------------------------------------------------
1 | ../../../../../heat-agents/heat-config-docker-compose/os-refresh-config/configure.d/50-heat-config-docker-compose
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/scripts/55-heat-config:
--------------------------------------------------------------------------------
1 | ../../../../../heat-agents/heat-config/os-refresh-config/configure.d/55-heat-config
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/scripts/configure_container_agent.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eux
3 |
4 | # os-apply-config templates directory
5 | oac_templates=/usr/libexec/os-apply-config/templates
6 | mkdir -p $oac_templates/etc
7 |
8 | # initial /etc/os-collect-config.conf
9 | cat </etc/os-collect-config.conf
10 | [DEFAULT]
11 | command = os-refresh-config
12 | EOF
13 |
14 | # template for building os-collect-config.conf for polling heat
15 | cat <$oac_templates/etc/os-collect-config.conf
16 | [DEFAULT]
17 | {{^os-collect-config.command}}
18 | command = os-refresh-config
19 | {{/os-collect-config.command}}
20 | {{#os-collect-config}}
21 | {{#command}}
22 | command = {{command}}
23 | {{/command}}
24 | {{#polling_interval}}
25 | polling_interval = {{polling_interval}}
26 | {{/polling_interval}}
27 | {{#cachedir}}
28 | cachedir = {{cachedir}}
29 | {{/cachedir}}
30 | {{#collectors}}
31 | collectors = {{.}}
32 | {{/collectors}}
33 |
34 | {{#cfn}}
35 | [cfn]
36 | {{#metadata_url}}
37 | metadata_url = {{metadata_url}}
38 | {{/metadata_url}}
39 | stack_name = {{stack_name}}
40 | secret_access_key = {{secret_access_key}}
41 | access_key_id = {{access_key_id}}
42 | path = {{path}}
43 | {{/cfn}}
44 |
45 | {{#heat}}
46 | [heat]
47 | auth_url = {{auth_url}}
48 | user_id = {{user_id}}
49 | password = {{password}}
50 | project_id = {{project_id}}
51 | stack_id = {{stack_id}}
52 | resource_name = {{resource_name}}
53 | {{/heat}}
54 |
55 | {{#zaqar}}
56 | [zaqar]
57 | auth_url = {{auth_url}}
58 | user_id = {{user_id}}
59 | password = {{password}}
60 | project_id = {{project_id}}
61 | queue_id = {{queue_id}}
62 | {{/zaqar}}
63 |
64 | {{#request}}
65 | [request]
66 | {{#metadata_url}}
67 | metadata_url = {{metadata_url}}
68 | {{/metadata_url}}
69 | {{/request}}
70 |
71 | {{/os-collect-config}}
72 | EOF
73 | mkdir -p $oac_templates/var/run/heat-config
74 |
75 | # template for writing heat deployments data to a file
76 | echo "{{deployments}}" > $oac_templates/var/run/heat-config/heat-config
77 |
78 | # os-refresh-config scripts directory
79 | # This moves to /usr/libexec/os-refresh-config in later releases
80 | orc_scripts=/opt/stack/os-config-refresh
81 | for d in pre-configure.d configure.d migration.d post-configure.d; do
82 | install -m 0755 -o root -g root -d $orc_scripts/$d
83 | done
84 |
85 | # os-refresh-config script for running os-apply-config
86 | cat <$orc_scripts/configure.d/20-os-apply-config
87 | #!/bin/bash
88 | set -ue
89 |
90 | exec os-apply-config
91 | EOF
92 | chmod 700 $orc_scripts/configure.d/20-os-apply-config
93 |
94 | chmod 700 /opt/stack/os-config-refresh/configure.d/55-heat-config
95 | chmod 700 /opt/stack/os-config-refresh/configure.d/50-heat-config-docker-compose
96 |
97 | chmod 755 /var/lib/heat-config/hooks/atomic
98 | chmod 755 /var/lib/heat-config/hooks/docker-compose
99 | chmod 755 /var/lib/heat-config/hooks/script
100 |
101 | chmod 755 /usr/bin/heat-config-notify
102 |
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/scripts/heat-config-notify:
--------------------------------------------------------------------------------
1 | ../../../../../heat-agents/heat-config/bin/heat-config-notify
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/scripts/hooks/docker-compose:
--------------------------------------------------------------------------------
1 | ../../../../../../heat-agents/heat-config-docker-compose/install.d/hook-docker-compose.py
--------------------------------------------------------------------------------
/hot/software-config/heat-container-agent/scripts/hooks/script:
--------------------------------------------------------------------------------
1 | ../../../../../../heat-agents/heat-config-script/install.d/hook-script.py
--------------------------------------------------------------------------------
/hot/software-config/test-image/README.rst:
--------------------------------------------------------------------------------
1 | =======================================
2 | Elements for building a heat test image
3 | =======================================
4 |
5 | The heat functional test job needs to boot full images containing the
6 | heat agent code (os-collect-config etc) so that it can test the
7 | interaction between heat and the agent.
8 |
9 | Images built with these elements contain the necessary
10 | distro packages so that only pip packages need to be installed on
11 | server boot.
12 |
13 | The script build-heat-test-image.sh will trigger an image build
14 | defaulting to fedora. Ubuntu and CentOS7 are also fully supported by
15 | these elements. Run the following to build all supported images:
16 |
17 |
18 | ::
19 |
20 | DISTRO=fedora ./build-heat-test-image.sh
21 | DISTRO=ubuntu ./build-heat-test-image.sh
22 | DISTRO=centos7-rdo ./build-heat-test-image.sh
23 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/build-heat-test-image.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 | # implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | set -e
17 |
18 | # known good values of DISTRO are
19 | # fedora-heat-test, ubuntu-heat-test, centos7-heat-test
20 | export DISTRO=${DISTRO:-fedora-heat-test}
21 |
22 | export ELEMENTS_PATH=${ELEMENTS_PATH:-`dirname "$0"`/elements}
23 | export IMAGE_NAME=${IMAGE_NAME:-$DISTRO-image}
24 |
25 | disk-image-create -x --no-tmpfs -o $IMAGE_NAME $DISTRO \
26 | vm python-dev heat-agent-pkg-requires heat-config-hook-requires
27 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/centos7-heat-test/README.md:
--------------------------------------------------------------------------------
1 | Adds the centos7 element and includes the Juno RDO yum repository
2 |
3 | The Juno RDO repo is required for OpenStack packages which are not in
4 | CentOS7 or EPEL repos (python-oslo-config, python-*client)
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/centos7-heat-test/element-deps:
--------------------------------------------------------------------------------
1 | centos7
2 | selinux-permissive
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/centos7-heat-test/package-installs.yaml:
--------------------------------------------------------------------------------
1 | # uninstall fedora's heat-cfntools so it can be installed from pip
2 | rdo_release_juno_package:
3 | phase: pre-install.d
4 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/centos7-heat-test/pkg-map:
--------------------------------------------------------------------------------
1 | {
2 | "default": {
3 | "rdo_release_juno_package": "https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/fedora-heat-test/README.md:
--------------------------------------------------------------------------------
1 | Adds the fedora and selinux-permissive elements.
2 |
3 | selinux-permissive is added to avoid a relabel during boot, which is very
4 | slow in a gate environment.
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/fedora-heat-test/element-deps:
--------------------------------------------------------------------------------
1 | fedora
2 | selinux-permissive
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-agent-pkg-requires/README.md:
--------------------------------------------------------------------------------
1 | Installs packages required by heat agent tools.
2 |
3 | These are the dependencies for the following projects which make up the
4 | heat agent tools
5 |
6 | - os-collect-config
7 | - os-apply-config
8 | - os-refresh-config
9 | - heat-cfntools
10 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-agent-pkg-requires/element-deps:
--------------------------------------------------------------------------------
1 | package-installs
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-agent-pkg-requires/package-installs.yaml:
--------------------------------------------------------------------------------
1 | python_setuptools_package:
2 | python_argparse_package:
3 | python_anyjson_package:
4 | python_dogpile_cache_package:
5 | python_eventlet_package:
6 | python_heatclient_package:
7 | python_keystoneclient_package:
8 | python_requests_package:
9 | python_iso8601_package:
10 | python_lxml_package:
11 | python_six_package:
12 | python_oslo_config_package:
13 | pystache_package:
14 | python_pbr_package:
15 | python_boto_package:
16 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-agent-pkg-requires/pkg-map:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "family": {
4 | "redhat": {
5 | "python_setuptools_package": "python-setuptools",
6 | "python_argparse_package": "python-argparse",
7 | "python_anyjson_package": "python-anyjson",
8 | "python_dogpile_cache_package": "python-dogpile-cache",
9 | "python_eventlet_package": "python-eventlet",
10 | "python_heatclient_package": "python-heatclient",
11 | "python_keystoneclient_package": "python-keystoneclient",
12 | "python_requests_package": "python-requests",
13 | "python_iso8601_package": "python-iso8601",
14 | "python_lxml_package": "python-lxml",
15 | "python_six_package": "python-six",
16 | "python_oslo_config_package": "python-oslo-config",
17 | "pystache_package": "pystache",
18 | "python_pbr_package": "python-pbr",
19 | "python_boto_package": "python-boto"
20 | },
21 | "debian": {
22 | "python_setuptools_package": "python-setuptools",
23 | "python_argparse_package": "python-argparse",
24 | "python_anyjson_package": "python-anyjson",
25 | "python_dogpile_cache_package": "python-dogpile.cache",
26 | "python_eventlet_package": "python-eventlet",
27 | "python_heatclient_package": "python-heatclient",
28 | "python_keystoneclient_package": "python-keystoneclient",
29 | "python_requests_package": "python-requests",
30 | "python_iso8601_package": "python-iso8601",
31 | "python_lxml_package": "python-lxml",
32 | "python_six_package": "python-six",
33 | "python_oslo_config_package": "python-oslo-config",
34 | "pystache_package": "python-pystache",
35 | "python_pbr_package": "python-pbr",
36 | "python_boto_package": "python-boto"
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-config-hook-requires/README.md:
--------------------------------------------------------------------------------
1 | Configuration tools required by tested heat-config hooks
2 |
3 | This element installs the configuration tools required by some heat-config
4 | hooks so that they are available for testing. Current tools installed are:
5 |
6 | - ansible
7 | - puppet
8 | - salt-minion
9 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-config-hook-requires/element-deps:
--------------------------------------------------------------------------------
1 | package-installs
2 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-config-hook-requires/package-installs.yaml:
--------------------------------------------------------------------------------
1 | puppet_package:
2 | ansible_package:
3 | salt_minion_package:
4 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/heat-config-hook-requires/pkg-map:
--------------------------------------------------------------------------------
1 | {
2 | "default": {
3 | "puppet_package": "puppet",
4 | "ansible_package": "ansible",
5 | "salt_minion_package": "salt-minion"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/python-dev/README.md:
--------------------------------------------------------------------------------
1 | Install packages for common pip install dependencies
2 |
3 | This element installs packages needed for common pip installs, including
4 | devel packages need by pip build of packages like PyYAML, lxml, pyOpenSSL.
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/python-dev/element-deps:
--------------------------------------------------------------------------------
1 | package-installs
2 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/python-dev/package-installs.yaml:
--------------------------------------------------------------------------------
1 | python_pip_package:
2 | git_package:
3 | gcc_package:
4 | python_devel_package:
5 | libyaml_devel_package:
6 | openssl_devel_package:
7 | libffi_devel_package:
8 | libxml2_devel_package:
9 | libxslt_devel_package:
10 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/python-dev/pkg-map:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "family": {
4 | "redhat": {
5 | "python_pip_package": "python-pip",
6 | "gcc_package": "gcc",
7 | "git_package": "git-core",
8 | "python_devel_package": "python-devel",
9 | "libyaml_devel_package": "libyaml-devel",
10 | "openssl_devel_package": "openssl-devel",
11 | "libffi_devel_package": "libffi-devel",
12 | "libxml2_devel_package": "libxml2-devel",
13 | "libxslt_devel_package": "libxslt-devel"
14 | },
15 | "debian": {
16 | "python_pip_package": "python-pip",
17 | "git_package": "git",
18 | "gcc_package": "gcc",
19 | "python_devel_package": "python-dev",
20 | "libyaml_devel_package": "libyaml-dev",
21 | "openssl_devel_package": "libssl-dev",
22 | "libffi_devel_package": "libffi-dev",
23 | "libxml2_devel_package": "libxml2-dev",
24 | "libxslt_devel_package": "libxslt1-dev"
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/ubuntu-heat-test/README.md:
--------------------------------------------------------------------------------
1 | Adds the ubuntu element.
2 |
3 | No further customization is required for an ubuntu test image at this time.
--------------------------------------------------------------------------------
/hot/software-config/test-image/elements/ubuntu-heat-test/element-deps:
--------------------------------------------------------------------------------
1 | ubuntu
2 |
--------------------------------------------------------------------------------
/hot/swift.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 | description: Template which creates a Swift container resource
3 |
4 | resources:
5 | SwiftContainerWebsite:
6 | deletion_policy: "Delete"
7 | type: OS::Swift::Container
8 | properties:
9 | X-Container-Read: ".r:*"
10 | X-Container-Meta:
11 | web-index: "index.html"
12 | web-error: "error.html"
13 |
14 | SwiftContainer:
15 | type: OS::Swift::Container
16 |
17 | outputs:
18 | WebsiteURL:
19 | description: "URL for website hosted on S3"
20 | value: { get_attr: [SwiftContainerWebsite, WebsiteURL] }
21 | DomainName:
22 | description: "Domain of Swift host"
23 | value: { get_attr: [SwiftContainer, DomainName] }
24 |
--------------------------------------------------------------------------------
/hot/vm_with_cinder.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: 2013-05-23
2 |
3 | description: >
4 | A HOT template that holds a VM instance with an attached
5 | Cinder volume. The VM does nothing, it is only created.
6 |
7 | parameters:
8 | key_name:
9 | type: string
10 | description: Name of an existing key pair to use for the instance
11 | constraints:
12 | - custom_constraint: nova.keypair
13 | description: Must name a public key (pair) known to Nova
14 | flavor:
15 | type: string
16 | description: Flavor for the instance to be created
17 | default: m1.small
18 | constraints:
19 | - custom_constraint: nova.flavor
20 | description: Must be a flavor known to Nova
21 | image:
22 | type: string
23 | description: >
24 | Name or ID of the image to use for the instance.
25 | You can get the default from
26 | http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2
27 | There is also
28 | http://cloud.fedoraproject.org/fedora-20.i386.qcow2
29 | Any image should work since this template
30 | does not ask the VM to do anything.
31 | constraints:
32 | - custom_constraint: glance.image
33 | description: Must identify an image known to Glance
34 | network:
35 | type: string
36 | description: The network for the VM
37 | default: private
38 | vol_size:
39 | type: number
40 | description: The size of the Cinder volume
41 | default: 1
42 |
43 | resources:
44 | my_instance:
45 | type: OS::Nova::Server
46 | properties:
47 | key_name: { get_param: key_name }
48 | image: { get_param: image }
49 | flavor: { get_param: flavor }
50 | networks: [{network: {get_param: network} }]
51 |
52 | my_vol:
53 | type: OS::Cinder::Volume
54 | properties:
55 | size: { get_param: vol_size }
56 |
57 | vol_att:
58 | type: OS::Cinder::VolumeAttachment
59 | properties:
60 | instance_uuid: { get_resource: my_instance }
61 | volume_id: { get_resource: my_vol }
62 | mountpoint: /dev/vdb
63 |
64 | outputs:
65 | instance_networks:
66 | description: The IP addresses of the deployed instance
67 | value: { get_attr: [my_instance, networks] }
68 |
--------------------------------------------------------------------------------
/hot/zun/webapp.yaml:
--------------------------------------------------------------------------------
1 | heat_template_version: rocky
2 |
3 | parameters:
4 | external_network:
5 | type: string
6 | default: public
7 | tenant_network:
8 | type: string
9 | default: private
10 |
11 | resources:
12 | secgroup:
13 | type: OS::Neutron::SecurityGroup
14 | properties:
15 | name: sg_wordpress
16 | description: wordpress security group
17 | rules:
18 | - protocol: icmp
19 | - protocol: tcp
20 | port_range_min: 80
21 | port_range_max: 80
22 | - protocol: tcp
23 | port_range_min: 3306
24 | port_range_max: 3306
25 | db:
26 | type: OS::Zun::Container
27 | properties:
28 | image: mysql:5.7
29 | environment:
30 | MYSQL_ROOT_PASSWORD: rootpass
31 | MYSQL_DATABASE: wordpress
32 | security_groups:
33 | - {get_resource: secgroup}
34 | networks:
35 | - network: {get_param: tenant_network}
36 | wordpress:
37 | type: OS::Zun::Container
38 | properties:
39 | image: "wordpress:latest"
40 | environment:
41 | WORDPRESS_DB_HOST: {get_attr: [db, addresses, {get_param: tenant_network}, 0, addr]}
42 | WORDPRESS_DB_USER: root
43 | WORDPRESS_DB_PASSWORD: rootpass
44 | security_groups:
45 | - {get_resource: secgroup}
46 | networks:
47 | - network: {get_param: tenant_network}
48 | floating_ip:
49 | type: OS::Neutron::FloatingIP
50 | properties:
51 | floating_network: {get_param: external_network}
52 | association:
53 | type: OS::Neutron::FloatingIPAssociation
54 | properties:
55 | floatingip_id: {get_resource: floating_ip}
56 | port_id: {get_attr: [wordpress, addresses, {get_param: tenant_network}, 0, port]}
57 |
58 | outputs:
59 | url:
60 | value: {get_attr: [floating_ip, floating_ip_address]}
61 | description: The web server url
62 |
--------------------------------------------------------------------------------
/jeos/CentOS-6.3-x86_64-cfntools.tdl:
--------------------------------------------------------------------------------
1 |
2 | CentOS-6.3-x86_64-cfntools
3 |
4 | CentOS-6
5 | 3
6 | x86_64
7 |
8 | file:/var/lib/libvirt/images/CentOS-6.3-x86_64-bin-DVD1.iso
9 |
10 |
11 | CentOS 6.3
12 |
13 |
14 | passwd -l root
15 |
16 |
17 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
18 | DEVICE="eth0"
19 | BOOTPROTO=dhcp
20 | NM_CONTROLLED="yes"
21 | ONBOOT="yes"
22 | EOF
23 |
24 |
25 | yum -y update
26 | curl -O http://ftp.ps.pl/pub/Linux/fedora-epel/6/i386/epel-release-6-7.noarch.rpm
27 | rpm -Uvh epel-release-6-7.noarch.rpm
28 | yum -y install perl python python-setuptools cloud-init python-pip
29 | pip-python install argparse 'boto==2.5.2' heat-cfntools
30 | cfn-create-aws-symlinks --source /usr/bin
31 | rm -f epel-release-6-7.noarch.rpm
32 |
33 |
34 | chmod +x /etc/rc.d/rc.local
35 | chkconfig --level 345 sshd on
36 | rm -rf /etc/udev/rules.d/70-persistent-net.rules
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/jeos/U10-amd64-cfntools.tdl:
--------------------------------------------------------------------------------
1 |
2 | U10-x86_64-cfntools
3 |
4 | Ubuntu
5 | 10.04
6 | x86_64
7 |
8 | file:/var/lib/libvirt/images/ubuntu-10.04.4-server-amd64.iso
9 |
10 |
11 | Ubuntu 10.04
12 |
13 |
14 | passwd -l root
15 |
16 |
17 | apt-get -y update
18 | apt-get -y upgrade
19 | apt-get -y install python-argparse chkconfig cloud-init python-psutil python-pip
20 | apt-get -y remove python-boto
21 |
22 | pip install 'boto==2.5.2' heat-cfntools
23 | cfn-create-aws-symlinks --source /usr/local/bin
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/jeos/U12.10-amd64-cfntools.tdl:
--------------------------------------------------------------------------------
1 |
2 | U12-10-x86_64-cfntools
3 |
4 | Ubuntu
5 | 12.10
6 | x86_64
7 |
8 | file:/var/lib/libvirt/images/ubuntu-12.10-server-amd64.iso
9 |
10 |
11 | Ubuntu 12.10
12 |
13 |
14 | passwd -l root
15 |
16 |
17 | apt-get -y update
18 | apt-get -y upgrade
19 | apt-get -y install python-argparse cloud-init python-psutil python-pip
20 | apt-get -y remove python-boto
21 |
22 | pip install 'boto==2.5.2' heat-cfntools
23 | cfn-create-aws-symlinks --source /usr/local/bin
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/jeos/U12.10-i386-cfntools.tdl:
--------------------------------------------------------------------------------
1 |
2 | U12-10-i386-cfntools
3 |
4 | Ubuntu
5 | 12.10
6 | i386
7 |
8 | file:/var/lib/libvirt/images/ubuntu-12.10-server-i386.iso
9 |
10 |
11 | Ubuntu 12.10
12 |
13 |
14 | passwd -l root
15 |
16 |
17 | apt-get -y update
18 | apt-get -y upgrade
19 | apt-get -y install python-argparse cloud-init python-psutil python-pip
20 | apt-get -y remove python-boto
21 |
22 | pip install 'boto==2.5.2' heat-cfntools
23 | cfn-create-aws-symlinks --source /usr/local/bin
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/openshift-origin/F19/README.rst:
--------------------------------------------------------------------------------
1 | ==========================
2 | OpenShift Origin Templates
3 | ==========================
4 |
5 | .. note::
6 |
7 | These templates have only been tested with OpenShift V2 and are now
8 | deprecated. For up to date templates for deploying OpenShift V3 and beyond
9 | on OpenStack refer to the `OpenShift-on-OpenStack
10 | `_ github
11 | project.
12 |
13 | This directory contains files for deploying OpenShift Origin to an OpenStack environment via Heat.
14 |
15 | The templates has been tested with the OpenStack Icehouse 2014.1 release.
16 |
17 | It includes the following folders:
18 |
19 | * `hot-template` - heat templates in HOT format for launching OpenShift Origin
20 | * `aws-template` - heat templates in AWS format for launching OpenShift Origin
21 | * `elements` - diskimage-builder elements to build images
22 |
23 | To build with diskimage-builder, do the following in the parent directory of heat-templates::
24 |
25 | git clone https://github.com/openstack/diskimage-builder.git
26 | apt-get install -y qemu-utils kpartx
27 | mkdir $HOME/tmp
28 | export DIB_RELEASE=19
29 | export ELEMENTS_PATH=heat-templates/openshift-origin/F19/elements
30 | export TMP_DIR=$HOME/tmp
31 | export DIB_IMAGE_SIZE=5
32 | diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-broker -o F19-x86_64-openshift-origin-broker
33 | openstack image create F19-x86_64-openshift-origin-broker --public true --disk-format qcow2 --container-format bare < F19-x86_64-openshift-origin-broker.qcow2
34 | export DIB_IMAGE_SIZE=20
35 | diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-node -o F19-x86_64-openshift-origin-node
36 | openstack image create F19-x86_64-openshift-origin-node --public true --disk-format qcow2 --container-format bare < F19-x86_64-openshift-origin-node.qcow2
37 |
--------------------------------------------------------------------------------
/openshift-origin/F19/aws-template/README.rst:
--------------------------------------------------------------------------------
1 | =============================
2 | OpenShift Origin AWS Template
3 | =============================
4 |
5 | This directory contains template for deploying OpenShift Origin to an OpenStack environment via Heat.
6 |
7 | It includes the following file:
8 |
9 | * `openshift.template` - heat templates in AWS format for launching OpenShift Origin with a single broker instance and a single node instance
10 |
11 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/heat-cfntools/install.d/05-heat-cfntools:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -uex
4 |
5 | install-packages heat-cfntools
6 | cfn-create-aws-symlinks --source /usr/bin
7 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/openshift-origin-broker/README.md:
--------------------------------------------------------------------------------
1 | Minimal packages required for Heat to successfully
2 | deploy an OpenShift Origin Broker instance.
3 |
4 | Note: All other packages are managed by Puppet.
5 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/openshift-origin-broker/element-deps:
--------------------------------------------------------------------------------
1 | heat-cfntools
2 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/openshift-origin-broker/install.d/30-openshift-origin-broker:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -uex
4 |
5 | install-packages \
6 | openssh \
7 | ntpdate \
8 | bind \
9 | bind-utils \
10 | openssh-server \
11 | git \
12 | puppet \
13 | facter \
14 | tar \
15 | ntp \
16 |
17 | sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service
18 |
19 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/openshift-origin-node/README.md:
--------------------------------------------------------------------------------
1 | Minimal packages required for Heat to successfully
2 | deploy an OpenShift Origin Node instance.
3 |
4 | Note: All other packages are managed by Puppet.
5 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/openshift-origin-node/element-deps:
--------------------------------------------------------------------------------
1 | heat-cfntools
2 |
--------------------------------------------------------------------------------
/openshift-origin/F19/elements/openshift-origin-node/install.d/30-openshift-origin-node:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -uex
4 |
5 | install-packages \
6 | openssh \
7 | ntpdate \
8 | openssh-server \
9 | git \
10 | puppet \
11 | facter \
12 | tar \
13 | ntp \
14 |
15 | sed --in-place -e s/Type=oneshot/"Type=oneshot\nTimeoutSec=0"/ /lib/systemd/system/cloud-final.service
16 |
17 |
--------------------------------------------------------------------------------
/openshift-origin/F19/hot-template/README.rst:
--------------------------------------------------------------------------------
1 | ==============================
2 | OpenShift Origin HOT Templates
3 | ==============================
4 |
5 | This directory contains templates for deploying OpenShift Origin to an OpenStack environment via Heat.
6 |
7 | To install OpenShift Origin, this Puppet module is used : https://github.com/openshift/puppet-openshift_origin.
8 |
9 | To avoid compatibility issues due to changes in this project or in Puppet modules it depends, versions parameters are provided.
10 | So, if you leave the default _version parameters, the commands executed on the instances install a specific version of puppet modules needed. The version installed is a production version which as been verified as working.
11 | If you want to use the latest versions, you have to select the other value. The commands executed on the instances don't install a specific version of puppet modules needed. So the lastest version will be installed.
12 |
13 | It includes the following folders:
14 |
15 | * `openshift` - heat templates in HOT format for launching OpenShift Origin with a single broker instance and a single node instance
16 | * `openshift-scalable-cpu` - heat templates in HOT format for launching OpenShift Origin with implementation of scalability based on cpu_util Ceilometer metric
17 | * `openshift-scalable-nbgears` - heat templates in HOT format for launching OpenShift Origin with implementation of scalability based on number of deployed gears on OpenShift node instances (using a custom metric based on bash script that send the data periodically to the Ceilometer API using cron)
18 | * `openshift-scalable-cpu-nbgears` - heat templates in HOT format for launching OpenShift Origin with implementation of scalability based on cpu_util Ceilometer metric and on number of deploy gears on OpenShift node instances (using a custom metric based on bash script that send the data periodically to the Ceilometer API using cron)
19 |
--------------------------------------------------------------------------------
/openshift-origin/centos65/README.rst:
--------------------------------------------------------------------------------
1 | ==========================
2 | OpenShift Origin templates
3 | ==========================
4 |
5 | .. note::
6 |
7 | These templates have only been tested with OpenShift V2 and are now
8 | deprecated. For up to date templates for deploying OpenShift V3 and beyond
9 | on OpenStack refer to the `OpenShift-on-OpenStack
10 | `_ github
11 | project.
12 |
13 | This directory contains files for deploying OpenShift Origin to an OpenStack environment via Heat.
14 |
15 | It includes the following template files:
16 |
17 | * `OpenShift.yaml` - deploys OpenShift Origin in an all-in-one setup (broker+console+node)
18 | * `OpenShift-1B1N.yaml` - deploys OpenShift Origin with separate instances for broker and node
19 |
20 | And the following directory:
21 |
22 | * `highly-available` - deploys OpenShift Origin in a highly available setup as further described in its README.md
23 |
--------------------------------------------------------------------------------
/openshift-origin/centos65/highly-available/invalid/oso_ha_env.yaml:
--------------------------------------------------------------------------------
1 | parameters:
2 | # existing OpenStack keypair
3 | key_name: mykey
4 | domain: example.com
5 | hosts_domain: example.com
6 | replicants: broker1.example.com,broker2.example.com,broker3.example.com
7 | # IP address of existing DNS server that will be configured for zone xfer
8 | # this server will be a slave for the OpenShift zone
9 | upstream_dns_ip: 10.0.0.1
10 | # Name of glance images. Using prepped images will greatly reduce deploy time.
11 | node_image: centos-6.5-release-n
12 | broker_image: centos-6.5-release
13 | activemq_admin_pass: password
14 | activemq_user_pass: password
15 | mcollective_pass: password
16 | mongo_broker_pass: password
17 | openshift_pass1: password
18 | # Use 'openstack network list' and 'openstack subnet list' and replace these values
19 | private_net_id: ec6c8237-1368-42c2-af6a-2c5a6b41951b
20 | public_net_id: c5882794-fa7d-46b2-b90a-e37e47fabdf8
21 | private_subnet_id: 8977e24c-32c6-4fb1-ae9f-6f70c16ecf0d
22 | resource_registry:
23 | OpenShift::Node::Server: oso_node.yaml
24 |
--------------------------------------------------------------------------------
/openshift-origin/centos65/highly-available/invalid/oso_node_env.yaml:
--------------------------------------------------------------------------------
1 | parameters:
2 | # existing OpenStack keypair
3 | key_name: mykey
4 | domain: example.com
5 | hosts_domain: example.com
6 | broker1_floating_ip: 10.0.0.1
7 | # list of HA broker set
8 | replicants: broker1.example.com,broker2.example.com,broker3.example.com
9 | # Name of glance image. Using prepped images will greatly reduce deploy time.
10 | node_image: RHEL65-x86_64-node
11 |
--------------------------------------------------------------------------------
/playbooks/devstack/run.yaml:
--------------------------------------------------------------------------------
1 | - hosts: all
2 | # This is the default strategy, however since orchestrate-devstack requires
3 | # "linear", it is safer to enforce it in case this is running in an
4 | # environment configured with a different default strategy.
5 | strategy: linear
6 | roles:
7 | - orchestrate-devstack
8 |
9 | - hosts: controller
10 | roles:
11 | - run-heat-template-check
12 |
--------------------------------------------------------------------------------
/roles/run-heat-template-check/defaults/main.yaml:
--------------------------------------------------------------------------------
1 | devstack_base_dir: /opt/stack
2 | tempest_test_timeout: ''
3 |
--------------------------------------------------------------------------------
/roles/run-heat-template-check/tasks/main.yaml:
--------------------------------------------------------------------------------
1 | - name: prepare check env
2 | shell:
3 | cmd: |
4 | set -x
5 | source ${DEVSTACK_BASE_DIR}/devstack/openrc admin admin
6 | source ${DEVSTACK_BASE_DIR}/devstack/functions-common
7 | neutron_service=$(get_or_create_service "neutron" "network" "Neutron Service")
8 | get_or_create_endpoint $neutron_service "$REGION_NAME" "http://localhost"
9 | aodh_service=$(get_or_create_service "aodh" "alarming" "OpenStack Alarming Service")
10 | get_or_create_endpoint $aodh_service "$REGION_NAME" "http://localhost"
11 | mistral_service=$(get_or_create_service "mistral" "workflowv2" "Workflow Service v2")
12 | get_or_create_endpoint $mistral_service "$REGION_NAME" "http://localhost"
13 | senlin_service=$(get_or_create_service "senlin" "clustering" "Senlin Clustering Service")
14 | get_or_create_endpoint $senlin_service "$REGION_NAME" "http://localhost"
15 | monasca_service=$(get_or_create_service "monasca" "monitoring" "Monasca Monitoring Service")
16 | get_or_create_endpoint $monasca_service "$REGION_NAME" "http://localhost"
17 | zaqar_service=$(get_or_create_service "zaqar" "messaging" "Zaqar Service")
18 | get_or_create_endpoint $zaqar_service "$REGION_NAME" "http://localhost"
19 | designate_service=$(get_or_create_service "designate" "dns" "Designate DNS Service")
20 | get_or_create_endpoint $designate_service "$REGION_NAME" "http://localhost"
21 | barbican_service=$(get_or_create_service "barbican" "key-manager" "Barbican Service")
22 | get_or_create_endpoint $barbican_service "$REGION_NAME" "http://localhost"
23 |
24 | source ${DEVSTACK_BASE_DIR}/devstack/openrc demo demo
25 | {{ ansible_python.executable }} ${DEVSTACK_BASE_DIR}/heat-templates/tools/validate-templates ${DEVSTACK_BASE_DIR}/heat-templates
26 | executable: /bin/bash
27 | environment:
28 | DEVSTACK_BASE_DIR: "{{ devstack_base_dir }}"
29 |
--------------------------------------------------------------------------------
/setup.cfg:
--------------------------------------------------------------------------------
1 | [metadata]
2 | name = heat-templates
3 | summary = heat-templates
4 | description_file =
5 | README.rst
6 | author = OpenStack
7 | author_email = openstack-discuss@lists.openstack.org
8 | classifier =
9 | Environment :: OpenStack
10 | Intended Audience :: Information Technology
11 | Intended Audience :: System Administrators
12 | License :: OSI Approved :: Apache Software License
13 | Operating System :: POSIX :: Linux
14 |
--------------------------------------------------------------------------------
/tools/cfn-json2yaml:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 | # not use this file except in compliance with the License. You may obtain
5 | # a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 |
15 | import os
16 | import re
17 | import sys
18 |
19 | from heat.common import template_format
20 |
21 |
22 | def main():
23 | path = sys.argv[1]
24 | if os.path.isdir(path):
25 | convert_directory(path)
26 | elif os.path.isfile(path):
27 | convert_file(path)
28 | else:
29 | print('File or directory not valid: %s' % path)
30 |
31 |
32 | def convert_file(path):
33 | f = open(path, 'r')
34 | print(template_format.convert_json_to_yaml(f.read()))
35 |
36 |
37 | def convert_directory(dirpath):
38 | for path in os.listdir(dirpath):
39 | if not path.endswith('.template') and not path.endswith('.json'):
40 | continue
41 | yamlpath = re.sub('\..*$', '.yaml', path)
42 | print('Writing to %s' % yamlpath)
43 | f = open(os.path.join(dirpath, path), 'r')
44 | out = open(os.path.join(dirpath, yamlpath), 'w')
45 | yml = template_format.convert_json_to_yaml(f.read())
46 | out.write(yml)
47 | out.close()
48 |
49 | if __name__ == '__main__':
50 | main()
51 |
--------------------------------------------------------------------------------
/tools/fetch-cloudformation-examples:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import httplib
4 | import os
5 | import sys
6 | import shutil
7 | import xml.etree.ElementTree as xml
8 |
9 | basepath = os.path.abspath(os.path.join(sys.argv[0],
10 | os.path.pardir,
11 | os.path.pardir,
12 | 'cfn',
13 | 'cloudformation-examples'))
14 |
15 | bucket = 'cloudformation-templates-us-east-1'
16 |
17 | def main():
18 | conn = httplib.HTTPConnection('s3.amazonaws.com')
19 | conn.request('GET', '/%s/' % bucket)
20 | resp = conn.getresponse()
21 |
22 | tree = xml.parse(resp)
23 | rootElement = tree.getroot()
24 |
25 | if os.path.exists(basepath):
26 | print 'Deleting %s' % basepath
27 | shutil.rmtree(basepath)
28 |
29 | os.makedirs(basepath)
30 | print 'Creating %s' % basepath
31 |
32 | for entry in rootElement.iter('{http://s3.amazonaws.com/doc/2006-03-01/}Key'):
33 | key = entry.text
34 | if key.endswith('.html'):
35 | continue
36 | filename = os.path.join(basepath, key)
37 |
38 | print 'Writing to %s' % filename
39 | conn.request('GET', '/%s/%s' % (bucket, key))
40 | resp = conn.getresponse()
41 | contents = resp.read()
42 |
43 | f = open(filename, 'w')
44 | f.write(contents)
45 | f.close()
46 |
47 | if __name__ == '__main__':
48 | main()
49 |
--------------------------------------------------------------------------------
/tools/heat-jeos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Build a JEOS image using OZ
3 |
4 | exit_usage(){
5 | echo "Error : $1"
6 | echo "Usage $0 "
7 | echo "Note tdl file must be a valid Oz TDL"
8 | echo "Note image name must match the name defined in the TDL"
9 | exit 1
10 | }
11 |
12 | DISK_FORMAT="qcow2"
13 | LIBVIRT_IMGDIR="/var/lib/libvirt/images"
14 | DEBUG="-d 3"
15 |
16 | if [ $# -ne 2 ]; then
17 | exit_usage "Insufficient arguments"
18 | fi
19 | TDLFILE=$1
20 | TDLNAME=$2
21 | LIBVIRT_XMLFILE="/tmp/${TDLNAME}_libvirtxml.$$"
22 |
23 | # Sanity check user input
24 | if [ ! -s "${TDLFILE}" ]
25 | then
26 | exit_usage "${TDLFILE} does not exist or is empty"
27 | fi
28 |
29 | if ! grep -q ${TDLNAME} ${TDLFILE}; then
30 | exit_usage "${TDLNAME} not defined in ${TDLFILE}"
31 | fi
32 |
33 | if [ -e "${LIBVIRT_IMGDIR}/${TDLNAME}.dsk" ]; then
34 | exit_usage "${LIBVIRT_IMGDIR}/${TDLNAME}.dsk already exists, please remove then re-run"
35 | fi
36 |
37 | oz-install -u ${DEBUG} ${TDLFILE} -x ${LIBVIRT_XMLFILE}
38 |
39 | DSKFILE="${LIBVIRT_IMGDIR}/${TDLNAME}.dsk"
40 | FMTFILE="${LIBVIRT_IMGDIR}/${TDLNAME}.${DISK_FORMAT}"
41 | qemu-img convert -c -O ${DISK_FORMAT} ${DSKFILE} ${FMTFILE}
42 |
43 | if [ -f ${FMTFILE} ]; then
44 | echo "Image ${FMTFILE} creation complete."
45 | echo "Add the image to glance with the command:"
46 | GLANCECMD="sudo -E glance add name=${TDLNAME} is_public=true disk_format=${DISK_FORMAT} container_format=bare"
47 | echo "${GLANCECMD} < ${FMTFILE}"
48 | else
49 | echo "Error creating image file ${FMTFILE}"
50 | fi
51 |
52 | rm -f ${LIBVIRT_XMLFILE}
53 |
--------------------------------------------------------------------------------
/tools/post_test_hook.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 | # not use this file except in compliance with the License. You may obtain
5 | # a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 |
15 | # This script is executed inside post_test_hook function in devstack gate.
16 |
17 | set -x
18 |
19 | source $BASE/new/devstack/openrc admin admin
20 | source $BASE/new/devstack/functions-common
21 | neutron_service=$(get_or_create_service "neutron" "network" "Neutron Service")
22 | get_or_create_endpoint $neutron_service "$REGION_NAME" "http://localhost"
23 | aodh_service=$(get_or_create_service "aodh" "alarming" "OpenStack Alarming Service")
24 | get_or_create_endpoint $aodh_service "$REGION_NAME" "http://localhost"
25 | mistral_service=$(get_or_create_service "mistral" "workflowv2" "Workflow Service v2")
26 | get_or_create_endpoint $mistral_service "$REGION_NAME" "http://localhost"
27 | senlin_service=$(get_or_create_service "senlin" "clustering" "Senlin Clustering Service")
28 | get_or_create_endpoint $senlin_service "$REGION_NAME" "http://localhost"
29 | monasca_service=$(get_or_create_service "monasca" "monitoring" "Monasca Monitoring Service")
30 | get_or_create_endpoint $monasca_service "$REGION_NAME" "http://localhost"
31 | zaqar_service=$(get_or_create_service "zaqar" "messaging" "Zaqar Service")
32 | get_or_create_endpoint $zaqar_service "$REGION_NAME" "http://localhost"
33 | designate_service=$(get_or_create_service "designate" "dns" "Designate DNS Service")
34 | get_or_create_endpoint $designate_service "$REGION_NAME" "http://localhost"
35 | barbican_service=$(get_or_create_service "barbican" "key-manager" "Barbican Service")
36 | get_or_create_endpoint $barbican_service "$REGION_NAME" "http://localhost"
37 |
38 | source $BASE/new/devstack/openrc demo demo
39 | python $BASE/new/heat-templates/tools/validate-templates $BASE/new/heat-templates
40 |
--------------------------------------------------------------------------------
/tools/validate-templates:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import os
4 | import subprocess
5 | import sys
6 |
7 |
8 | EXCLUDED_DIRS = ('contrib', 'elements', 'invalid', 'playbooks')
9 |
10 |
11 | def main(args):
12 | if len(args) != 1:
13 | raise SystemExit("Takes one argument, the path to the templates")
14 |
15 | path = args[0]
16 | got_error = False
17 | for root, dirs, files in os.walk(path):
18 | # Skip Zuul scripts
19 | if 'roles/run-heat-template-check' in root:
20 | continue
21 | for excluded in EXCLUDED_DIRS:
22 | if excluded in dirs:
23 | dirs.remove(excluded)
24 | for name in files:
25 | if name.endswith((".yaml", ".template")
26 | ) and not name == ".zuul.yaml":
27 | got_error = validate(root, name) or got_error
28 | sys.exit(int(got_error))
29 |
30 |
31 | def validate(base, name):
32 | basename, ext = os.path.splitext(name)
33 | if basename.endswith("_env"):
34 | return False
35 | args = ["openstack", "orchestration", "template", "validate",
36 | "-t", os.path.join(base, name),
37 | "--ignore-errors", "99001"]
38 | base_env = "%s_env%s" % (basename, ext)
39 | env = os.path.join(base, base_env)
40 | if os.path.exists(env):
41 | args.extend(["-e", env])
42 | try:
43 | subprocess.check_output(args, stderr=subprocess.STDOUT)
44 | except subprocess.CalledProcessError as e:
45 | print("Got error validating %s/%s , %s" % (base, name, e.output))
46 | return True
47 | else:
48 | return False
49 |
50 |
51 | if __name__ == '__main__':
52 | main(sys.argv[1:])
53 |
--------------------------------------------------------------------------------