lib/garcon/chef/secret_bag.rb
# Loads the encrypted data bag item and returns credentials for the
# environment or for a default key.
#
# @param [String] environment
#   The environment
#
# @param [String] source
#   The deployment source to load configuration for
#
# @return [Chef::DataBagItem]
#   The data bag item
#
Loads the encrypted data bag item and returns credentials for the
environment or for a default key.
Loads the encrypted data bag item and returns credentials for the environment or for a default key .
def data_bag_config_for(environment, source)
      data_bag_item = encrypted_data_bag_for(environment, DATA_BAG)
      if data_bag_item.has_key?(source)
        data_bag_item[source]
      elsif DATA_BAG == source
        data_bag_item
      else
        {}
      end
    end
def data_bag_config_for ( environment , source ) data_bag_item = encrypted_data_bag_for ( environment , DATA_BAG ) if data_bag_item . has_key? ( source ) data_bag_item [ source ] elsif DATA_BAG == source data_bag_item else { } end end
Loads the encrypted data bag item and returns credentials for the
environment or for a default key.
Loads the encrypted data bag item and returns credentials for the environment or for a default key .
The data bag item
The data bag item
Chef::DataBagItem
environment
<not_specific>
source
<not_specific>
<not_specific>
source The deployment source to load configuration for
source The deployment source to load configuration for