amazon ec2 - Salt states using tags from salt-cloud in AWS -


i have salt states applied specific minions using minion id. moving cloud provider, , need apply states based on tags salt-cloud can set.

ie. have instance runnning in aws (not provision salt-stack), can saltify salt-cloud , saltify module, , can recognize minion:

root@instance1:~# salt instance1 test.ping instance1:     true   root@instance:~# salt-cloud -f get_tags my-ec2-eu-west-private-ips resource_id=instance1_awsid my-ips:     ----------     ec2:         |_           ----------           key:               tagname1           resourceid:               instance1_awsid           resourcetype:               instance           value:               value1         |_           ----------           key:               tagname1           resourceid:               instance1_awsid           resourcetype:               instance           value:               value2 

i wish apply states based on values:

ie: instead of clasic:

salt instance1 state.highstate 

or

salt instance1 state.sls configure.service 

i wish like:

salt tagname1=value1 state.highstate 

or

salt tagname1=value1 state.sls configure.service 

i answer myself , maybe save time others.

looks cannot use tags provide states, however, can use of modules salt-contrib, add tags grain items.

https://github.com/saltstack/salt-contrib/tree/master/grains


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -