Carlos Camacho 44ef2a3ec1 Change template names to rocky
The new master branch should point now to rocky.

So, HOT templates should specify that they might contain features
for rocky release [1]

Also, this submission updates the yaml validation to use only latest
heat_version alias. There are cases in which we will need to set
the version for specific templates i.e. mixed versions, so there
is added a variable to assign specific templates to specific heat_version
aliases, avoiding the introductions of error by bulk replacing the
the old version in new releases.

[1]: https://docs.openstack.org/heat/latest/template_guide/hot_spec.html#rocky
Change-Id: Ib17526d9cc453516d99d4659ee5fa51a5aa7fb4b
2018-05-09 08:28:42 +02:00

71 lines
1.8 KiB
YAML

heat_template_version: rocky
description: >
Do some configuration, then reboot - sometimes needed for early-boot
changes such as modifying kernel configuration
parameters:
server:
type: string
deployment_actions:
default: ['CREATE', 'UPDATE']
type: comma_delimited_list
description: >
List of stack actions that will trigger any deployments in this
templates. The actions will be an empty list of the server is in the
toplevel DeploymentServerBlacklist parameter's value.
conditions:
deployment_actions_empty:
equals:
- {get_param: deployment_actions}
- []
resources:
SomeConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
echo "did some config before reboot" > /root/pre-reboot-config
SomeDeployment:
type: OS::Heat::SoftwareDeployment
properties:
name: SomeDeployment
server: {get_param: server}
config: {get_resource: SomeConfig}
actions:
if:
- deployment_actions_empty
- []
- ['CREATE'] # Only do this on CREATE
actions: ['CREATE'] # Only do this on CREATE
RebootConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
# Stop os-collect-config to avoid any race collecting another
# deployment before reboot happens
systemctl stop os-collect-config.service
/sbin/reboot
RebootDeployment:
type: OS::Heat::SoftwareDeployment
depends_on: SomeDeployment
properties:
name: RebootDeployment
server: {get_param: server}
config: {get_resource: RebootConfig}
actions:
if:
- deployment_actions_empty
- []
- ['CREATE'] # Only do this on CREATE
signal_transport: NO_SIGNAL