Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,8 @@ netbox_keep_uwsgi_updated: false
netbox_uwsgi_in_venv: false
netbox_uwsgi_options: {}
netbox_rqworker_processes: 1

# Whether to install the legacy housekeeping cron job.
# NetBox v4.4+ replaces the housekeeping script with NetBox-managed scheduled jobs.
# Set to false to skip creating the cron entry regardless of version.
netbox_housekeeping_cron_enabled: true
21 changes: 19 additions & 2 deletions tasks/deploy_netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,25 @@
user: "{{ netbox_user }}"
cron_file: "netbox"
when:
- netbox_stable and netbox_stable_version is version('3.0.0', '>=')
or netbox_git and _netbox_git_contains_housekeeping.rc == 0
- netbox_housekeeping_cron_enabled | bool
- (netbox_stable and netbox_stable_version is version('3.0.0', '>=')
and netbox_stable_version is version('4.4.0', '<'))
or (netbox_git and _netbox_git_contains_housekeeping.rc == 0)

- name: Remove housekeeping cronjob when not applicable
cron:
name: "Netbox housekeeping"
user: "{{ netbox_user }}"
cron_file: "netbox"
state: absent
when:
- not (
(netbox_housekeeping_cron_enabled | bool)
and (
(netbox_stable and netbox_stable_version is version('3.0.0', '>=') and netbox_stable_version is version('4.4.0', '<'))
or (netbox_git and _netbox_git_contains_housekeeping.rc == 0)
)
)

- block:
- name: Run database migrations for NetBox
Expand Down