Add docker templates for octavia services
[apex-tripleo-heat-templates.git] / extraconfig / pre_network / host_config_and_reboot.role.j2.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   {{role}}KernelArgs:
11     type: string
12     default: ""
13   {{role}}TunedProfileName:
14     type: string
15     default: ""
16   {{role}}HostCpusList:
17     type: string
18     default: ""
19
20 conditions:
21   param_exists:
22     or:
23       - not:
24           equals:
25           - get_param: {{role}}KernelArgs
26           - ""
27       - not:
28           equals:
29           - get_param: {{role}}TunedProfileName
30           - ""
31
32 resources:
33
34   HostParametersConfig:
35     type: OS::Heat::SoftwareConfig
36     condition: param_exists
37     properties:
38       group: ansible
39       inputs:
40         - name: _KERNEL_ARGS_
41         - name: _TUNED_PROFILE_NAME_
42         - name: _HOST_CPUS_LIST_
43       outputs:
44         - name: result
45       config:
46         get_file: ansible_host_config.ansible
47
48   HostParametersDeployment:
49     type: OS::Heat::SoftwareDeployment
50     condition: param_exists
51     properties:
52       name: HostParametersDeployment
53       server:  {get_param: server}
54       config: {get_resource: HostParametersConfig}
55       actions: ['CREATE'] # Only do this on CREATE
56       input_values:
57         _KERNEL_ARGS_: {get_param: {{role}}KernelArgs}
58         _TUNED_PROFILE_NAME_: {get_param: {{role}}TunedProfileName}
59         _HOST_CPUS_LIST_: {get_param: {{role}}HostCpusList}
60
61   RebootConfig:
62     type: OS::Heat::SoftwareConfig
63     condition: param_exists
64     properties:
65       group: script
66       config: |
67         #!/bin/bash
68         # Stop os-collect-config to avoid any race collecting another
69         # deployment before reboot happens
70         systemctl stop os-collect-config.service
71         /sbin/reboot
72
73   RebootDeployment:
74     type: OS::Heat::SoftwareDeployment
75     condition: param_exists
76     depends_on: HostParametersDeployment
77     properties:
78       name: RebootDeployment
79       server:  {get_param: server}
80       config: {get_resource: RebootConfig}
81       actions: ['CREATE'] # Only do this on CREATE
82       signal_transport: NO_SIGNAL
83
84 outputs:
85   result:
86     value:
87       get_attr: [HostParametersDeployment, result]
88     condition: param_exists
89   stdout:
90     value:
91       get_attr: [HostParametersDeployment, deploy_stdout]
92     condition: param_exists
93   stderr:
94     value:
95       get_attr: [HostParametersDeployment, deploy_stderr]
96     condition: param_exists
97   status_code:
98     value:
99       get_attr: [HostParametersDeployment, deploy_status_code]
100     condition: param_exists