Arif Ali
d84ce463b1
* Add functions.sh for common tasks * Update various scripts to use functions.sh * Update mongo status to disable all ssh key checks * Add a few extra scripts
14 lines
494 B
Bash
Executable File
14 lines
494 B
Bash
Executable File
#!/bin/bash
|
|
|
|
machine=${1:-0}
|
|
model=${2:-foundation-maas}
|
|
|
|
#host=$(juju show-controller ${model} --format json | jq -rc '."'${model}'".details."api-endpoints"['$machine']' | awk -F: '{print $1}')
|
|
host=$(cat ~/.local/share/juju/controllers.yaml | yq '.controllers."'${model}'"."api-endpoints"['$machine']' | awk -F: '{print $1}')
|
|
|
|
cmds="sudo systemctl restart jujud-machine-\*"
|
|
|
|
ssh_key=$HOME/.local/share/juju/ssh/juju_id_rsa
|
|
|
|
ssh -o IdentityAgent=none -l ubuntu -i ${ssh_key} ${host} "${cmds}"
|