From be9d9573b8d8f99dd5d347ab41be0cd8d243e9a6 Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Tue, 28 Apr 2020 23:17:38 +0200 Subject: [PATCH] Update the meas-web installation Use new repo and add BTS definitions file --- modules/rhizo_base/manifests/init.pp | 15 +++++++++++---- modules/rhizo_base/templates/bts_defs.js.erb | 8 ++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 modules/rhizo_base/templates/bts_defs.js.erb diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index 8b71c04..a3f3403 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -45,6 +45,7 @@ class rhizo_base { $mnc = hiera('rhizo::mnc', '7') #BTSs configuration + $bts = hiera('rhizo::bts') $bts_type = hiera('rhizo::bts_type') $bts_amps = hiera('rhizo::bts_amps', "on") $bts1_ip_address = hiera('rhizo::bts1_ip_address') @@ -348,16 +349,22 @@ schedule { 'repo': Exec['restart-esme'], ], } - vcsrepo { '/var/meas_web': + vcsrepo { '/var/meas': schedule => 'always', ensure => latest, provider => git, - source => 'https://github.com/whyteks/meas_web.git', + # source => 'https://github.com/whyteks/meas_web.git', + source => 'https://gitlab.tic-ac.org/keith/meas_web.git', revision => 'master', require => [ Package['git'] ], notify => [ Exec['restart-meas'] ], } + file { '/var/meas/www/meas-web/bts_defs.js': + ensure => present, + content => template('rhizo_base/bts_defs.js.erb'), + } + file { '/var/rhizomatica/bin/get_account_balance.sh': ensure => present, content => template('rhizo_base/get_account_balance.sh.erb'), @@ -483,8 +490,8 @@ schedule { 'repo': file { '/var/www/meas': ensure => link, - target => '/var/meas_web/usr/share/fairwaves-meas-web/', - require => [ Vcsrepo['/var/meas_web'] ], + target => '/var/meas/www/meas-web', + require => [ Vcsrepo['/var/meas'] ], } file { '/var/www/html/rai': diff --git a/modules/rhizo_base/templates/bts_defs.js.erb b/modules/rhizo_base/templates/bts_defs.js.erb new file mode 100644 index 0000000..002cf27 --- /dev/null +++ b/modules/rhizo_base/templates/bts_defs.js.erb @@ -0,0 +1,8 @@ +const bts_defs = [ +// Index, Name, ARFCN, BSIC +<% @bts.each_with_index do |bts, index| -%> +<% bts["trx"].each_with_index do |trx, trx_i| -%> + [<%= index %>, <%= trx_i %>, "<%= bts["name"] %>", <%= trx["chan"]%>, <%= bts["bsic"]%>], +<% end -%> +<% end -%> +]