Skip to content

Commit fe8d5fb

Browse files
Check-1
1 parent 0bcea2e commit fe8d5fb

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,8 @@ netbox_keep_uwsgi_updated: false
9797
netbox_uwsgi_in_venv: false
9898
netbox_uwsgi_options: {}
9999
netbox_rqworker_processes: 1
100+
101+
# Whether to install the legacy housekeeping cron job.
102+
# NetBox v4.4+ replaces the housekeeping script with NetBox-managed scheduled jobs.
103+
# Set to false to skip creating the cron entry regardless of version.
104+
netbox_housekeeping_cron_enabled: true

tasks/deploy_netbox.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,25 @@
200200
user: "{{ netbox_user }}"
201201
cron_file: "netbox"
202202
when:
203-
- netbox_stable and netbox_stable_version is version('3.0.0', '>=')
204-
or netbox_git and _netbox_git_contains_housekeeping.rc == 0
203+
- netbox_housekeeping_cron_enabled | bool
204+
- (netbox_stable and netbox_stable_version is version('3.0.0', '>=')
205+
and netbox_stable_version is version('4.4.0', '<'))
206+
or (netbox_git and _netbox_git_contains_housekeeping.rc == 0)
207+
208+
- name: Remove housekeeping cronjob when not applicable
209+
cron:
210+
name: "Netbox housekeeping"
211+
user: "{{ netbox_user }}"
212+
cron_file: "netbox"
213+
state: absent
214+
when:
215+
- not (
216+
(netbox_housekeeping_cron_enabled | bool)
217+
and (
218+
(netbox_stable and netbox_stable_version is version('3.0.0', '>=') and netbox_stable_version is version('4.4.0', '<'))
219+
or (netbox_git and _netbox_git_contains_housekeeping.rc == 0)
220+
)
221+
)
205222

206223
- block:
207224
- name: Run database migrations for NetBox

0 commit comments

Comments
 (0)