respawner.netbox

CI
Ansible Galaxy

Ansible角色:NetBox

这是一个在Debian/Ubuntu上安装的Ansible角色。

这个角色安装了NetBox所需的所有依赖,包括PostgreSQL数据库。因此,可以用来在同一台机器上设置NetBox。

如果您已经有自己的后端和前端处理方式,可以禁用相关设置。

依赖关系

无。

角色变量

可用的变量如下,带有默认值:

PostgreSQL数据库的设置:

netbox_database: netbox
netbox_database_user: netbox
netbox_database_password: netbox
netbox_database_host: localhost # 这将强制设置PostgreSQL

获取NetBox及其版本的设置:

netbox_version: latest
netbox_git_url: https://github.com/netbox-community/netbox.git

默认情况下,它总是获取最新的稳定版本。可以通过使用特定版本来强制执行,例如 v3.5.1

安装NetBox的位置:

netbox_install_directory: /opt/netbox

超级用户的用户名、密码和电子邮件:

netbox_superuser_username: admin
netbox_superuser_password: admin
netbox_superuser_email: [email protected]

LDAP可以作为身份验证机制使用。必须启用,并且要在以下变量中提供整个LDAP配置(请参见NetBox 文档):

netbox_setup_ldap_auth: false
netbox_ldap_config: ""

可以使用 local_requirements.txt 安装其他Python包,这对于安装NAPALM或插件等包很有用:

netbox_local_requirements:
  - napalm

NetBox的配置必须以 key: value 对的形式给出,如下所示,请注意,密钥不需要提供,因为它会自动生成:

netbox_config:
  ALLOWED_HOSTS:
    - localhost
    - 127.0.0.1
  TIME_ZONE: "Europe/Paris"

清理命令使用系统d定时器,每天UTC时间上午4:30运行。您可以使用 on_unit_active_sec: 12h 代替 on_calendar 每12小时运行一次清理命令(例如)。

netbox_systemd_timers:
  netbox-housekeeping:
    enabled: true
    command: "{{ netbox_virtualenv_path }}/bin/python {{ netbox_install_directory }}/netbox/manage.py housekeeping"
    on_calendar: "*-*-* 4:30:00 UTC"

后端Web服务器和systemd的配置:

netbox_setup_systemd: false
netbox_gunicorn_address: 127.0.0.1
netbox_gunicorn_port: 8001
netbox_gunicorn_workers_number: 5

是否配置前端Web服务器:

netbox_setup_web_frontend: false

前端Web服务器的SSL/TLS配置:

netbox_web_tls: false
netbox_web_tls_port: 443
# netbox_web_tls_crt: /etc/pki/server.crt
# netbox_web_tls_key: /etc/pki/server.key
# netbox_web_tls_chain:
netbox_web_tls_redirect: false

示例剧本

- hosts: netboxes
  roles:
    - { role: gmazoyer.netbox }

许可

此Ansible角色根据GNU GPLv3条款发布。有关更多信息,请阅读 LICENSE 文件。

本角色的部分代码包括MIT许可证代码(请参见 7c400dd),并在头部中进行了划分。有关更多信息,请参见 LICENSE-MIT

作者信息

这个角色是由Guillaume Mazoyer于2017年创建的。

安装
ansible-galaxy install respawner.netbox
许可证
gpl-3.0
下载
364
拥有者