Merge "Add ComputeHCI role and related validations"
[apex-tripleo-heat-templates.git] / extraconfig / pre_network / config_then_reboot.yaml
1 heat_template_version: pike
2
3 description: >
4   Do some configuration, then reboot - sometimes needed for early-boot
5   changes such as modifying kernel configuration
6
7 parameters:
8   server:
9     type: string
10   deployment_actions:
11     default: ['CREATE', 'UPDATE']
12     type: comma_delimited_list
13     description: >
14       List of stack actions that will trigger any deployments in this
15       templates. The actions will be an empty list of the server is in the
16       toplevel DeploymentServerBlacklist parameter's value.
17
18 conditions:
19   deployment_actions_empty:
20     equals:
21       - {get_param: deployment_actions}
22       - []
23
24 resources:
25
26   SomeConfig:
27     type: OS::Heat::SoftwareConfig
28     properties:
29       group: script
30       config: |
31         #!/bin/bash
32         echo "did some config before reboot" > /root/pre-reboot-config
33
34   SomeDeployment:
35     type: OS::Heat::SoftwareDeployment
36     properties:
37       name: SomeDeployment
38       server:  {get_param: server}
39       config: {get_resource: SomeConfig}
40       actions:
41         if:
42           - deployment_actions_empty
43           - []
44           - ['CREATE'] # Only do this on CREATE
45       actions: ['CREATE'] # Only do this on CREATE
46
47   RebootConfig:
48     type: OS::Heat::SoftwareConfig
49     properties:
50       group: script
51       config: |
52         #!/bin/bash
53         # Stop os-collect-config to avoid any race collecting another
54         # deployment before reboot happens
55         systemctl stop os-collect-config.service
56         /sbin/reboot
57
58   RebootDeployment:
59     type: OS::Heat::SoftwareDeployment
60     depends_on: SomeDeployment
61     properties:
62       name: RebootDeployment
63       server:  {get_param: server}
64       config: {get_resource: RebootConfig}
65       actions:
66         if:
67           - deployment_actions_empty
68           - []
69           - ['CREATE'] # Only do this on CREATE
70       signal_transport: NO_SIGNAL