标签云

微信群

扫码加入我们

WeChat QR Code

I'm writing a playbook to validate our Cloud Formation stacks (port 80 open, httpd.conf has correct settings, instance type is correct, etc).The one thing that is tripping me up is how to validate EC2 tags.key=Name, value=testec2I've tried the below and changed the when condition multiple different ways. - name: Check Name Tagaction: debug msg="Name Tag Exists."when: "ec2_tag_Name"[Examples tried]when: "tag_Name_testec2"when: " ec2_tag_Name_testec2"when: "ec2_tag_Name"I've actually tried quite a few more varieties but those are the ones I can easily remember off the top of my head.when i run "ec2.py --list"it outputs multiple formats of the tag"ec2_tag_Name": "testec2","tag_Name_testec2": [Any suggestions would be greatly appreciated.


Your question is not clear. Are you trying to check if an instance with tag:Name as testec2 is in the inventory?

2019年04月22日50分58秒

after building a stack, i'm writing a playbook to validate. For the tags, i'm validating that certain keys exist.The value is less important but If I can can validate both key and value, that would be most awesome.

2019年04月22日50分58秒

Thank you Raul for the suggestion.I will give the cache_max_age a try and report back.

2019年04月22日50分58秒