Skip to content

Commit fdcc4e3

Browse files
authored
Merge pull request #166 from davidmehren/netbox-3.7
Compatibility with Netbox 3.7
2 parents 69119aa + a278b09 commit fdcc4e3

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

tasks/deploy_netbox.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
app_path: "{{ netbox_current_path }}/netbox"
205205
virtualenv: "{{ netbox_virtualenv_path }}"
206206

207-
- name: Clear cached data in NetBox
207+
- name: Clear cached data in NetBox < 3
208208
django_manage:
209209
command: "invalidate all"
210210
app_path: "{{ netbox_current_path }}/netbox"
@@ -213,14 +213,16 @@
213213
- netbox_stable and netbox_stable_version is version('3.0.0', '<')
214214
or netbox_git and _netbox_git_contains_invalidate_removed.rc != 0
215215

216-
- name: Clear cached data in NetBox 3.2.3+
216+
- name: Clear cached data in NetBox 3.2.3 to 3.6
217217
django_manage:
218218
command: "clearcache"
219219
app_path: "{{ netbox_current_path }}/netbox"
220220
virtualenv: "{{ netbox_virtualenv_path }}"
221221
when:
222222
- netbox_stable and netbox_stable_version is version('3.2.2', '>')
223-
or netbox_git and _netbox_git_contains_add_clearcache.rc == 0
223+
and netbox_stable_version is version('3.7.0', '<')
224+
or netbox_git and _netbox_git_contains_add_clearcache.rc == 0
225+
and _netbox_git_contains_remove_clearcache != 0
224226

225227
become: true
226228
become_user: "{{ netbox_user }}"

tasks/install_via_git.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@
9292
become: true
9393
become_user: "{{ netbox_user }}"
9494

95+
- name: Check existence of commit 2d1f882, removing the clearcache command
96+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^2d1f88272497ca72d2e1eca8e291c04538c6810e'
97+
args:
98+
chdir: "{{ netbox_git_repo_path }}"
99+
executable: /bin/bash
100+
register: _netbox_git_contains_remove_clearcache
101+
changed_when: False
102+
failed_when: "_netbox_git_contains_remove_clearcache.rc not in [0, 1]"
103+
95104
- name: Archive and extract snapshot of git repository
96105
shell: 'set -o pipefail; git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'
97106
args:

0 commit comments

Comments
 (0)