Merge "Use FQDN for rabbitmq's nodename env variable"
[apex-tripleo-heat-templates.git] / puppet / services / rabbitmq.yaml
1 heat_template_version: 2016-10-14
2
3 description: >
4   RabbitMQ 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   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21   RabbitUserName:
22     default: guest
23     description: The username for RabbitMQ
24     type: string
25   RabbitPassword:
26     description: The password for RabbitMQ
27     type: string
28     hidden: true
29   RabbitFDLimit:
30     default: 65536
31     description: Configures RabbitMQ FD limit
32     type: string
33   RabbitIPv6:
34     default: false
35     description: Enable IPv6 in RabbitMQ
36     type: boolean
37   RabbitCookie:
38     type: string
39     default: ''
40     hidden: true
41   RabbitHAQueues:
42     description:
43       The number of HA queues to be configured in rabbit. The default is 0 which will
44       be automatically overridden to CEIL(N/2) where N is the number of nodes running
45       rabbitmq.
46     default: 0
47     type: number
48   MonitoringSubscriptionRabbitmq:
49     default: 'overcloud-rabbitmq'
50     type: string
51
52 outputs:
53   role_data:
54     description: Role data for the RabbitMQ role.
55     value:
56       service_name: rabbitmq
57       monitoring_subscription: {get_param: MonitoringSubscriptionRabbitmq}
58       config_settings:
59         rabbitmq::file_limit: {get_param: RabbitFDLimit}
60         rabbitmq::default_user: {get_param: RabbitUserName}
61         rabbitmq::default_pass: {get_param: RabbitPassword}
62         rabbit_ipv6: {get_param: RabbitIPv6}
63         tripleo.rabbitmq.firewall_rules:
64           '109 rabbitmq':
65             dport:
66               - 4369
67               - 5672
68               - 25672
69         rabbitmq::delete_guest_user: false
70         rabbitmq::wipe_db_on_cookie_change: true
71         rabbitmq::port: '5672'
72         rabbitmq::package_source: undef
73         rabbitmq::repos_ensure: false
74         rabbitmq::tcp_keepalive: true
75         rabbitmq_environment:
76           RABBITMQ_NODENAME:
77             str_replace:
78               template:
79                 "rabbit@%{hiera('fqdn_$NETWORK')}"
80               params:
81                 $NETWORK: {get_param: [ServiceNetMap, RabbitmqNetwork]}
82           RABBITMQ_USE_LONGNAME: true
83           RABBITMQ_SERVER_ERL_ARGS: '"+K true +P 1048576 -kernel inet_default_connect_options [{nodelay,true},{raw,6,18,<<5000:64/native>>}] -kernel inet_default_listen_options [{raw,6,18,<<5000:64/native>>}]"'
84         rabbitmq_kernel_variables:
85           inet_dist_listen_min: '25672'
86           inet_dist_listen_max: '25672'
87         rabbitmq_config_variables:
88           cluster_partition_handling: 'pause_minority'
89           queue_master_locator: '<<"min-masters">>'
90           loopback_users: '[]'
91         rabbitmq::erlang_cookie:
92           yaql:
93             expression: $.data.passwords.where($ != '').first()
94             data:
95               passwords:
96                 - {get_param: RabbitCookie}
97                 - {get_param: [DefaultPasswords, rabbit_cookie]}
98         # NOTE: bind IP is found in Heat replacing the network name with the
99         # local node IP for the given network; replacement examples
100         # (eg. for internal_api):
101         # internal_api -> IP
102         # internal_api_uri -> [IP]
103         # internal_api_subnet - > IP/CIDR
104         rabbitmq::node_ip_address: {get_param: [ServiceNetMap, RabbitmqNetwork]}
105         rabbitmq::nr_ha_queues: {get_param: RabbitHAQueues}
106       step_config: |
107         include ::tripleo::profile::base::rabbitmq
108       upgrade_tasks:
109         - name: Stop rabbitmq service
110           tags: step2
111           service: name=rabbitmq-server state=stopped
112         - name: Start rabbitmq service
113           tags: step6
114           service: name=rabbitmq-server state=started
115