File tree Expand file tree Collapse file tree 10 files changed +32
-22
lines changed Expand file tree Collapse file tree 10 files changed +32
-22
lines changed Original file line number Diff line number Diff line change 4
4
* .retry
5
5
* .code-workspace
6
6
* .sw ?
7
+ .venv
Original file line number Diff line number Diff line change @@ -234,6 +234,15 @@ Use this syntax if your redis is installed with sentinet architecture (multiple
234
234
the second set of variables if you wish to split your cache database from your
235
235
webhooks database.
236
236
237
+ [source,yaml]
238
+ ----
239
+ netbox_rqworker_processes: 1
240
+ ----
241
+
242
+ Specify how many request queue workers should be started by the systemd service.
243
+ You can leave this at the default of 1, unless you have a large number of reports,
244
+ scripts and other background tasks.
245
+
237
246
[source,yaml]
238
247
----
239
248
netbox_config:
Original file line number Diff line number Diff line change @@ -100,3 +100,4 @@ netbox_pip_constraints:
100
100
101
101
netbox_keep_uwsgi_updated : false
102
102
netbox_uwsgi_options : {}
103
+ netbox_rqworker_processes : 1
Original file line number Diff line number Diff line change 19
19
20
20
- name : restart netbox-rqworker.service
21
21
systemd :
22
- name : netbox-rqworker.service
22
+ name : " netbox-rqworker@{{ item }} .service"
23
23
state : restarted
24
24
daemon_reload : true
25
-
26
- - name : reload netbox-rqworker.service
27
- systemd :
28
- name : netbox-rqworker.service
29
- state : reloaded
25
+ with_sequence : count="{{ netbox_rqworker_processes }}"
Original file line number Diff line number Diff line change 27
27
role_attr_flags : CREATEDB,NOSUPERUSER
28
28
# # REDIS server install
29
29
redis_bind : 127.0.0.1
30
+ netbox_rqworker_processes : 2
30
31
roles :
31
32
- geerlingguy.postgresql
32
33
- davidwittman.redis
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ def test_services(host):
10
10
services = [
11
11
"netbox.socket" ,
12
12
"netbox.service" ,
13
- "netbox-rqworker.service"
13
+ "netbox-rqworker@1.service"
14
+ "netbox-rqworker@2.service"
14
15
]
15
16
for service in services :
16
17
s = host .service (service )
Original file line number Diff line number Diff line change 80
80
py_compile.compile(f, c); os.remove(c)\" "
81
81
notify :
82
82
- reload netbox.service
83
- - reload netbox-rqworker.service
83
+ - restart netbox-rqworker.service
84
84
85
85
- name : Generate LDAP configuration for NetBox if enabled
86
86
template :
Original file line number Diff line number Diff line change 106
106
- name : Install NetBox-rqworker service unit file
107
107
template :
108
108
src : netbox-rqworker.service.j2
109
- dest : /lib/systemd/system/netbox-rqworker.service
109
+ dest : /lib/systemd/system/netbox-rqworker@ .service
110
110
notify :
111
111
- restart netbox-rqworker.service
112
112
121
121
122
122
- name : Start and enable netbox-rqworker.service
123
123
systemd :
124
- name : netbox-rqworker.service
124
+ name : " netbox-rqworker@{{ item }} .service"
125
125
state : started
126
126
enabled : true
127
+ with_sequence : count="{{ netbox_rqworker_processes }}"
127
128
128
129
- name : Restore the previous Ansible Python interpreter
129
130
set_fact :
Original file line number Diff line number Diff line change 1
1
{{ ansible_managed | comment }}
2
2
[Unit]
3
- Description=NetBox RQ-Worker
4
- Documentation=http://netbox.readthedocs.io/en/{{ 'latest' if netbox_git else 'stable' }}/installation/3-http-daemon/#supervisord-installation
5
- After=syslog.target
3
+ Description=NetBox Request Queue Worker %i
4
+ Documentation=https://docs.netbox.dev/
5
+ After=network-online.target
6
+ Wants=network-online.target
6
7
7
8
[Service]
9
+ Type=simple
10
+
8
11
WorkingDirectory={{ netbox_shared_path }}
9
- ExecStart={{ netbox_virtualenv_path }}/bin/python \
10
- {{ netbox_current_path }}/netbox/manage.py rqworker
11
- ExecReload=/bin/kill -1 $MAINPID
12
- ExecStop=/bin/kill -2 $MAINPID
12
+ ExecStart={{ netbox_virtualenv_path }}/bin/python {{ netbox_current_path }}/netbox/manage.py rqworker high default low
13
+
13
14
StandardOutput=journal
14
15
StandardError=journal
15
16
User={{ netbox_user }}
16
17
Group={{ netbox_group }}
17
18
Restart=on-failure
18
- #SuccessExitStatus=15 17 29 30
19
- KillSignal=SIGQUIT
20
- StandardError=syslog
19
+ RestartSec=30
20
+
21
21
NotifyAccess=all
22
- PrivateTmp=yes
22
+ PrivateTmp=true
23
23
ProtectSystem=full
24
24
DeviceAllow=/dev/null rw
25
25
DeviceAllow=/dev/urandom r
Original file line number Diff line number Diff line change 13
13
shell : cat /srv/netbox/shared/uwsgi.ini
14
14
changed_when : false
15
15
- name : NetBox rq-worker service status # noqa 303 305
16
- shell : " systemctl status netbox-rqworker.service"
16
+ shell : " systemctl status netbox-rqworker@1 .service"
17
17
changed_when : false
18
18
- name : NetBox application log # noqa 305
19
19
shell : cat /srv/netbox/shared/application.log
You can’t perform that action at this time.
0 commit comments