swcc.certbot
Certbot Ansible 角色
从 GitHub 源代码安装 certbot。为目标 ansible_host
域从 Let's Encrypt CA 获取 SSL 证书。
示例剧本
基本示例剧本:
- hosts: webservers
roles:
- role: swcc.certbot
certbot_agree_tos: "--agree-tos"
certbot_admin_email: "[email protected]"
certbot_www_dir: "/var/www" # 用于通过 http 文件验证来验证域名。确保在您的 web 服务器上提供 `/.well-known` URI,并使用指定 `www_dir` 中的文件。
可选参数
变量 | 类型 | 描述 |
---|---|---|
certbot_auto_renew |
boolean |
是否通过 cron 设置自动续订您的证书 |
certbot_deploy_hook |
string |
成功续订证书后执行的命令。例如:/etc/init.d/nginx reload 。 |
certbot_host |
string |
用于申请证书的自定义域名(如果未提供,则默认为 ansible_host ) |
certbot_extra_hosts |
array |
额外域名的列表,证书将对其有效(将提供多域名证书) |
certbot_cert_name |
string |
由 certbot 签发的证书文件名。这将确保您的证书在服务器上的路径为 /etc/letsencrypt/live/{{ certbot_cert_name }}/fullchain.pem 。 |
certbot_challenge_method |
string |
可选值:webroot 或 nginx 。certbot 进行挑战验证时使用的方法(如果您已经有一个 web 服务器,则使用 webroot,如果没有则使用 nginx)。 |
简化 Ansible 使用的 Makefile
我写了一个小 Makefile,来简化您将来的 ansible 操作。请随时 查看它。
从 GitHub 发布版本下载 *.deb
包,安装它并使用 ansible-make help
开始使用。
许可证
GPLv3