No description
- Jinja 90%
- Dockerfile 6.3%
- Shell 3.7%
| defaults | ||
| files | ||
| meta | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| README.md | ||
ansible-roles-netbox
This role will deploy a full root-less podman based netbox instance, with supporting database and redis services
- https://netbox.dev/
- https://docs.netbox.dev/en/stable/
- https://github.com/netbox-community/netbox-docker
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
- 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