Merge "Fix wrong permission on database during mysql_init tasks." into stable/pike
[apex-tripleo-heat-templates.git] / docker / services / fluentd-client.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized fluentd services
5
6 parameters:
7   DockerFluentdClientImage:
8     description: image
9     type: string
10   DockerFluentdConfigImage:
11     description: The container image to use fluentd config_volume
12     type: string
13   EndpointMap:
14     default: {}
15     description: Mapping of service endpoint -> protocol. Typically set
16                  via parameter_defaults in the resource registry.
17     type: json
18   ServiceData:
19     default: {}
20     description: Dictionary packing service data
21     type: json
22   ServiceNetMap:
23     default: {}
24     description: Mapping of service_name -> network name. Typically set
25                  via parameter_defaults in the resource registry.  This
26                  mapping overrides those in ServiceNetMapDefaults.
27     type: json
28   DefaultPasswords:
29     default: {}
30     type: json
31   RoleName:
32     default: ''
33     description: Role name on which the service is applied
34     type: string
35   RoleParameters:
36     default: {}
37     description: Parameters specific to the role
38     type: json
39
40 resources:
41
42   ContainersCommon:
43     type: ./containers-common.yaml
44
45   FluentdClientBase:
46     type: ../../puppet/services/logging/fluentd-client.yaml
47     properties:
48       EndpointMap: {get_param: EndpointMap}
49       ServiceData: {get_param: ServiceData}
50       ServiceNetMap: {get_param: ServiceNetMap}
51       DefaultPasswords: {get_param: DefaultPasswords}
52       RoleName: {get_param: RoleName}
53       RoleParameters: {get_param: RoleParameters}
54
55 outputs:
56   role_data:
57     description: Role data for the fluentd role.
58     value:
59       service_name: {get_attr: [FluentdClientBase, role_data, service_name]}
60       config_settings:
61         map_merge:
62           - {get_attr: [FluentdClientBase, role_data, config_settings]}
63           - tripleo::profile::base::logging::fluentd::fluentd_path_transform:
64               - /var/log/
65               - /var/log/containers/
66       step_config: &step_config
67         get_attr: [FluentdClientBase, role_data, step_config]
68       # BEGIN DOCKER SETTINGS
69       puppet_config:
70         config_volume: fluentd
71         puppet_tags: config
72         step_config: *step_config
73         config_image: {get_param: DockerFluentdConfigImage}
74       kolla_config:
75         /var/lib/kolla/config_files/fluentd.json:
76           command: /usr/bin/fluentd -c /etc/fluentd/fluent.conf -o /var/log/fluentd/fluentd.log
77           config_files:
78             - source: "/var/lib/kolla/config_files/src/*"
79               dest: "/"
80               merge: true
81               preserve_properties: true
82           permissions:
83             - path: /var/lib/fluentd
84               owner: fluentd:fluentd
85               recurse: true
86             - path: /var/log/fluentd
87               owner: fluentd:fluentd
88               recurse: true
89       docker_config:
90         step_3:
91           fluentd_client:
92             image: {get_param: DockerFluentdClientImage}
93             net: host
94             privileged: true
95             user: root
96             restart: always
97             volumes:
98               list_concat:
99                 - {get_attr: [ContainersCommon, volumes]}
100                 -
101                   - /var/cache/containers/fluentd:/var/cache/fluentd:rw
102                   - /var/lib/kolla/config_files/fluentd.json:/var/lib/kolla/config_files/config.json:ro
103                   - /var/lib/config-data/puppet-generated/fluentd/:/var/lib/kolla/config_files/src:ro
104                   - /var/log/containers:/var/log/containers:ro
105                   - /var/log/containers/fluentd:/var/log/fluentd:rw
106             environment:
107               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
108       host_prep_tasks:
109         - name: create persistent logs directory for fluentd
110           file:
111             path: /var/log/containers/fluentd
112             state: directory
113         - name: create persistent cache directory
114           file:
115             path: /var/cache/containers/fluentd
116             state: directory
117       upgrade_tasks:
118         - name: Stop and disable fluentd service
119           tags: step2
120           service: name=fluentd.service state=stopped enabled=no
121