Merge "Store role_data in an OS::Heat::Value resource"
[apex-tripleo-heat-templates.git] / puppet / services / keepalived.yaml
1 heat_template_version: pike
2
3 description: >
4   Keepalived service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   ControlVirtualInterface:
30     default: ''
31     description: >
32         Interface where virtual ip will be assigned.  This value will be
33         automatically set by the deployment tool.  Overriding here will
34         override automatic setting.
35     type: string
36   PublicVirtualInterface:
37     default: ''
38     description: >
39         Interface where virtual ip will be assigned.  This value will be
40         automatically set by the deployment tool.  Overriding here will
41         override automatic setting.
42     type: string
43   MonitoringSubscriptionKeepalived:
44     default: 'overcloud-keepalived'
45     type: string
46
47 conditions:
48
49   control_iface_empty: {equals : [{get_param: ControlVirtualInterface}, '']}
50   public_iface_empty: {equals : [{get_param: PublicVirtualInterface}, '']}
51
52 outputs:
53   role_data:
54     description: Role data for the Keepalived role.
55     value:
56       service_name: keepalived
57       monitoring_subscription: {get_param: MonitoringSubscriptionKeepalived}
58       config_settings:
59         map_merge:
60         - tripleo.keepalived.firewall_rules:
61             '106 keepalived vrrp':
62               proto: vrrp
63         -
64           if:
65           - control_iface_empty
66           - {}
67           - tripleo::keepalived::control_virtual_interface: {get_param: ControlVirtualInterface}
68         -
69           if:
70           - public_iface_empty
71           - {}
72           - tripleo::keepalived::public_virtual_interface: {get_param: PublicVirtualInterface}
73       step_config: |
74         include ::tripleo::profile::base::keepalived
75       upgrade_tasks:
76         - name: Stop keepalived service
77           tags: step1
78           service: name=keepalived state=stopped
79         - name: Start keepalived service
80           tags: step4 # Needed at step 4 for mysql
81           service: name=keepalived state=started
82