kazauwa.headscale
Headscale 的 Ansible 角色
一个用于在 Linux 上安装和管理 Headscale 的角色。
需求
- Ansible >= 7
安装
ansible-galaxy install kazauwa.headscale
角色变量
headscale_version
- 默认值:
0.22.3
- 描述: 要安装的 Headscale 版本。可用版本列表可以在 官方发布页面 找到。默认安装最新版本。
- 默认值:
headscale_arch
- 默认值:
amd64
- 描述: headscale 二进制文件的目标架构。
- 默认值:
headscale_os
- 默认值:
linux
- 描述: headscale 二进制文件的目标操作系统。
- 默认值:
headscale_user_name
- 默认值:
headscale
- 描述: 运行 Headscale 二进制文件的服务用户名称。
- 默认值:
headscale_user_group
- 默认值:
headscale
- 描述: 运行 Headscale 二进制文件的服务用户组。
- 默认值:
headscale_user_uid
- 默认值:
800
- 描述: 运行 Headscale 二进制文件的服务用户的 uid。
- 默认值:
headscale_user_gid
- 默认值:
800
- 描述: 运行 Headscale 二进制文件的服务用户的 gid。
- 默认值:
headscale_binary_path
- 默认值:
/usr/local/bin/headscale
- 描述: 安装 headscale 二进制文件的路径。
- 默认值:
headscale_config_dir
- 默认值:
/etc/headscale
- 描述: headscale 配置文件的路径。
- 默认值:
headscale_var_data_dir
- 默认值:
/var/lib/headscale
- 描述: headscale 数据的路径。
- 默认值:
headscale_pid_dir
- 默认值:
/var/run/headscale
- 描述: headscale socket 的路径。
- 默认值:
headscale_config
- 默认值:
{}
- 描述: yaml 格式的 headscale 配置,建议使用 默认配置 作为起点。
- 默认值:
headscale_config_template
- 默认值:
""
- 描述: Jinja2 格式的 headscale 配置模板路径。如果存在,将覆盖
headscale_config
。
- 默认值:
headscale_acl
- 默认值:
{}
- 描述: yaml 格式的 ACL 策略。请确保您已阅读 文档 以了解如何使用此功能。
- 默认值:
headscale_users
- 默认值:
[]
- 描述: 要创建的用户列表,例如用于 tagOwners。
- 默认值:
headscale_enable_routes
- 默认值:
[]
- 描述: 要启用的带有广告路由的节点列表。接受 headscale 节点的整数 ID、以逗号分隔的路由列表和可选的执行时注释。在未设置 autoApprovers 时使用。
- 示例:
{'id': 14, 'routes': '10.0.0.0/24,10.2.3.4/32', 'comment': '通往生产环境的网关'}
- 默认值:
headscale_exit_nodes
- 默认值:
[]
- 描述: 充当出口节点的节点列表。接受 headscale 节点的整数 ID 和可选的执行时注释。在未设置 autoApprovers 时使用。
- 示例:
{'id': 14, 'comment': 'eu-fra-01'}
- 默认值:
依赖
无。
示例剧本
- hosts: all
roles:
- kazauwa.headscale
vars:
headscale_version: '0.22.3'
许可
MIT