Gabe Black | 9062322 | 2017-01-18 19:52:28 +0000 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | #set -x |
| 3 | NODE=$( bash -c "source ~/service-profile/cord-pod/admin-openrc.sh; nova list --all-tenants 2>&1 | grep -m 1 ceilometer | cut -d ' ' -f 2 | xargs -I{} nova show {} 2>&1 | grep -m 1 hypervisor | tr -s ' ' | cut -d ' ' -f 4") |
| 4 | |
| 5 | INSTANCE_IP=$( bash -c "source ~/service-profile/cord-pod/admin-openrc.sh; nova list --all-tenants 2>&1 | grep -m 1 ceilometer | cut -d ' ' -f 2 | xargs -I{} nova show {} 2>&1 | grep -m 1 management | tr -s ' ' | cut -d ' ' -f 5") |
| 6 | |
| 7 | cat <<EOF > install_monitoring_agent.config |
| 8 | [ssh_connection] |
| 9 | ssh_args = -o "ProxyCommand ssh -q -i ~/service-profile/cord-pod/node_key -o StrictHostKeyChecking=no ubuntu@$NODE nc $INSTANCE_IP 22" |
| 10 | scp_if_ssh = True |
| 11 | pipelining = True |
| 12 | |
| 13 | [defaults] |
| 14 | host_key_checking = False |
| 15 | timeout = 30 |
| 16 | EOF |
| 17 | |
| 18 | ANSIBLE_CONFIG=install_monitoring_agent.config ansible-playbook -vvv -i /etc/maas/ansible/pod-inventory ~/xos_services/PassiveTest/install_monitoring_plugin.yaml -e instance_ip="$INSTANCE_IP" -e instance_host="$NODE" |
| 19 | |