[chef] Get content from cookbook_file


Chronological Thread 
  • From: < >
  • To:
  • Subject: [chef] Get content from cookbook_file
  • Date: Tue, 21 Oct 2014 04:13:16 -0700 (PDT)

Hello,

i copy private and public keys from my cookbook files with:

remote_directory "/home/jenkins/.ssh" do
  files_mode '0600'
  files_owner 'jenkins'
  files_group 'jenkins'
  mode '0700'
  owner 'jenkins'
  source "deploy_keys"
  notifies :run, "execute[fix-pubkey-rights]", :immediately
end

execute "fix-pubkey-rights" do
  cwd "/home/jenkins/.ssh"
  command "chmod 0644 *.pub"
  action :nothing
end

Now i wan't iterate over all private keys and use the content and name with 

jenkins_private_key_credentials "#{filename}" do
    description "#{filename} pivate key for github access"
    private_key "#{content}"
  end

Hoiw can i do this?



Archive powered by MHonArc 2.6.16.

§