Merge "Enables OpenDaylight clustering in HA deployments"
[apex-tripleo-heat-templates.git] / puppet / services / logging / fluentd-client.yaml
1 heat_template_version: ocata
2
3 description: Fluentd client configured with Puppet
4
5 parameters:
6   ServiceNetMap:
7     default: {}
8     description: Mapping of service_name -> network name. Typically set
9                  via parameter_defaults in the resource registry.  This
10                  mapping overrides those in ServiceNetMapDefaults.
11     type: json
12   DefaultPasswords:
13     default: {}
14     type: json
15   EndpointMap:
16     default: {}
17     description: >
18       Mapping of service endpoint -> protocol. Typically set
19       via parameter_defaults in the resource registry.
20     type: json
21
22 resources:
23   FluentdBase:
24     type: ./fluentd-base.yaml
25     properties:
26       EndpointMap: {get_param: EndpointMap}
27       ServiceNetMap: {get_param: ServiceNetMap}
28       DefaultPasswords: {get_param: DefaultPasswords}
29
30   LoggingConfiguration:
31     type: OS::TripleO::LoggingConfiguration
32
33 outputs:
34   role_data:
35     description: Role data for the Fluentd client role.
36     value:
37       service_name: fluentd_client
38       config_settings:
39         map_merge:
40           - get_attr: [FluentdBase, role_data, config_settings]
41           - tripleo::profile::base::logging::fluentd::fluentd_servers:
42               get_attr: [LoggingConfiguration, LoggingServers]
43             tripleo::profile::base::logging::fluentd::fluentd_filters:
44               yaql:
45                 expression: >
46                   $.data.filters.flatten().where($)
47                 data:
48                   filters:
49                     - get_attr: [LoggingConfiguration, LoggingDefaultFilters]
50                     - get_attr: [LoggingConfiguration, LoggingExtraFilters]
51             tripleo::profile::base::logging::fluentd::fluentd_pos_file_path:
52               get_attr: [LoggingConfiguration, LoggingPosFilePath]
53             tripleo::profile::base::logging::fluentd::fluentd_use_ssl:
54               get_attr: [LoggingConfiguration, LoggingUsesSSL]
55             tripleo::profile::base::logging::fluentd::fluentd_ssl_certificate:
56               get_attr: [LoggingConfiguration, LoggingSSLCertificate]
57             tripleo::profile::base::logging::fluentd::fluentd_ssl_key:
58               get_attr: [LoggingConfiguration, LoggingSSLKey]
59             tripleo::profile::base::logging::fluentd::fluentd_ssl_key_passphrase:
60               get_attr: [LoggingConfiguration, LoggingSSLKeyPassphrase]
61             tripleo::profile::base::logging::fluentd::fluentd_shared_key:
62               get_attr: [LoggingConfiguration, LoggingSharedKey]
63       step_config: |
64         include ::tripleo::profile::base::logging::fluentd
65       upgrade_tasks:
66         - name: Check if fluentd_client is deployed
67           command: systemctl is-enabled fluentd
68           tags: common
69           ignore_errors: True
70           register: fluentd_client_enabled
71         - name: Check status of fluentd service
72           shell: >
73             /usr/bin/systemctl show fluentd --property ActiveState |
74             grep '\bactive\b'
75           when: fluentd_client_enabled.rc == 0
76           tags: step0,validation
77         - name: Stop fluentd service
78           tags: step1
79           when: fluentd_client_enabled.rc == 0
80           service: name=fluentd state=stopped
81         - name: Install fluentd package if it was disabled
82           tags: step3
83           yum: name=fluentd state=latest
84           when: fluentd_client_enabled.rc != 0