Here's my idea of how to solve this:
1. New EC2 instance is created
2. Host is renamed to "`hostname-s`-web" or "`hostname-s`-app" via a
script in user-data (EC2 feature)
3. AutomateIT runs and matches /^.*-web/ or /^.*-app/ in the tags.yml,
assigning the correct role
I see that I can use ERB statements within the tags.yml, but even a
simple test failed:
webserver:
<%= puts " - localhost" %>
Upon running pp tags.sort, webserver was not in the list.
Any ideas?
Thanks
Try:
<% hostname=`hostname`.chomp %>
webserver:
<% if hostname =~ /^.*-web$/ %>
- <%= hostname %>
<% end %>
Best Regards,
Claus