-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
netbox.service.j2
39 lines (37 loc) · 1004 Bytes
/
netbox.service.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{{ ansible_managed | comment }}
[Unit]
Description=NetBox IPAM/DCIM Tool
Documentation=http://netbox.readthedocs.io/en/{{ 'latest' if netbox_git else 'stable' }}/
Requires=netbox.socket
After=syslog.target
[Service]
ExecStart=/usr/bin/env uwsgi --ini {{ netbox_shared_path }}/uwsgi.ini
ExecReload=/bin/kill -1 $MAINPID
ExecStop=/bin/kill -2 $MAINPID
StandardInput=socket
StandardOutput=journal
StandardError=journal
User={{ netbox_user }}
Group={{ netbox_group }}
Restart=on-failure
SuccessExitStatus=15 17 29 30
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
PrivateTmp=yes
ProtectSystem=full
ReadWriteDirectories={{ netbox_shared_path }}
{% if netbox_database_socket is defined %}
ReadWriteDirectories={{ netbox_database_socket }}
{% endif %}
DeviceAllow=/dev/null rw
DeviceAllow=/dev/urandom r
DeviceAllow=/dev/zero r
ProtectHome=yes
NoNewPrivileges=yes
{% if netbox_metrics_enabled %}
RuntimeDirectory={{ netbox_metrics_dir }}
{% endif %}
[Install]
WantedBy=multi-user.target