No description
Find a file
2026-03-17 06:32:49 +00:00
defaults defaults update 2026-03-17 06:32:49 +00:00
meta initial working commit for podman based netbox 2023-08-24 06:10:52 +00:00
tasks update netbox defaults, update plugin build for modern netbox versions 2026-03-17 05:43:58 +00:00
templates update netbox defaults, update plugin build for modern netbox versions 2026-03-17 05:43:58 +00:00
.gitignore update common format 2025-10-06 21:56:30 +00:00
README.md update with fixes to apply custom env to the netbox container 2024-02-03 20:36:05 +00:00

ansible-roles-netbox

This role will deploy a full root-less podman based netbox instance, with supporting database and redis services

Task Configuration

Define netbox_url, this will useful in conjunction with a proxy role such as traefik or nginx

Define netbox_path if the container user has a custom homedir such as something under /srv..

Define netbox_plugin_build to enable building a custom container with plugins

There are several other values that should be defined and secured vial ansible vault

  • netbox_secret_key
  • netbox_superuser_password
  • netbox_email_password
  • netbox_db_password
  • netbox_redis_password

To add custom env values to the netbox container you can define netbox_custom_env which will get combined with the default netbox_server_env

netbox_custom_env:
  CUSTOM_ENV: ...

Deployment Example

- name: Setup proxy and service
  hosts: somehost
  become: true
  roles:
    - role: netbox
      netbox_url: netbox.somehost.somewhere
      netbox_superuser_name: admin
      netbox_superuser_email: admin@somehost.somewhere
      netbox_plugin_gather_static: true
      netbox_email_server: mail.somehost.somewhere
      netbox_email_from: netbox@somehost.somewhere
      netbox_email_username: netbox@somehost.somewhere
    - role: traefik
      traefik_routes:
        - name: uptime
          host: "{{ portainer_url }}"
          srv: "{{ traefik_host_address }}:9000"
    - role: firewalld
      firewalld_add:
        - name: public
          services:
            - http
            - https
          forwards:
            - port: 80
              to: 8080
            - port: 443
              to: 8443

Deployment and Removal

Sometimes you need to manually stop the running containers to get a clean run when re-deploying Services must be stopped as the respecitve user or another means to aquire the correct user scope for systemd

systemctl --user stop container-traefik.service
systemctl --user stop container-netbox.service

Deploy

ansible-playbook -i hosts site.yml --tags=firewalld,traefik,netbox --limit=somehost

Remove

ansible-playbook -i hosts site.yml --tags=firewalld,traefik,netbox --extra-vars "container_state=absent firewall_action=remove" --limit=somehost