|
7 | 7 | #
|
8 | 8 | # == Parameters
|
9 | 9 | #
|
10 |
| -# [*rabbit_host*] |
11 |
| -# (Optional) IP or hostname of the rabbit server. |
12 |
| -# Defaults to '127.0.0.1'. |
13 |
| -# |
14 |
| -# [*rabbit_port*] |
15 |
| -# (Optional) Port of the rabbit server. |
16 |
| -# Defaults to 5672. |
17 |
| -# |
18 |
| -# [*rabbit_hosts*] |
19 |
| -# (Optional) IP or hostname of the rabbits servers. |
20 |
| -# comma separated array (ex: ['1.0.0.10:5672','1.0.0.11:5672']) |
21 |
| -# Defaults to undef. |
22 |
| -# |
23 |
| -# [*rabbit_user*] |
24 |
| -# (Optional) Username for rabbit. |
25 |
| -# Defaults to 'guest'. |
26 |
| -# |
27 |
| -# [*rabbit_password*] |
28 |
| -# (Optional) Password for rabbit user. |
29 |
| -# Defaults to 'guest'. |
30 |
| -# |
31 |
| -# [*rabbit_virtual_host*] |
32 |
| -# (Optional) Virtual host to use. |
33 |
| -# Defaults to '/'. |
| 10 | +# [*default_transport_url*] |
| 11 | +# (optional) A URL representing the messaging driver to use and its full |
| 12 | +# configuration. Transport URLs take the form: |
| 13 | +# transport://user:pass@host1:port[,hostN:portN]/virtual_host |
| 14 | +# Defaults to $::os_service_default |
34 | 15 | #
|
35 | 16 | # [*driver*]
|
36 | 17 | # (Optional) The Drivers(s) to handle sending notifications.
|
|
58 | 39 | # Whether to send events to messaging driver in a background thread
|
59 | 40 | # Defaults to false
|
60 | 41 | #
|
| 42 | +# === DEPRECATED PARAMETERS |
| 43 | +# |
| 44 | +# [*rabbit_host*] |
| 45 | +# (Optional) IP or hostname of the rabbit server. |
| 46 | +# Defaults to '127.0.0.1'. |
| 47 | +# |
| 48 | +# [*rabbit_port*] |
| 49 | +# (Optional) Port of the rabbit server. |
| 50 | +# Defaults to 5672. |
| 51 | +# |
| 52 | +# [*rabbit_hosts*] |
| 53 | +# (Optional) IP or hostname of the rabbits servers. |
| 54 | +# comma separated array (ex: ['1.0.0.10:5672','1.0.0.11:5672']) |
| 55 | +# Defaults to undef. |
| 56 | +# |
| 57 | +# [*rabbit_user*] |
| 58 | +# (Optional) Username for rabbit. |
| 59 | +# Defaults to 'guest'. |
| 60 | +# |
| 61 | +# [*rabbit_password*] |
| 62 | +# (Optional) Password for rabbit user. |
| 63 | +# Defaults to 'guest'. |
| 64 | +# |
| 65 | +# [*rabbit_virtual_host*] |
| 66 | +# (Optional) Virtual host to use. |
| 67 | +# Defaults to '/'. |
| 68 | +# |
61 | 69 | # == Examples
|
62 | 70 | #
|
63 | 71 | # == Authors
|
|
69 | 77 | # Copyright 2013 eNovance licensing@enovance.com
|
70 | 78 | #
|
71 | 79 | class swift::proxy::ceilometer(
|
72 |
| - $rabbit_user = 'guest', |
73 |
| - $rabbit_password = 'guest', |
74 |
| - $rabbit_host = '127.0.0.1', |
75 |
| - $rabbit_port = '5672', |
76 |
| - $rabbit_hosts = undef, |
77 |
| - $rabbit_virtual_host = '/', |
78 |
| - $driver = undef, |
79 |
| - $topic = undef, |
80 |
| - $control_exchange = undef, |
81 |
| - $ensure = 'present', |
82 |
| - $group = 'ceilometer', |
83 |
| - $nonblocking_notify = false, |
| 80 | + $default_transport_url = undef, |
| 81 | + $driver = undef, |
| 82 | + $topic = undef, |
| 83 | + $control_exchange = undef, |
| 84 | + $ensure = 'present', |
| 85 | + $group = 'ceilometer', |
| 86 | + $nonblocking_notify = false, |
| 87 | + # DEPRECATED PARAMETERS |
| 88 | + $rabbit_user = 'guest', |
| 89 | + $rabbit_password = 'guest', |
| 90 | + $rabbit_host = '127.0.0.1', |
| 91 | + $rabbit_port = '5672', |
| 92 | + $rabbit_hosts = undef, |
| 93 | + $rabbit_virtual_host = '/', |
84 | 94 | ) inherits swift {
|
85 | 95 |
|
86 | 96 | include ::swift::deps
|
87 | 97 |
|
88 |
| - if(is_array($rabbit_hosts)) { |
89 |
| - $rabbit_hosts_with_creds = prefix($rabbit_hosts, "${rabbit_user}:${rabbit_password}@") |
90 |
| - } |
91 |
| - |
92 |
| - if !$rabbit_hosts { |
93 |
| - $url = "rabbit://${rabbit_user}:${rabbit_password}@${rabbit_host}:${rabbit_port}/${rabbit_virtual_host}" |
| 98 | + if $default_transport_url { |
| 99 | + $amqp_url = $default_transport_url |
94 | 100 | } else {
|
95 |
| - $hosts = join($rabbit_hosts_with_creds, ',') |
96 |
| - $url = "rabbit://${hosts}/${rabbit_virtual_host}" |
| 101 | + warning("swift::proxy::ceilometer::rabbit_host, |
| 102 | +swift::proxy::ceilometer::rabbit_hosts, swift::proxy::ceilometer::rabbit_password, \ |
| 103 | +swift::proxy::ceilometer::rabbit_port, swift::proxy::ceilometer::rabbit_userid \ |
| 104 | +and swift::proxy::ceilometer::rabbit_virtual_host are \ |
| 105 | +deprecated. Please use swift::proxy::ceilometer::default_transport_url instead.") |
| 106 | + |
| 107 | + if(is_array($rabbit_hosts)) { |
| 108 | + $rabbit_hosts_with_creds = prefix($rabbit_hosts, "${rabbit_user}:${rabbit_password}@") |
| 109 | + } |
| 110 | + |
| 111 | + if !$rabbit_hosts { |
| 112 | + $amqp_url = "rabbit://${rabbit_user}:${rabbit_password}@${rabbit_host}:${rabbit_port}/${rabbit_virtual_host}" |
| 113 | + } else { |
| 114 | + $hosts = join($rabbit_hosts_with_creds, ',') |
| 115 | + $amqp_url = "rabbit://${hosts}/${rabbit_virtual_host}" |
| 116 | + } |
97 | 117 | }
|
98 | 118 |
|
99 | 119 | User['swift'] {
|
|
115 | 135 | swift_proxy_config {
|
116 | 136 | 'filter:ceilometer/topic': value => $topic;
|
117 | 137 | 'filter:ceilometer/driver': value => $driver;
|
118 |
| - 'filter:ceilometer/url': value => $url; |
| 138 | + 'filter:ceilometer/url': value => $amqp_url; |
119 | 139 | 'filter:ceilometer/control_exchange': value => $control_exchange;
|
120 | 140 | 'filter:ceilometer/paste.filter_factory': value => 'ceilometermiddleware.swift:filter_factory';
|
121 | 141 | 'filter:ceilometer/nonblocking_notify': value => $nonblocking_notify;
|
|
0 commit comments