Skip to content

Commit

Permalink
Bump NetBox to 2.3.6 and retroactively add fix for netbox-community/n…
Browse files Browse the repository at this point in the history
  • Loading branch information
lae committed Jul 16, 2018
1 parent a802293 commit 9a44741
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tells the role to deploy by extracting tarball releases from GitHub, while
`netbox_git` tells the role to clone a NetBox git repository - they're mutually
exclusive.

netbox_stable_version: 2.3.5
netbox_stable_version: 2.3.6
netbox_stable_uri: "https://github.com/digitalocean/netbox/archive/v{{ netbox_stable_version }}.tar.gz"

These can be configured to pin a version (e.g. increment to trigger an upgrade)
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# defaults file for lae.netbox
netbox_stable: false
netbox_stable_version: 2.3.5
netbox_stable_version: 2.3.6
netbox_stable_uri: "https://github.com/digitalocean/netbox/archive/v{{ netbox_stable_version }}.tar.gz"

netbox_git: false
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
galaxy_info:
role_name: netbox
author: Musee Ullah
description: Installs and configures NetBox, a DCIM suite, in a production setting.
license: MIT
Expand Down
8 changes: 8 additions & 0 deletions tasks/deploy_netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
when:
- (netbox_stable and netbox_stable_version | version_compare('2.1.5', '<=')) or (netbox_git and __netbox_git_contains_issue_1563_fix.rc == 1)

- name: Pin django-filter dependency to under 2.0.0 for NetBox 2.3.5 and below
replace:
path: "{{ netbox_current_path }}/requirements.txt"
regexp: '^(django-filter>=\d+\.\d+(\.\d+)?)$'
replace: '\1,<2.0.0'
when:
- (netbox_stable and netbox_stable_version | version_compare('2.3.5', '<=')) or (netbox_git and __netbox_git_contains_issue_2239_fix.rc == 1)

- name: Create NetBox virtualenv and install needed Python dependencies
pip:
requirements: "{{ netbox_current_path }}/requirements.txt"
Expand Down
8 changes: 8 additions & 0 deletions tasks/install_via_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
changed_when: False
failed_when: "__netbox_git_contains_issue_1563_fix.rc not in [0, 1]"

- name: Check existence of commit 1fb67b7, fixing issue netbox#2239
shell: 'git log --format=%H "{{ netbox_git_version }}" | grep ^1fb67b791f1a91c624dae4a1cd256e4cf3ddbb77'
args:
chdir: "{{ netbox_git_repo_path }}"
register: __netbox_git_contains_issue_2239_fix
changed_when: False
failed_when: "__netbox_git_contains_issue_2239_fix.rc not in [0, 1]"

- name: Archive and extract snapshot of git repository
shell: 'git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'
args:
Expand Down

0 comments on commit 9a44741

Please sign in to comment.