l3d.acmetool
Acmetool LE 客户端
安装和配置 acmetool
LE 客户端。
我们建议将此角色与 do1jlr.nginx ansible 角色一起使用。但此角色也有独立版本。
do1jlr.nginx
角色会安装一个钩子来启用 Nginx https 网站,并运行 acmetool want $domain
命令。或者,你可以将需要的域名添加到 acme_domain_want_list: []
中。但确保你的 acmetool 能够请求这些域名,可能需要配置 response-file.yml.j2
。
变量
acme_notification_email:
(默认:[email protected]
): LE 账户邮箱。默认需要更改!acme_reload_services:
(默认:[]
): 需要在证书更改时重新加载的服务 (在 files/reload 文件中有一些预定义的服务)acme_restart_services:
(默认:[]
): 需要在证书更改时重启的服务acme_domain_want_list:
(默认:[]
): 你希望启用的域名列表。例如:
acme_domain_want_list:
- name: 'www.example.com'
acme_domain_unwant_list:
(默认:[]
): 禁用已启用的域名。语法与acme_domain_want_list
相同。submodules_versioncheck:
(默认:false
): 启用基本版本检查。 (建议使用true
)
文件
- 我们使用 first_found_lookup 查找
response-file.yml.j2
,配置如下:
files:
- "response-file.{{ inventory_hostname }}.yml.j2"
- 'response-file.yml.j2'
paths:
- 'templates/acmetool'
- "templates/{{ inventory_hostname }}"
- 'files/acmetool'
- "files/{{ inventory_hostname }}"
- 'templates'
此文件配置 acmetool 的行为,例如证书类型、挑战方法、acme 通知邮箱等。通过提供你自己的 response-file.yml.j2
来更改值。
我们使用 first_found_lookup 查找
reload
和restart
钩子,配置在vars/main.yml
中定义。我们根据
acme_reload_services:
和acme_restart_services:
变量部署acme-reload
和acme-restart
配置。
参考
注意事项
- 如果你使用的是 debian buster,可能会对更高版本的 acmetool 感兴趣。可以查看 do1jlr.acmetool_fix 角色,它将在基于 debian 的系统上安装特定版本的 acmetool。
- 要手动将域名添加到 acmetool,运行
acmetool want example.com
。 - 要手动从 acmetool 中删除域名,运行
acmetool unwant example.com
。
Install acmetool, an easy-to-use command line tool for automatically acquiring certificates from ACME servers (eg. Let's Encrypt)
ansible-galaxy install l3d.acmetool