24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# File 'manifests/profile/rabbitmq.pp', line 24
class st2::profile::rabbitmq (
$username = $::st2::rabbitmq_username,
$password = $::st2::rabbitmq_password,
$port = $::st2::rabbitmq_port,
$bind_ip = $::st2::rabbitmq_bind_ip,
$vhost = $::st2::rabbitmq_vhost,
$erlang_url = $::st2::erlang_url,
$erlang_key = $::st2::erlang_key
) inherits st2 {
# RHEL 8 Requires another repo in addition to epel to be installed
if ($::osfamily == 'RedHat') and ($facts['os']['release']['major'] == '8') {
$repos_ensure = true
# This is required because when using the latest version of rabbitmq because the latest version in EPEL
# for Erlang is 22.0.7 which is not compatible: https://www.rabbitmq.com/which-erlang.html
yumrepo { 'erlang':
ensure => present,
name => 'rabbitmq_erlang',
baseurl => $erlang_url,
gpgkey => $erlang_key,
enabled => 1,
gpgcheck => 1,
before => Class['rabbitmq::repo::rhel'],
}
}
else {
$repos_ensure = false
}
# In new versions of the RabbitMQ module we need to explicitly turn off
# the ranch TCP settings so that Kombu can connect via AMQP
class { 'rabbitmq' :
config_ranch => false,
repos_ensure => $repos_ensure,
delete_guest_user => true,
port => $port,
environment_variables => {
'RABBITMQ_NODE_IP_ADDRESS' => $::st2::rabbitmq_bind_ip,
},
}
contain 'rabbitmq'
rabbitmq_user { $username:
admin => true,
password => $password,
}
rabbitmq_vhost { $vhost:
ensure => present,
}
rabbitmq_user_permissions { "${username}@${vhost}":
configure_permission => '.*',
read_permission => '.*',
write_permission => '.*',
}
# RHEL needs EPEL installed prior to rabbitmq
if $::osfamily == 'RedHat' {
Class['epel']
-> Class['rabbitmq']
Yumrepo['epel']
-> Class['rabbitmq']
Yumrepo['epel']
-> Package['rabbitmq-server']
}
}
|