blob: b2dc91c2d8cbca9d42ea191ce0834c6af39c097f [file] [log] [blame]
Gabe Black90623222017-01-18 19:52:28 +00001#! /bin/bash
2#set -x
3NODE=$( 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
5INSTANCE_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
7cat <<EOF > install_monitoring_agent.config
8[ssh_connection]
9ssh_args = -o "ProxyCommand ssh -q -i ~/service-profile/cord-pod/node_key -o StrictHostKeyChecking=no ubuntu@$NODE nc $INSTANCE_IP 22"
10scp_if_ssh = True
11pipelining = True
12
13[defaults]
14host_key_checking = False
15timeout = 30
16EOF
17
18ANSIBLE_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