Compare commits
3 Commits
7a1a5c03e3
...
58854da648
| Author | SHA1 | Date | |
|---|---|---|---|
|
58854da648
|
|||
|
137d90ed8a
|
|||
|
8c60279fe1
|
@@ -3,6 +3,9 @@
|
||||
"normal": {
|
||||
"knife_zero": {
|
||||
"host": "10.147.20.166"
|
||||
},
|
||||
"kosmos-ejabberd": {
|
||||
"erlang_node": "ejabberd@draco.kosmos.org"
|
||||
}
|
||||
},
|
||||
"automatic": {
|
||||
@@ -59,4 +62,4 @@
|
||||
"recipe[kosmos-base]",
|
||||
"role[ejabberd]"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
"normal": {
|
||||
"knife_zero": {
|
||||
"host": "10.147.20.44"
|
||||
},
|
||||
"kosmos-ejabberd": {
|
||||
"erlang_node": "ejabberd@centaurus.kosmos.org"
|
||||
}
|
||||
},
|
||||
"automatic": {
|
||||
@@ -12,11 +15,16 @@
|
||||
"hostname": "ejabberd-2",
|
||||
"ipaddress": "192.168.122.5",
|
||||
"roles": [
|
||||
|
||||
"ejabberd",
|
||||
"postgresql_client"
|
||||
],
|
||||
"recipes": [
|
||||
"kosmos-base",
|
||||
"kosmos-base::default",
|
||||
"kosmos-ejabberd",
|
||||
"kosmos-ejabberd::default",
|
||||
"kosmos-ejabberd::letsencrypt",
|
||||
"kosmos-ejabberd::backup",
|
||||
"apt::default",
|
||||
"timezone_iii::default",
|
||||
"timezone_iii::debian",
|
||||
@@ -30,7 +38,11 @@
|
||||
"postfix::_common",
|
||||
"postfix::_attributes",
|
||||
"postfix::sasl_auth",
|
||||
"hostname::default"
|
||||
"hostname::default",
|
||||
"tor-full::default",
|
||||
"kosmos-base::letsencrypt",
|
||||
"backup::default",
|
||||
"logrotate::default"
|
||||
],
|
||||
"platform": "ubuntu",
|
||||
"platform_version": "20.04",
|
||||
@@ -47,6 +59,7 @@
|
||||
}
|
||||
},
|
||||
"run_list": [
|
||||
"recipe[kosmos-base]"
|
||||
"recipe[kosmos-base]",
|
||||
"role[ejabberd]"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,28 @@ file "/opt/ejabberd/.erlang.cookie" do
|
||||
content ejabberd_credentials['erlang_cookie']
|
||||
end
|
||||
|
||||
file "/opt/ejabberd/.hosts.erlang" do
|
||||
mode "0644"
|
||||
owner "ejabberd"
|
||||
group "ejabberd"
|
||||
content <<-EOF
|
||||
"andromeda.kosmos.org".
|
||||
"centaurus.kosmos.org".
|
||||
"draco.kosmos.org".
|
||||
EOF
|
||||
end
|
||||
|
||||
ruby_block "configure ERLANG_NODE" do
|
||||
block do
|
||||
file = Chef::Util::FileEdit.new("/opt/ejabberd/conf/ejabberdctl.cfg")
|
||||
file.search_file_replace_line(
|
||||
%r{#ERLANG_NODE=ejabberd@localhost},
|
||||
"ERLAND_NODE=#{node['kosmos-ejabberd']['erlang_node']}"
|
||||
)
|
||||
file.write_file
|
||||
end
|
||||
end
|
||||
|
||||
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
|
||||
|
||||
hosts = [
|
||||
@@ -203,6 +225,18 @@ unless node.chef_environment == "development"
|
||||
command :allow
|
||||
end
|
||||
|
||||
firewall_rule 'ejabberd_cluster' do
|
||||
port [4369]
|
||||
protocol :tcp
|
||||
command :allow
|
||||
end
|
||||
|
||||
firewall_rule 'erlang_cluster' do
|
||||
port [4200..4210]
|
||||
protocol :tcp
|
||||
command :allow
|
||||
end
|
||||
|
||||
firewall_rule 'ejabberd_stun_turn' do
|
||||
port 3478
|
||||
protocol :tcp
|
||||
|
||||
Reference in New Issue
Block a user