Adds network/cidr mapping into a new service property
[apex-tripleo-heat-templates.git] / puppet / services / database / redis.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Redis service configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33
34 resources:
35   RedisBase:
36     type: ./redis-base.yaml
37     properties:
38       ServiceData: {get_param: ServiceData}
39       ServiceNetMap: {get_param: ServiceNetMap}
40       DefaultPasswords: {get_param: DefaultPasswords}
41       EndpointMap: {get_param: EndpointMap}
42       RoleName: {get_param: RoleName}
43       RoleParameters: {get_param: RoleParameters}
44
45 outputs:
46   role_data:
47     description: Role data for the redis role.
48     value:
49       service_name: redis
50       config_settings:
51         map_merge:
52           - get_attr: [RedisBase, role_data, config_settings]
53           - tripleo.redis.firewall_rules:
54               '108 redis':
55                 dport:
56                   - 6379
57                   - 26379
58       step_config: |
59         include ::tripleo::profile::base::database::redis
60       upgrade_tasks:
61         - name: Check if redis is deployed
62           command: systemctl is-enabled redis
63           tags: common
64           ignore_errors: True
65           register: redis_enabled
66         - name: "PreUpgrade step0,validation: Check if redis is running"
67           shell: >
68             /usr/bin/systemctl show 'redis' --property ActiveState |
69             grep '\bactive\b'
70           when: redis_enabled.rc == 0
71           tags: step0,validation
72         - name: Stop redis service
73           tags: step1
74           when: redis_enabled.rc == 0
75           service: name=redis state=stopped
76         - name: Install redis package if it was disabled
77           tags: step3
78           yum: name=redis state=latest
79           when: redis_enabled.rc != 0