Mount hostpath logs on /var/log
[apex-tripleo-heat-templates.git] / docker / services / database / redis.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Redis services
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerRedisImage:
12     description: image
13     default: 'centos-binary-redis:latest'
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29
30 resources:
31
32   RedisBase:
33     type: ../../../puppet/services/database/redis.yaml
34     properties:
35       EndpointMap: {get_param: EndpointMap}
36       ServiceNetMap: {get_param: ServiceNetMap}
37       DefaultPasswords: {get_param: DefaultPasswords}
38
39 outputs:
40   role_data:
41     description: Role data for the Redis API role.
42     value:
43       service_name: {get_attr: [RedisBase, role_data, service_name]}
44       config_settings:
45         map_merge:
46           - {get_attr: [RedisBase, role_data, config_settings]}
47           - redis::daemonize: false
48       step_config: &step_config
49         get_attr: [RedisBase, role_data, step_config]
50       service_config_settings: {get_attr: [RedisBase, role_data, service_config_settings]}
51       # BEGIN DOCKER SETTINGS
52       puppet_config:
53         config_volume: 'redis'
54         # NOTE: we need the exec tag to copy /etc/redis.conf.puppet to
55         # /etc/redis.conf
56         # https://github.com/arioch/puppet-redis/commit/1c004143223e660cbd433422ff8194508aab9763
57         puppet_tags: 'exec'
58         step_config: *step_config
59         config_image: &redis_image
60           list_join:
61             - '/'
62             - [ {get_param: DockerNamespace}, {get_param: DockerRedisImage} ]
63       kolla_config:
64         /var/lib/kolla/config_files/redis.json:
65           command: /usr/bin/redis-server /etc/redis.conf
66           permissions:
67             - path: /var/run/redis
68               owner: redis:redis
69               recurse: true
70       docker_config:
71         step_1:
72           redis:
73             image: *redis_image
74             net: host
75             privileged: false
76             restart: always
77             volumes:
78               - /run:/run
79               - /var/lib/kolla/config_files/redis.json:/var/lib/kolla/config_files/config.json:ro
80               - /var/lib/config-data/redis/etc/:/etc/:ro
81               - /etc/localtime:/etc/localtime:ro
82               - logs:/var/log/kolla
83             environment:
84               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
85       host_prep_tasks:
86         - name: create /var/run/redis
87           file:
88             path: /var/run/redis
89             state: directory
90       upgrade_tasks:
91         - name: Stop and disable redis service
92           tags: step2
93           service: name=redis state=stopped enabled=no