diff --git a/modules/rhizo_base/files/check_mdns_route b/modules/rhizo_base/files/check_mdns_route new file mode 100644 index 0000000..6ff1e0b --- /dev/null +++ b/modules/rhizo_base/files/check_mdns_route @@ -0,0 +1,10 @@ +#!/bin/sh +/sbin/ip route show 239.192.23.42 | grep rhizomatica > /dev/null + +if [ $? -ne 0 ]; then + /sbin/ip route add 239.192.23.42 dev rhizomatica + if [ $? -ne 0 ]; then + exit 1 + fi +exit 0 +fi diff --git a/modules/rhizo_base/files/systemd/osmo-hlr.override b/modules/rhizo_base/files/systemd/osmo-hlr.override new file mode 100644 index 0000000..5c1acae --- /dev/null +++ b/modules/rhizo_base/files/systemd/osmo-hlr.override @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=/bin/sh -c /etc/tinc/check_mdns_route diff --git a/modules/rhizo_base/manifests/osmocom.pp b/modules/rhizo_base/manifests/osmocom.pp index a4226a9..7f092fc 100644 --- a/modules/rhizo_base/manifests/osmocom.pp +++ b/modules/rhizo_base/manifests/osmocom.pp @@ -27,7 +27,11 @@ class rhizo_base::osmocom { $sgsn_ip_address = hiera('rhizo::sgsn_ip_address') $ggsn_ip_address = hiera('rhizo::ggsn_ip_address') $repo = hiera('rhizo::osmo_repo', 'latest') - $hlr_name = hiera('rhizo::hlr_name', $network_name) + $ipa_name = hiera('rhizo::ipa_name', + sprintf("%s-%s-%s-%s", $mcc, $mnc, $bts[0]['lac'], + regsubst($vpn_ip_address, + '^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$', + '\\3-\\4'))) package { [ 'osmo-stp', 'osmo-mgw', 'osmo-sgsn' ]: ensure => 'installed', @@ -150,6 +154,19 @@ class rhizo_base::osmocom { source => 'puppet:///modules/rhizo_base/systemd/osmo-msc.override' } + systemd::dropin_file { 'hlr-override': + unit => 'osmo-hlr.service', + filename => 'override.conf', + source => 'puppet:///modules/rhizo_base/systemd/osmo-hlr.override' + } + + + file { '/etc/tinc/check_mdns_route': + ensure => present, + source => 'puppet:///modules/rhizo_base/check_mdns_route', + mode => '0750' + } + file { '/lib/systemd/system/osmo-mgw-msc.service': ensure => present, source => 'puppet:///modules/rhizo_base/systemd/osmo-mgw-msc.service', diff --git a/modules/rhizo_base/templates/osmo-bsc-bts.erb b/modules/rhizo_base/templates/osmo-bsc-bts.erb index ebcdfce..b44e9ae 100644 --- a/modules/rhizo_base/templates/osmo-bsc-bts.erb +++ b/modules/rhizo_base/templates/osmo-bsc-bts.erb @@ -88,7 +88,7 @@ phys_chan_config <%= @phys_chan %> hopping enabled 0 timeslot 3 - phys_chan_config TCH/F_TCH/H_PDCH + phys_chan_config <%= @phys_chan %> hopping enabled 0 timeslot 4 phys_chan_config TCH/F_TCH/H_PDCH diff --git a/modules/rhizo_base/templates/osmo-hlr.cfg.erb b/modules/rhizo_base/templates/osmo-hlr.cfg.erb index df3f9af..80f7ec8 100644 --- a/modules/rhizo_base/templates/osmo-hlr.cfg.erb +++ b/modules/rhizo_base/templates/osmo-hlr.cfg.erb @@ -47,7 +47,7 @@ hlr database <%= @hlr_db %> gsup bind ip <%= @vpn_ip_address %> - ipa-name <%= @hlr_name %> + ipa-name HLR-<%= @ipa_name %> ussd route prefix *#100# internal own-msisdn ussd route prefix *#101# internal own-imsi mslookup @@ -57,4 +57,9 @@ mslookup service smpp.sms at <%= @vpn_ip_address %> 2775 client mdns bind 239.192.23.42 4266 +! +! Can't have create on demand and client at +! same time, so we turn off client here. +!! + no client end diff --git a/modules/rhizo_base/templates/osmo-msc.cfg.erb b/modules/rhizo_base/templates/osmo-msc.cfg.erb index a5492e2..8215d47 100644 --- a/modules/rhizo_base/templates/osmo-msc.cfg.erb +++ b/modules/rhizo_base/templates/osmo-msc.cfg.erb @@ -98,6 +98,7 @@ smpp hlr remote-ip <%= @vpn_ip_address %> remote-port 4222 + ipa-name MSC-<%= @ipa_name %> sgs local-port 29118 local-ip 0.0.0.0