Last active
June 12, 2018 04:54
-
-
Save mistymagich/6864772 to your computer and use it in GitHub Desktop.
自己認証局のルート証明書をCentOSのca-bundle.crtにインストールするレシピ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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