Sha256: fa875864aa09f819ee370312754e83d1e30bfd4ee453a912e8e40f8c96fb3651

Contents?: true

Size: 766 Bytes

Versions: 18

Compression:

Stored size: 766 Bytes

Contents

#
# Cookbook Name:: mu-jenkins
# Recipe:: default
#
# Copyright 2015, eGlobalTech, Inc
#
# All rights reserved - Do Not Redistribute
#

case node['platform']
  when platform_family?('rhel')
    include_recipe 'chef-vault'

    ssh_vault = chef_vault_item(node['jenkins_ssh_vault']['vault'], node['jenkins_ssh_vault']['item'])

    ssh_authorized_keys = "/root/.ssh/authorized_keys" if node['platform_version'].to_i == 6
    ssh_authorized_keys = "/home/centos/.ssh/authorized_keys" if node['platform_version'].to_i == 7

    execute "echo '#{ssh_vault['public_key'].strip}' >> #{ssh_authorized_keys}" do
      not_if "grep '^#{ssh_vault['public_key'].strip}$' #{ssh_authorized_keys}"
    end
  else
    Chef::Log.info("Unsupported platform #{node['platform']}")
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
cloud-mu-2.0.4 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.1.0beta cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.3 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.2 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.1 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.beta3 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.beta2 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.beta1 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha9 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha8 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha7 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha6 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha5 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha4 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha3 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha2 cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-2.0.0.pre.alpha cookbooks/mu-jenkins/recipes/public_key.rb
cloud-mu-1.9.0.pre.beta cookbooks/mu-jenkins/recipes/public_key.rb