Merge "Containerize Cinder-volume for HA"
[apex-tripleo-heat-templates.git] / extraconfig / pre_network / host_config_and_reboot.yaml
1 heat_template_version: pike
2
3 description: >
4   All configurations which require reboot should be initiated via PreNetworkConfig. After
5   this configuration is completed, the corresponding node will be rebooted.
6
7 parameters:
8   server:
9     type: string
10   RoleParameters:
11     type: json
12     description: Role Specific parameters
13     default: {}
14
15 conditions:
16   is_host_config_required: {not: {equals: [{get_param: [RoleParameters, KernelArgs]}, ""]}}
17
18 resources:
19   HostParametersConfig:
20     type: OS::Heat::SoftwareConfig
21     condition: is_host_config_required
22     properties:
23       group: ansible
24       inputs:
25         - name: _KERNEL_ARGS_
26         - name: _TUNED_PROFILE_NAME_
27         - name: _TUNED_CORES_
28       outputs:
29         - name: result
30       config:
31         get_file: ansible_host_config.yaml
32
33   HostParametersDeployment:
34     type: OS::Heat::SoftwareDeployment
35     condition: is_host_config_required
36     properties:
37       name: HostParametersDeployment
38       server:  {get_param: server}
39       config: {get_resource: HostParametersConfig}
40       actions: ['CREATE'] # Only do this on CREATE
41       input_values:
42         _KERNEL_ARGS_: {get_param: [RoleParameters, KernelArgs]}
43         _TUNED_PROFILE_NAME_: {get_param: [RoleParameters, TunedProfileName]}
44         _TUNED_CORES_: {get_param: [RoleParameters, HostIsolatedCoreList]}
45
46   RebootConfig:
47     type: OS::Heat::SoftwareConfig
48     condition: is_host_config_required
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: HostParametersDeployment
61     condition: is_host_config_required
62     properties:
63       name: RebootDeployment
64       server:  {get_param: server}
65       config: {get_resource: RebootConfig}
66       actions: ['CREATE'] # Only do this on CREATE
67       signal_transport: NO_SIGNAL
68
69 outputs:
70   result:
71     condition: is_host_config_required
72     value:
73       get_attr: [HostParametersDeployment, result]
74   stdout:
75     condition: is_host_config_required
76     value:
77       get_attr: [HostParametersDeployment, deploy_stdout]
78   stderr:
79     condition: is_host_config_required
80     value:
81       get_attr: [HostParametersDeployment, deploy_stderr]
82   status_code:
83     condition: is_host_config_required
84     value:
85       get_attr: [HostParametersDeployment, deploy_status_code]