andreasscherbaum / gpdb-ansible

Ansible scripts for Greenplum Database
Apache License 2.0
8 stars 7 forks source link

Add stub/support for detecting runtime [AWS, GCP, Azure, etc] #2

Open kdunn-pivotal opened 7 years ago

kdunn-pivotal commented 7 years ago

Big fan of what you've done here. There are certainly similar indicators of AWS/Azure runtimes as well.

andreasscherbaum commented 7 years ago

If you can provide indicators, or give me access to existing boxes, I can figure that out. Here it is mainly required for not creating ssh keys later on - I'm sure the situation on other "Cloud" boxes is similar.

kdunn-pivotal commented 7 years ago

Azure should have a file like this : /etc/sudoers.d/waagent Looks like you can do AWS like this :

if [ -f /sys/hypervisor/uuid ] && [ `head -c 3 /sys/hypervisor/uuid` == ec2 ] ; then
    ...