salt icon indicating copy to clipboard operation
salt copied to clipboard

pillar.file_exists -- Feature-Request to check for existence of pillar files from within pillar

Open rickh563 opened this issue 11 years ago • 5 comments

Request that Salt create a new function, or enhance an existing function, that would operate similar to file.file_exists. The new function would differ from file.file_exists only in that one could use paths that are relative to the Salt environment rather than having to use absolute paths based on the local file system.

rickh563 avatar Sep 22 '15 15:09 rickh563

ZD-412

rickh563 avatar Sep 22 '15 15:09 rickh563

The main difficulty here is that we'd need to inject the requested environment into the opts dictionary since it isn't there currently, if it were to be used in templating for things like pillar files. At present, I see no evidence of it being there. Once that hurdle is overcome, it would be relatively straightforward to create an execution module function to do as requested.

cachedout avatar Sep 22 '15 22:09 cachedout

Committed for Boron, Mike thought this would be around 1-2 days of work

meggiebot avatar Sep 23 '15 19:09 meggiebot

FYI, based on the zendesk issue, I am writing this for pillar specifically. It will be a master-only function called pillar.file_exists that can be called from within pillar generation. It will take an optional saltenv arg, and will search all environments if that is left off.

basepi avatar Jan 21 '16 18:01 basepi

Added in #30524

basepi avatar Jan 21 '16 21:01 basepi