Merge "Ps Cinder: Added support for password less login"
[apex-tripleo-heat-templates.git] / puppet / services / rabbitmq.yaml
1 heat_template_version: pike
2
3 description: >
4   RabbitMQ 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   RabbitUserName:
34     default: guest
35     description: The username for RabbitMQ
36     type: string
37   RabbitPassword:
38     description: The password for RabbitMQ
39     type: string
40     hidden: true
41   RabbitFDLimit:
42     default: 65536
43     description: Configures RabbitMQ FD limit
44     type: string
45   RabbitIPv6:
46     default: false
47     description: Enable IPv6 in RabbitMQ
48     type: boolean
49   RabbitCookie:
50     type: string
51     default: ''
52     hidden: true
53   RabbitHAQueues:
54     description:
55       The number of HA queues to be configured in rabbit. The default is -1 which
56       translates to "ha-mode all". The special value 0 will be automatically
57       overridden to CEIL(N/2) where N is the number of nodes running rabbitmq.
58     default: -1
59     type: number
60   MonitoringSubscriptionRabbitmq:
61     default: 'overcloud-rabbitmq'
62     type: string
63   EnableInternalTLS:
64     type: boolean
65     default: false
66
67 conditions:
68   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
69
70 outputs:
71   role_data:
72     description: Role data for the RabbitMQ role.
73     value:
74       service_name: rabbitmq
75       monitoring_subscription: {get_param: MonitoringSubscriptionRabbitmq}
76       config_settings:
77         map_merge:
78           -
79             rabbitmq::file_limit: {get_param: RabbitFDLimit}
80             rabbitmq::default_user: {get_param: RabbitUserName}
81             rabbitmq::default_pass: {get_param: RabbitPassword}
82             rabbit_ipv6: {get_param: RabbitIPv6}
83             tripleo.rabbitmq.firewall_rules:
84               '109 rabbitmq':
85                 dport:
86                   - 4369
87                   - 5672
88                   - 25672
89             rabbitmq::delete_guest_user: false
90             rabbitmq::wipe_db_on_cookie_change: true
91             rabbitmq::port: '5672'
92             rabbitmq::package_provider: yum
93             rabbitmq::package_source: undef
94             rabbitmq::repos_ensure: false
95             rabbitmq::tcp_keepalive: true
96             rabbitmq_environment:
97               NODE_PORT: ''
98               NODE_IP_ADDRESS: ''
99               RABBITMQ_NODENAME: "rabbit@%{::hostname}"
100               RABBITMQ_SERVER_ERL_ARGS: '"+K true +P 1048576 -kernel inet_default_connect_options [{nodelay,true},{raw,6,18,<<15000:64/native>>}] -kernel inet_default_listen_options [{raw,6,18,<<15000:64/native>>}]"'
101               'export ERL_EPMD_ADDRESS': "%{hiera('rabbitmq::interface')}"
102             rabbitmq_kernel_variables:
103               inet_dist_listen_min: '25672'
104               inet_dist_listen_max: '25672'
105             rabbitmq_config_variables:
106               cluster_partition_handling: 'pause_minority'
107               queue_master_locator: '<<"min-masters">>'
108               loopback_users: '[]'
109             rabbitmq::erlang_cookie:
110               yaql:
111                 expression: $.data.passwords.where($ != '').first()
112                 data:
113                   passwords:
114                     - {get_param: RabbitCookie}
115                     - {get_param: [DefaultPasswords, rabbit_cookie]}
116             # NOTE: bind IP is found in Heat replacing the network name with the
117             # local node IP for the given network; replacement examples
118             # (eg. for internal_api):
119             # internal_api -> IP
120             # internal_api_uri -> [IP]
121             # internal_api_subnet - > IP/CIDR
122             rabbitmq::interface: {get_param: [ServiceNetMap, RabbitmqNetwork]}
123             rabbitmq::nr_ha_queues: {get_param: RabbitHAQueues}
124             rabbitmq::ssl: {get_param: EnableInternalTLS}
125             rabbitmq::ssl_port: '5672'
126             rabbitmq::ssl_depth: 1
127             rabbitmq::ssl_only: {get_param: EnableInternalTLS}
128             rabbitmq::ssl_interface: {get_param: [ServiceNetMap, RabbitmqNetwork]}
129             # TODO(jaosorior): Remove this once we set a proper default in
130             # puppet-tripleo
131             tripleo::profile::base::rabbitmq::enable_internal_tls: {get_param: EnableInternalTLS}
132           -
133             if:
134             - internal_tls_enabled
135             - generate_service_certificates: true
136               tripleo::profile::base::rabbitmq::certificate_specs:
137                 service_certificate: '/etc/pki/tls/certs/rabbitmq.crt'
138                 service_key: '/etc/pki/tls/private/rabbitmq.key'
139                 hostname:
140                   str_replace:
141                     template: "%{hiera('fqdn_NETWORK')}"
142                     params:
143                       NETWORK: {get_param: [ServiceNetMap, RabbitmqNetwork]}
144                 principal:
145                   str_replace:
146                     template: "rabbitmq/%{hiera('fqdn_NETWORK')}"
147                     params:
148                       NETWORK: {get_param: [ServiceNetMap, RabbitmqNetwork]}
149             - {}
150       step_config: |
151         include ::tripleo::profile::base::rabbitmq
152       upgrade_tasks:
153         - name: Stop rabbitmq service
154           tags: step2
155           service: name=rabbitmq-server state=stopped
156         - name: Start rabbitmq service
157           tags: step4
158           service: name=rabbitmq-server state=started
159       metadata_settings:
160         if:
161           - internal_tls_enabled
162           -
163             - service: rabbitmq
164               network: {get_param: [ServiceNetMap, RabbitmqNetwork]}
165               type: node
166           - null