Thanks for sharing that, Bruce. It sounds useful. I've only run Cfengine on hosts with EC2 tools installed (my code is at http://www.verticalsysadmin.com/cfengine/casit/)
I could probably improve that based on your code. cheers, -at On Wed, Aug 17, 2011 at 9:55 PM, Robert Carleton <r...@rbcarleton.com> wrote: > I'd like to compare notes and find out who else is doing this. I'm trying to > expose some EC2 data to Cfengine even on hosts that may not have EC2 tools > installed. This is a module that I've come up with so far: > > #!/bin/bash > > meta_data="ami-id instance-id public-ipv4 security-groups > placement/availability-zone" > > for i in `echo ${meta_data}` > do > prefix=`echo ${i} | sed -e 's/\-/_/g' -e 's/\//_/g'` > r=`/usr/bin/curl -s > http://instance-data.ec2.internal/latest/meta-data/${i}` > if [ $? -eq "0" ] > then > suffix=`echo ${r} | sed -e 's/\-/_/g' -e 's/\//_/g' -e 's/\./_/g'` > echo +ec2_${prefix}_${suffix} > else > echo +ec2_${prefix}_detect_failed > fi > done > > I thought I'd put it up for comment. > > Best, > > --Bruce > > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine > _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine