Skip to content

Commit

Permalink
update workflows and documentation for Debian support (#30)
Browse files Browse the repository at this point in the history
* add Debian checks to GitHub workflows
* remove checks for NetBox sub-point releases, keep last major/minor releases
* update README for Debian support and fix syntax highlighting
  • Loading branch information
jvoss authored Apr 27, 2022
1 parent 5472923 commit fb9525e
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 58 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
distro:
- amazonlinux2
- centos8
- debian11
- rockylinux8
- ubuntu2004

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ jobs:
distro:
- amazonlinux2
- centos8
- debian10
- debian11
- rockylinux8
- ubuntu2004
netbox:
- v3.2.1
- v3.2.0
- v3.1.11
- v3.0.12
exclude:
- distro: debian10
include:
- distro: debian10
netbox: v3.1.11
- distro: debian10
netbox: v3.0.12

services:
postgres:
Expand Down
88 changes: 46 additions & 42 deletions EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,57 @@ At the completion of this play netbox will be available at: `http://<host_ip>:80

## Host variables

# netbox.example.com.yml

netbox_home: /opt/netbox
netbox_version_tag: v3.0.9
netbox_db_username: netbox
netbox_db_password: password
netbox_secret_key: "-nit@y=2#)u2dz-e(de1$t*4mxpy4d9o(b4j5xf@6!ql=r-14o"

netbox_superusers:
- username: admin
password: admin
email: [email protected]

# caddy_ansible.caddy_ansible configuration
caddy_config: |
:8080 {
route /static* {
uri strip_prefix /static
root * /opt/netbox/current/netbox/static
file_server
}

reverse_proxy http://127.0.0.1:8001
}

# geerlingguy.postgresql configuration
postgresql_users:
- name: "{{ netbox_db_username }}"
password: "{{ netbox_db_password }}"
db: "{{ netbox_db_name }}"
postgresql_databases:
- name: "{{ netbox_db_name }}"
owner: "{{ netbox_db_username }}"
```yaml
# netbox.example.com.yml

netbox_home: /opt/netbox
netbox_version_tag: v3.0.9
netbox_db_username: netbox
netbox_db_password: password
netbox_secret_key: "-nit@y=2#)u2dz-e(de1$t*4mxpy4d9o(b4j5xf@6!ql=r-14o"

netbox_superusers:
- username: admin
password: admin
email: [email protected]

# caddy_ansible.caddy_ansible configuration
caddy_config: |
:8080 {
route /static* {
uri strip_prefix /static
root * /opt/netbox/current/netbox/static
file_server
}
reverse_proxy http://127.0.0.1:8001
}
# geerlingguy.postgresql configuration
postgresql_users:
- name: "{{ netbox_db_username }}"
password: "{{ netbox_db_password }}"
db: "{{ netbox_db_name }}"
postgresql_databases:
- name: "{{ netbox_db_name }}"
owner: "{{ netbox_db_username }}"
```
## Playbook
# playbook-netbox.yml
```yaml
# playbook-netbox.yml

- hosts: netbox.example.com
gather_facts: yes
become: yes
- hosts: netbox.example.com
gather_facts: yes
become: yes

roles:
- role: geerlingguy.postgresql
- role: geerlingguy.redis
- role: jvoss.netbox
- role: caddy_ansible.caddy_ansible
roles:
- role: geerlingguy.postgresql
- role: geerlingguy.redis
- role: jvoss.netbox
- role: caddy_ansible.caddy_ansible
```
## Notes
Expand Down
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,38 @@ https://img.shields.io/badge/Netbox-v3.2.1-blue)](https://github.com/netbox-comm
[![Ansible Quality Score](https://img.shields.io/ansible/quality/56786?color=blue)](https://galaxy.ansible.com/jvoss/netbox)
[![Version](https://img.shields.io/github/release/jvoss/ansible-role-netbox.svg)](https://github.com/jvoss/ansible-role-netbox/releases/)

Installs and configures [Netbox](https://github.com/netbox-community/netbox) on
RHEL/CentOS or Ubuntu servers.
Installs, configures and maintains [NetBox](https://github.com/netbox-community/netbox)

## Requirements

This role manages the installation and configuration of Netbox. This role
This role manages the installation and configuration of NetBox. This role
does not provide PostgreSQL or Redis services that are required dependencies
of the application. Those tasks are intentionally left to allow the user to
manage those services within their own roles and playbooks.

Tested on the following platforms:
* Amazon Linux 2
* CentOS 8
* CentOS 8
* Debian Buster (up to v3.1.11)
* Debian Bullseye
* Rocky Linux 8 / Red Hat Enterprise Linux (RHEL) 8.2+
* Ubuntu 20.04

This role will require root access (via sudo) to manage system dependencies and actions
on behalf of netbox.

Supports NetBox versions 3+

## Role variables

Minimum required variables assuming `localhost` PostgreSQL and Redis services
are available:

netbox_db_username: netbox
netbox_db_password: netbox
netbox_secret_key: "lnvRn_5Bypl8hBV4mMwgsMuHxr6uZvGwJyDqB7fcKqo"
```yaml
netbox_db_username: netbox
netbox_db_password: netbox
netbox_secret_key: "lnvRn_5Bypl8hBV4mMwgsMuHxr6uZvGwJyDqB7fcKqo"
```
If the `netbox_secret_key` is omitted a new one will be automatically generated
on each playbook run.
Expand All @@ -54,10 +59,12 @@ parameters unless `netbox_override_dynamic_config` is set to `True`. See
The following variables can be defined to create users during initial
installation only:

netbox_superusers:
- username: admin
password: admin
email: [email protected]
```yaml
netbox_superusers:
- username: admin
password: admin
email: [email protected]
```

Each user requires a username, password and email address defined. The role will
attempt to create the defined users only once during initial installation. If
Expand All @@ -77,7 +84,9 @@ Coming soon.

A specific version of netbox can be configured using the variable:

netbox_version_tag: v3.0.9
```yaml
netbox_version_tag: v3.0.9
```

This tag should match the Github tag name for the release to be installed.
It will ensure that a specific target is maintained. If not set, each run will
Expand All @@ -88,9 +97,11 @@ installation is maintained.

Another option is to deploy from a specifc branch and optionally a specific commit SHA

netbox_install_method: git
netbox_git_branch: master
netbox_git_sha: 8f1acb700d72467ffe7ae5c8502422a1eac0693d # optional
```yaml
netbox_install_method: git
netbox_git_branch: master
netbox_git_sha: 8f1acb700d72467ffe7ae5c8502422a1eac0693d # optional
```

## Dependencies

Expand Down
1 change: 1 addition & 0 deletions tasks/install.debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
loop:
- git
- build-essential
- cron
- libxml2-dev
- libxslt1-dev
- libffi-dev
Expand Down

0 comments on commit fb9525e

Please sign in to comment.