Skip to content

Instantly share code, notes, and snippets.

@mistymagich
Last active June 12, 2018 04:54
Show Gist options
  • Save mistymagich/6864772 to your computer and use it in GitHub Desktop.
Save mistymagich/6864772 to your computer and use it in GitHub Desktop.
自己認証局のルート証明書をCentOSのca-bundle.crtにインストールするレシピ
#
# Cookbook Name:: install-private-CA-certificate
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
# 自己認証局のルート証明書
my_ca = '/etc/pki/tls/certs/myCA.pem'
# CentOSのca-bundle.crt
bundle_ca = '/etc/pki/tls/certs/ca-bundle.crt'
# ファイルをアップロード
cookbook_file my_ca do
owner "root"
group "root"
mode "0755"
end
# ca-bundle.crtにがなければ、myCAがなければ追加する
bash "install self certificate" do
code "cat #{my_ca} >> #{bundle_ca} "
only_if "openssl verify -CAfile #{bundle_ca} #{my_ca} | grep error"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment