fix the localnet.json generation

This commit is contained in:
Keith Whyte 2021-02-26 06:43:37 +01:00
parent a2dfc1672e
commit 8864a27db6
2 changed files with 8 additions and 32 deletions

View file

@ -144,14 +144,9 @@ class rhizo_base {
$bsc_geo_lat = hiera('rhizo::bsc_geo_lat') $bsc_geo_lat = hiera('rhizo::bsc_geo_lat')
$bsc_geo_lon = hiera('rhizo::bsc_geo_lon') $bsc_geo_lon = hiera('rhizo::bsc_geo_lon')
$bts1_geo_lat = hiera('rhizo::bts1_geo_lat') $bts_geo = [ 'shift', hiera('rhizo::bts1_geo_lat'), hiera('rhizo::bts1_geo_lon'),
$bts1_geo_lon = hiera('rhizo::bts1_geo_lon') hiera('rhizo::bts2_geo_lat', false), hiera('rhizo::bts2_geo_lon', false),
hiera('rhizo::bts3_geo_lat', false), hiera('rhizo::bts3_geo_lon', false) ]
$bts2_geo_lat = hiera('rhizo::bts2_geo_lat', false)
$bts2_geo_lon = hiera('rhizo::bts2_geo_lon', false)
$bts3_geo_lat = hiera('rhizo::bts3_geo_lat', false)
$bts3_geo_lon = hiera('rhizo::bts3_geo_lon', false)
$link1_ip_address = hiera('rhizo::link1_ip_address', false) $link1_ip_address = hiera('rhizo::link1_ip_address', false)
$link2_ip_address = hiera('rhizo::link2_ip_address', false) $link2_ip_address = hiera('rhizo::link2_ip_address', false)

View file

@ -1,34 +1,15 @@
[ [
<% if @bts1_ip_address -%> <% @bts.each_with_index do |bts, index| %>
{ {
"type": "bts", "type": "bts",
"ip": "<%= @bts1_ip_address %>", "ip": "<%= bts["ip"] %>",
"geo": [ "geo": [
<%= @bts1_geo_lat %>, <%= @bts_geo[2*index+1] %>,
<%= @bts1_geo_lon %> <%= @bts_geo[2*index+2] %>
]
},
<% end -%>
<% if @bts2_ip_address -%>
{
"type": "bts",
"ip": "<%= @bts2_ip_address %>",
"geo": [
<%= @bts2_geo_lat %>,
<%= @bts2_geo_lon %>
]
},
<% end -%>
<% if @bts3_ip_address -%>
{
"type": "bts",
"ip": "<%= @bts3_ip_address %>",
"geo": [
<%= @bts3_geo_lat %>,
<%= @bts3_geo_lon %>
] ]
}, },
<% end -%> <% end -%>
<% if @link1_ip_address -%> <% if @link1_ip_address -%>
{ {
"type": "link", "type": "link",