Sha256: 5493fb770340a34f23be58b789a3535864cd9eca7e20f9201e07176ef77de33e
Contents?: true
Size: 1.33 KB
Versions: 18
Compression:
Stored size: 1.33 KB
Contents
# # Cookbook Name:: mu-jenkins # Recipe:: node-ssh-config # # Copyright 2015, eGlobalTech, Inc # # All rights reserved - Do Not Redistribute # include_recipe 'mu-jenkins::public_key' include_recipe 'mu-tools::disable-requiretty' include_recipe 'chef-vault' ssh_vault = chef_vault_item(node['jenkins_ssh_vault']['vault'], node['jenkins_ssh_vault']['item']) case node['platform'] when platform_family?('rhel') if platform?("centos") ssh_user = "root" if node['platform_version'].to_i == 6 ssh_user = "centos" if node['platform_version'].to_i == 7 else ssh_user = "ec2-user" end directory "#{node['jenkins']['master']['home']}/.ssh" do owner "jenkins" group "jenkins" mode 0700 end ssh_key_path = "#{node['jenkins']['master']['home']}/.ssh/jenkins_ssh" template "#{node['jenkins']['master']['home']}/.ssh/config" do source "ssh_config.erb" owner "jenkins" group "jenkins" mode 0600 variables( :ssh_user => ssh_user, :ssh_key_path => ssh_key_path, :ssh_urls => node['jenkins_ssh_urls'] ) end file ssh_key_path do owner "jenkins" group "jenkins" mode 0400 content ssh_vault['private_key'].strip sensitive true end else Chef::Log.info("Unsupported platform #{node['platform']}") end
Version data entries
18 entries across 18 versions & 1 rubygems