No description
Find a file
2026-04-05 19:45:53 +00:00
defaults initial commit 2026-04-05 19:45:53 +00:00
meta initial commit 2026-04-05 19:45:53 +00:00
tasks initial commit 2026-04-05 19:45:53 +00:00
templates initial commit 2026-04-05 19:45:53 +00:00
.gitignore initial commit 2026-04-05 19:45:53 +00:00
README.md initial commit 2026-04-05 19:45:53 +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