Improve NITB config template.

Introduces a multiple file template and iterates over the defined
BTS array from the hiera data.

This is really a backport of the as yet uncommitted work on creating osmo-*
config files for the split stack. Making this change here for the nitb will
allow for removal for some deprecated variables in hiera.

At this time, I don't think there is any site that is actually using
a puppet-generated nitb config file, but if there were, the results of this code
should be more less funcionally equivalent, providing the BTS definition is correct.
This commit is contained in:
Keith Whyte 2020-08-24 15:16:33 +02:00
parent 31d8550a75
commit 1cedf0c0fc
4 changed files with 219 additions and 1 deletions

View file

@ -36,6 +36,7 @@ class rhizo_base::openbsc {
$sgsn_ip_address = hiera('rhizo::sgsn_ip_address')
$ggsn_ip_address = hiera('rhizo::ggsn_ip_address')
$repo = hiera('rhizo::osmo_repo', 'latest')
$bts = hiera('rhizo::bts')
$nitb_version = $repo ? {
'latest' => '1.3.2',
@ -112,7 +113,10 @@ class rhizo_base::openbsc {
unless hiera('rhizo::local_bsc_cfg') == "1" {
file { '/etc/osmocom/osmo-nitb.cfg':
content => template('rhizo_base/osmo-nitb.cfg.erb'),
content => template(
'rhizo_base/osmo-nitb-head.erb',
'rhizo_base/osmo-nitb-bts.erb',
'rhizo_base/osmo-nitb-tail.erb'),
require => Package['osmocom-nitb'],
notify => Exec['notify-nitb'],
}