libraries/passwords.rb
def secret(bag_name, index)
    case node['slurm']['databag_type']
    when 'encrypted'
      encrypted_secret(bag_name, index)
    when 'standard'
      standard_secret(bag_name, index)
    when 'vault' # chef-vault, by convention use "vault_<bag_name>" as bag_name
      vault_secret('vault_' + bag_name, index)
    else
      ::Chef::Log.error("Unsupported value #{node['slurm']['databag_type']} for node['slurm']['databag_type']")
    end
  end
# Library routine that returns an encrypted data bag value
# for a supplied string. The key used in decrypting the
# encrypted value should be located at
# node['slurm']['secret']['key_path'].
#
Library routine that returns an encrypted data bag value
for a supplied string.
Library routine that returns an encrypted data bag value for a supplied string .
def secret(bag_name, index)
    case node['slurm']['databag_type']
    when 'encrypted'
      encrypted_secret(bag_name, index)
    when 'standard'
      standard_secret(bag_name, index)
    when 'vault' 
      vault_secret('vault_' + bag_name, index)
    else
      ::Chef::Log.error("Unsupported value #{node['slurm']['databag_type']} for node['slurm']['databag_type']")
    end
  end
def secret ( bag_name , index ) case node [ 'slurm' ] [ 'databag_type' ] when 'encrypted' encrypted_secret ( bag_name , index ) when 'standard' standard_secret ( bag_name , index ) when 'vault' vault_secret ( 'vault_' + bag_name , index ) else :: Chef :: Log . error ( "Unsupported value #{node['slurm']['databag_type']} for node['slurm']['databag_type']" ) end end
Library routine that returns an encrypted data bag value
for a supplied string.
Library routine that returns an encrypted data bag value for a supplied string .
# chef-vault, by convention use "vault_<bag_name>" as bag_name
bag_name
index