【发布时间】:2017-03-14 18:56:20
【问题描述】:
我正在编写一个厨师代码,该代码使用 pfx 文件将证书导入个人存储,并在 IIS 中添加 https 绑定并添加 ssl 证书。我的代码成功了,代码如下所示。
但是我想在运行这些步骤之前进行条件检查,即如果 ssl 证书已经在 IIS 上的 https 绑定上可用,我不想运行以下任何脚本。
您能帮我看看“IF”语句的第一行如何查看 SSL 是否已安装吗?
# Import certificates to local machine personal store
windows_certificate 'cert.pfx' do
pfx_password '@password'
end
#Setup a HTTPS port on IIS
iis_site 'Default Web Site' do
action :config
bindings 'http/*:80:,https/*:443:'
end
#Add the certificate to the IIS
windows_certificate_binding 'ssl certificate name' do
address '0.0.0.0'
end
【问题讨论】:
标签: ruby ssl iis chef-infra