Sha256: 4adbb04be8582437056b42b6d9c1204e71e7ce7f8bfb23dd6fef0f7fc36e130b
Contents?: true
Size: 681 Bytes
Versions: 8
Compression:
Stored size: 681 Bytes
Contents
# for rubocop, this comment is a matter of policy class Vault::Provision::Sys::Policy < Vault::Provision::Prototype def repo_files Find.find(repo_path).select { |rf| rf.end_with?('.json', '.hcl') } end def provision! repo_files.each do |rf| validate_file! rf policy_name = if rf.end_with? '.json' File.basename(rf, '.json') elsif rf.end_with? '.hcl' File.basename(rf, '.hcl') end next if Vault::Provision::SYSTEM_POLICIES.include? policy_name puts " * #{File.basename(rf, '.json')}" @vault.sys.put_policy(policy_name, File.read(rf)) end end end
Version data entries
8 entries across 8 versions & 1 rubygems