Chef file exist, then create tag


I'm finding that tags are added upon windows reboots within chef, but I need the tags to be created as a test to show the chef provisioning was successful without having to log into the machine. My solution is to create a flag on the filesystem and then evaluate if the file exists, then to tag.

I can't file a solution via google on how to do this but my current recipe ends with tag('base_success'). How can I check for a file before adding this tag?



When you refer to tags, are you doing something with AWS tags by chance?

I created a chef cookbook/script that triggers at the end of a Chef Habitat run that would create an EC2 tag stating that the Chef run had completed (i.e. fully provisioned), thus could be queried upon.

-- Michael