Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 8 additions & 4 deletions tasks/deploy_netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,20 @@
group: "{{ netbox_group }}"
loop: "{{ netbox_reports }}"

- name: Schedule daily housekeeping cronjob
- name: Manage daily housekeeping cronjob
cron:
name: "Netbox housekeeping"
special_time: daily
job: "{{ netbox_virtualenv_path }}/bin/python {{ netbox_current_path }}/netbox/manage.py housekeeping"
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
state: >-
{{
'present' if (
(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 and _netbox_git_contains_housekeeping_removed.rc != 0)
) else 'absent'
}}

- block:
- name: Run database migrations for NetBox
Expand Down
9 changes: 9 additions & 0 deletions tasks/install_via_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@
changed_when: False
failed_when: "_netbox_git_contains_housekeeping.rc not in [0, 1]"

- name: Check existence of commit removing housekeeping management command (PR #19815)
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^f3a8b9c1d2e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_housekeeping_removed
changed_when: False
failed_when: "_netbox_git_contains_housekeeping_removed.rc not in [0, 1]"

- name: Check existence of commit 028c876, removing the invalidate command
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^028c876bcafbaede2731f191512bbebe3f1b6a9e'
args:
Expand Down