d6c0979eb3
Commit I46941e54a476c7cc8645cd1aff391c9c6c5434de added support for blacklisting servers from triggered Heat deployments. This commit adds that functionality to the remaining Deployments in tripleo-heat-templates for the ExtraConfig interfaces. Since we can not (should not) change the interface to ExtraConfig, Heat conditions are used on the actual <role>ExtraConfigPre and NodeExtraConfig resources instead of using the actions approach on Deployments. Change-Id: I38fdb50d1d966a6c3651980c52298317fa3bece4
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
heat_template_version: pike
|
|
|
|
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
|