From cab4fc9f8b11a2ba06d0b02f9a1883512b3eae11 Mon Sep 17 00:00:00 2001 From: dave onion Date: Fri, 28 Aug 2015 17:06:17 -0500 Subject: [PATCH] adding localnet.json.erb and in init.pp --- modules/rhizo_base/manifests/init.pp | 5 + .../rhizo_base/templates/localnet.json.erb | 110 ++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 modules/rhizo_base/templates/localnet.json.erb diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index 796bbdc..bf6db6b 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -181,6 +181,11 @@ class rhizo_base { require => Vcsrepo['/var/rhizomatica'], } + file { '/var/www/html/rai/js/localnet.json': + ensure => present, + content => template('rhizo_base/localnet.json.erb'), + } + exec { 'install_rccn': command => '/usr/bin/python /var/rhizomatica/rccn/install.py', require => [ File['/var/rhizomatica/rccn/config_values.py'], diff --git a/modules/rhizo_base/templates/localnet.json.erb b/modules/rhizo_base/templates/localnet.json.erb new file mode 100644 index 0000000..9aa8f2c --- /dev/null +++ b/modules/rhizo_base/templates/localnet.json.erb @@ -0,0 +1,110 @@ +[ + { + "type": "bsc", + "ip": "<%= @vpn_ip_address %>", + "geo": [ + 17.145365, + -96.229289 + ] + }, + <% if @bts1_ip_address -%> + { + "type": "bts", + "ip": "<%= @bts1_ip_address %>", + "geo": [ + "17.168711", + "-96.260853" + ] + }, + <% end -%> + <% if @bts2_ip_address -%> + { + "type": "bts", + "ip": "<%= @bts2_ip_address %>", + "geo": [ + 17.16915284960935, + -96.26445739621659 + ] + }, + <% end -%> + <% if @bts3_ip_address -%> + { + "type": "bts", + "ip": "<%= @bts3_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link2_ip_address -%> + { + "type": "link", + "ip": "<%= @link2_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link3_ip_address -%> + { + "type": "link", + "ip": "<%= @link3_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link4_ip_address -%> + { + "type": "link", + "ip": "<%= @link4_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link5_ip_address -%> + { + "type": "link", + "ip": "<%= @link5_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link6_ip_address -%> + { + "type": "link", + "ip": "<%= @link6_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link7_ip_address -%> + { + "type": "link", + "ip": "<%= @link7_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + }, + <% end -%> + <% if @link1_ip_address -%> + { + "type": "link", + "ip": "<%= @link1_ip_address %>", + "geo": [ + 17.161211, + -96.209068 + ] + } + <% end -%> +] \ No newline at end of file