mpataki.ha_letsencrypt

ansible-ha-letsencrypt

构建状态

Let's Encrypt 是一个免费服务,为互联网提供用于端到端加密的SSL证书。它可以用于HTTPS流量的证书,也可以用于其他TLS协议。

该服务主要使用有效的主机名,例如 my_house.duckdns.org,并通过Let's Encrypt生成SSL证书。除了获取初始证书外,它还将安装一个定时任务,以确保证书会自动续订。

在续订时,通常需要重新启动像nginx或mosquitto这样的服务,因为这些服务可能正在使用证书加密TCP流量。同时,还提供了可用于自动执行这些前后钩子的变量。

需求

实际上,这应该可以在任何基于Debian的系统上运行,但已在运行Hassbian的树莓派上进行了测试。

角色变量

  • certbot_hostnames
    • 例如 my_home.duckdns.org,grafana.myhome.duckdns.org
    • 这是一个以逗号分隔的主机名列表,用于颁发SSL证书。
  • certbot_pre_hook:
    • 例如 systemctl stop nginx
    • 这是您希望在SSL证书更新之前运行的任何Shell命令。
  • certbot_post_hook:
    • 例如 systemctl restart mosquitto; systemctl start nginx
    • 这是您希望在更新SSL证书后运行的任何Shell命令。
  • certbot_email:
    • 例如 [email protected]
    • 这是当您的证书即将过期时会收到通知的电子邮件(尽管应自动续订)。
  • force_new_cert:
    • 一个布尔值,可以设置为强制生成新的证书。

依赖项

无。

示例剧本

    - hosts: pi
      vars:
        certbot_hostnames: 'my_home.duckdns.org,grafana.myhome.duckdns.org'
        certbot_pre_hook: 'systemctl stop nginx'
        certbot_post_hook: 'systemctl restart mosquitto; systemctl start nginx'
      roles:
         - role: mpataki.ha-letsencrypt

许可证

MIT

关于项目

letsencrypt setup for home assistant

安装
ansible-galaxy install mpataki.ha_letsencrypt
许可证
Unknown
下载
95
拥有者