split msca data volume into role
[awsible] / roles / common / templates / awsible.sh.j2
1 # configure environment with AWS info
2 {% raw %}
3 export INSTANCE_ID=`curl -sf http://169.254.169.254/latest/meta-data/instance-id`
4 if ! export PUBLIC_HOSTNAME=`curl -sf http://169.254.169.254/latest/meta-data/public-hostname`
5 then
6 export PUBLIC_HOSTNAME=''
7 fi
8 if ! export PUBLIC_IP=`curl -sf http://169.254.169.254/latest/meta-data/public-ipv4`
9 then
10 export PUBLIC_IP=''
11 fi
12 export PRIVATE_IP=`curl -sf http://169.254.169.254/latest/meta-data/local-ipv4`
13 export EC2_AZ=`curl -sf http://169.254.169.254/latest/meta-data/placement/availability-zone/`
14 TMP="${#EC2_AZ}"
15 export EC2_REGION="${EC2_AZ:0:$TMP-1}"
16 unset TMP
17 {% endraw %}
18 # hard-code here for systems without userdata
19 export CLOUD_ACCOUNT={{ ACCT_NAME }}
20 export CLOUD_MODULE={{ my_tags['tags']['module']|default('(no module)') }}
21 export CLOUD_STACK={{ my_tags['tags']['stack']|default() }}
22 export CLOUD_PHASE={{ my_tags['tags']['phase']|default('None') }}
23 export CLOUD_AUTO_SCALE_GROUP={{ my_tags['tags']['aws:autoscaling:groupName']|default() }}
24 # export CLOUD_LAUNCH_CONFIG=module-stack-country-phase-version