Acme食谱未按预期工作

时间:2017-05-07 22:50:33

标签: chef chef-recipe lets-encrypt

我正在创建一个为nginx创建自签名证书的cookbook,并希望使用certbot cookbook来覆盖letsencrypt证书的自签名证书:

# Create self signed certificate
acme_selfsigned 'timber.com' do
  crt     '/etc/letsencrypt/live/timber.com/cert.pem'
  chain   '/etc/letsencrypt/live/timber.com/chain.pem'
  key     '/etc/letsencrypt/live/timber.com/privkey.pem'
end

# Create letsencrypt cert
certbot_certonly_webroot 'timber.com' do
  webroot_path '/home_page/'
  email 'lumber@timber.com'
  domains ['timber.com']
  retries           5
  retry_delay       240
  notifies :restart, resources(:service => "nginx")
  agree_tos true
end

nginx自签名网站正确显示,但cerbot不会覆盖现有的自签名证书:

/etc/letsencrypt/live/timber.com/

而是在第二个证书:

/etc/letsencrypt/live/timber.com-0001/

有没有人知道替换/覆盖原始证书的方法?

1 个答案:

答案 0 :(得分:0)

你正在混合两本厨师食谱。极致食谱can handle your use case。它将轻松替换自签名,之后将重新启动nginx。