veracross / consult

Configuration and secrets management for Rails
MIT License
12 stars 0 forks source link

Add configuration to allow skipping missing template files/keys #48

Closed aharpervc closed 1 year ago

aharpervc commented 1 year ago

This PR introduces skip_missing_template: true optional config for templates, which allows configured templates to not exist. This builds in the feature that you'd overwise have to work around with ERB logic in the consult config file itself. Eg, it replaces this:

    <% path = File.join("./config/templates/#{ENV['AWS_REGION']}.json.erb") %>
    <% if File.exist? path %>
    region-config:
      path: config/templates/<%= ENV['AWS_REGION'] %>.json.erb
      dest: config/region.json
    <% else %>
    <% puts "Consult: No #{ENV['AWS_REGION']}.json.erb present, skipping..." %>
    <% end %>