Add netbox role
Kinda ouroborosish if you think about it. Better don’t.
This commit is contained in:
parent
43b9010126
commit
c7a3513fa1
14 changed files with 379 additions and 0 deletions
10
roles/netbox/templates/netbox-rq.initd.j2
Normal file
10
roles/netbox/templates/netbox-rq.initd.j2
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
description="NetBox request queue worker"
|
||||
|
||||
command="{{ user_info.home }}/app/venv/bin/python3"
|
||||
command_args="{{ user_info.home }}/app/netbox/manage.py rqworker high default low"
|
||||
command_user="{{ user }}:{{ user }}"
|
||||
|
||||
command_background=true
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
23
roles/netbox/templates/netbox.conf.j2
Normal file
23
roles/netbox/templates/netbox.conf.j2
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% for fqdn in fqdns %}
|
||||
server {
|
||||
server_name {{ fqdn }};
|
||||
|
||||
listen [::]:443 ssl ipv6only=off;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ fqdn }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ fqdn }}/privkey.pem;
|
||||
|
||||
client_max_body_size 100m;
|
||||
|
||||
location /static/ {
|
||||
alias {{ user_info.home }}/app/netbox/static/;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8001;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
{% endfor %}
|
10
roles/netbox/templates/netbox.initd.j2
Normal file
10
roles/netbox/templates/netbox.initd.j2
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
description="NetBox WSGI service"
|
||||
|
||||
command="{{ user_info.home }}/app/venv/bin/gunicorn"
|
||||
command_args="--pythonpath {{ user_info.home }}/app/netbox --config {{ user_info.home }}/gunicorn.py netbox.wsgi"
|
||||
command_user="{{ user }}:{{ user }}"
|
||||
|
||||
command_background=true
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
Loading…
Add table
Add a link
Reference in a new issue