From 98648569aa543c0302a856caeb8bf6b5620b5d89 Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Sat, 9 May 2020 05:53:05 +0200 Subject: [PATCH] Add opkg credentials for BTS --- modules/rhizo_base/files/var/SysmoBTS/opkg.sh | 5 ++++- modules/rhizo_base/manifests/init.pp | 1 + modules/rhizo_base/templates/vars.sh.erb | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/rhizo_base/files/var/SysmoBTS/opkg.sh b/modules/rhizo_base/files/var/SysmoBTS/opkg.sh index c3f8459..333b062 100644 --- a/modules/rhizo_base/files/var/SysmoBTS/opkg.sh +++ b/modules/rhizo_base/files/var/SysmoBTS/opkg.sh @@ -13,7 +13,10 @@ SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/tmp/known-$RANDOM" for bts in "${!BTS[@]}" ; do if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'grep 201705 /etc/opkg/base-feeds.conf >/dev/null; echo $?')" == "0" ] ; then - + grep OPKG_CREDS base-feeds-nightly.conf > /dev/null + if [ "$?" == "0" ]; then + sed -i s/OPKG_CREDS/$OPKG_CREDS/g base-feeds-nightly.conf + fi scp $SSH_OPTS base-feeds-nightly.conf root@${BTS[$bts]}:/etc/opkg/base-feeds.conf ssh $SSH_OPTS root@${BTS[$bts]} "opkg update; opkg install osmo-bts osmo-pcu sysmobts-util ntp" ssh $SSH_OPTS root@${BTS[$bts]} "systemctl enable osmo-pcu; systemctl start osmo-pcu" diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index a07e909..2088fb3 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 + $opkg_creds = hiera('rhizo::bts_opkg_creds') $bts = hiera('rhizo::bts') $bts_pass = hiera('rhizo::bts_pass') $bts_type = hiera('rhizo::bts_type') diff --git a/modules/rhizo_base/templates/vars.sh.erb b/modules/rhizo_base/templates/vars.sh.erb index 98637c2..7a7bf7c 100644 --- a/modules/rhizo_base/templates/vars.sh.erb +++ b/modules/rhizo_base/templates/vars.sh.erb @@ -20,6 +20,7 @@ BTS_MASTER[<%= index %>]=<%= bts["ip"] %> <% end -%> BTSPASS=<%= @bts_pass %> +OPKG_CREDS=<%= @opkg_creds %> LATENCY_HOST=<%= @latency_check_address %> LATENCY_TINC=<%= @latency_check_vpn %>