Skip to content
Snippets Groups Projects
Commit c8660adc authored by garciadav's avatar garciadav
Browse files

Change yq to snap


Change-Id: I462edbd5c7f0a6deb6c4baab0cb2ac0714aa4698
Signed-off-by: default avatarDavid Garcia <david.garcia@canonical.com>
parent ef349d92
No related branches found
No related tags found
No related merge requests found
...@@ -303,18 +303,16 @@ function check_osm_deployed() { ...@@ -303,18 +303,16 @@ function check_osm_deployed() {
function create_overlay() { function create_overlay() {
sudo snap install jq sudo snap install jq
sudo apt install python3-pip -y sudo snap install yq
python3 -m pip install yq
PATH=$PATH:$HOME/.local/bin # make yq command available
local HOME=/home/$USER local HOME=/home/$USER
local vca_user=$(cat $HOME/.local/share/juju/accounts.yaml | yq --arg CONTROLLER_NAME $CONTROLLER_NAME '.controllers[$CONTROLLER_NAME].user') local vca_user=$(cat $HOME/.local/share/juju/accounts.yaml | yq r - controllers.$CONTROLLER_NAME.user)
local vca_password=$(cat $HOME/.local/share/juju/accounts.yaml | yq --arg CONTROLLER_NAME $CONTROLLER_NAME '.controllers[$CONTROLLER_NAME].password') local vca_password=$(cat $HOME/.local/share/juju/accounts.yaml | yq r - controllers.$CONTROLLER_NAME.password)
local vca_host=$(cat $HOME/.local/share/juju/controllers.yaml | yq --arg CONTROLLER_NAME $CONTROLLER_NAME '.controllers[$CONTROLLER_NAME]["api-endpoints"][0]' --raw-output | cut -d ":" -f 1) local vca_host=$(cat $HOME/.local/share/juju/controllers.yaml | yq r - controllers.$CONTROLLER_NAME.api-endpoints[0] | cut -d ":" -f 1)
local vca_port=$(cat $HOME/.local/share/juju/controllers.yaml | yq --arg CONTROLLER_NAME $CONTROLLER_NAME '.controllers[$CONTROLLER_NAME]["api-endpoints"][0]' --raw-output | cut -d ":" -f 2) local vca_port=$(cat $HOME/.local/share/juju/controllers.yaml | yq r - controllers.$CONTROLLER_NAME.api-endpoints[0] | cut -d ":" -f 2)
local vca_pubkey=\"$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)\" local vca_pubkey=\"$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)\"
local vca_cloud="lxd-cloud" local vca_cloud="lxd-cloud"
# Get the VCA Certificate # Get the VCA Certificate
local vca_cacert=$(cat $HOME/.local/share/juju/controllers.yaml | yq --arg CONTROLLER_NAME $CONTROLLER_NAME '.controllers[$CONTROLLER_NAME]["ca-cert"]' --raw-output | base64 | tr -d \\n) local vca_cacert=$(cat $HOME/.local/share/juju/controllers.yaml | yq r - controllers.$CONTROLLER_NAME.ca-cert | base64 | tr -d \\n)
# Calculate the default route of this machine # Calculate the default route of this machine
local DEFAULT_IF=`ip route list match 0.0.0.0 | awk '{print $5}'` local DEFAULT_IF=`ip route list match 0.0.0.0 | awk '{print $5}'`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment