Skip to content

Commit 5305ecb

Browse files
committed
NetBox 2.5 release (#40)
Merge branch 'feature/netbox-2.5' into master
2 parents 61a2c89 + b841044 commit 5305ecb

File tree

13 files changed

+38
-45
lines changed

13 files changed

+38
-45
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Deploys and configures DigitalOcean's [NetBox].
88
This role will deploy NetBox within its own virtualenv either by release tarball
99
or via git using uWSGI as the application server.
1010

11-
Tested and supported against CentOS 7/Debian 8 and 9/Ubuntu 16.
11+
Tested and supported against CentOS 7/Debian 9/Ubuntu 16 and 18.
1212

1313
Note that this role is slightly opinionated and differs from installation
1414
instructions from the NetBox documentation. The main differences are:
@@ -74,7 +74,7 @@ tells the role to deploy by extracting tarball releases from GitHub, while
7474
`netbox_git` tells the role to clone a NetBox git repository - they're mutually
7575
exclusive.
7676

77-
netbox_stable_version: 2.4.7
77+
netbox_stable_version: 2.5.0
7878
netbox_stable_uri: "https://github.com/digitalocean/netbox/archive/v{{ netbox_stable_version }}.tar.gz"
7979

8080
These can be configured to pin a version (e.g. increment to trigger an upgrade)

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# defaults file for lae.netbox
33
netbox_stable: false
4-
netbox_stable_version: 2.4.7
4+
netbox_stable_version: 2.5.0
55
netbox_stable_uri: "https://github.com/digitalocean/netbox/archive/v{{ netbox_stable_version }}.tar.gz"
66

77
netbox_git: false

examples/netbox_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ netbox_config:
4646
- console
4747
level: INFO
4848
LOGIN_REQUIRED: yes
49+
LOGIN_TIMEOUT: 1209600
4950
MAINTENANCE_MODE: False
5051
MAX_PAGE_SIZE: 500
5152
MEDIA_ROOT: /srv/netbox_media
@@ -63,6 +64,7 @@ netbox_config:
6364
PASSWORD: redisisfun
6465
DATABASE: 0
6566
DEFAULT_TIMEOUT: 300
67+
SESSION_FILE_PATH: "{{ netbox_shared_path }}/sessions"
6668
# quotes aren't necessary as you can see - but in my opinion quotes make this more readable
6769
SHORT_DATE_FORMAT: 'Y-m-d'
6870
SHORT_DATETIME_FORMAT: 'Y-m-d H:i'

meta/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ galaxy_info:
1111
- name: Debian
1212
versions:
1313
- stretch
14-
- jessie
1514
- name: EL
1615
versions:
1716
- 7

tasks/deploy_netbox.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929
requirements: "{{ netbox_current_path }}/requirements.txt"
3030
extra_args: "-c {{ netbox_current_path }}/constraints.txt"
3131
virtualenv: "{{ netbox_virtualenv_path }}"
32-
virtualenv_python: "{{ netbox_python_binary }}"
32+
virtualenv_command: "{{ netbox_python_binary }} -m venv"
3333
become: True
3434
become_user: "{{ netbox_user }}"
3535

3636
- name: Install django-rq if webhooks enabled
3737
pip:
3838
name: "django-rq"
3939
virtualenv: "{{ netbox_virtualenv_path }}"
40-
virtualenv_python: "{{ netbox_python_binary }}"
4140
become: True
4241
become_user: "{{ netbox_user }}"
4342
when:

tasks/install_packages_yum.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,19 @@
1616
- "{{ netbox_ldap_packages if netbox_ldap_enabled else [] }}"
1717
- "{{ 'git' if netbox_git else [] }}"
1818
- "{{ 'acl' if ('SUDO_USER' in ansible_env and ansible_env.SUDO_USER != 'root') else [] }}"
19+
20+
# python3 pip package not available on EPEL.
21+
- name: Ensure pip is available on Red Hat-based distros
22+
shell: "{{ netbox_python_binary }} -m pip -V || {{ netbox_python_binary }} -m ensurepip"
23+
register: _existence_of_pip
24+
changed_when: "'Successfully installed pip' in _existence_of_pip.stdout"
25+
26+
# python3 psycopg2 packages are not available on EPEL.
27+
- name: Install psycopg2 via pip on Red Hat-based distros
28+
pip:
29+
name: psycopg2
30+
state: latest
31+
vars:
32+
ansible_python_interpreter: "{{ netbox_python_binary }}"
33+
environment:
34+
PATH: "/usr/local/bin:{{ _path }}"

tasks/load_variables.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
netbox_ldap_packages: "{{ _netbox_ldap_packages | list }}"
2828
when: netbox_ldap_packages is not defined
2929

30-
- name: Determine whether to switch Ansible's interpreter
30+
- name: Identify current execution PATH
31+
shell: "echo $PATH"
32+
register: _path_exec
33+
changed_when: false
34+
35+
- name: Set a fact for current execution PATH
3136
set_fact:
32-
netbox_switch_ansible_python: "{{ _netbox_switch_ansible_python | default(True) }}"
33-
when: netbox_switch_ansible_python is not defined
37+
_path: "{{ _path_exec.stdout }}"

tasks/main.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
- name: Switch Ansible's Python interpreter to Python 3
1010
set_fact:
1111
ansible_python_interpreter: "{{ netbox_python_binary }}"
12-
when: netbox_switch_ansible_python
13-
14-
- name: Install virtualenv via pip
15-
pip:
16-
name: virtualenv
17-
state: latest
18-
executable: /usr/bin/pip3
1912

2013
- name: Create NetBox user group
2114
group:
@@ -55,7 +48,8 @@
5548
pip:
5649
name: uwsgi
5750
state: latest
58-
executable: /usr/bin/pip3
51+
environment:
52+
PATH: "/usr/local/bin:{{ _path }}"
5953
notify:
6054
- reload netbox.service
6155

vars/debian-8.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

vars/debian-9.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _netbox_packages:
1010
_netbox_python_packages:
1111
- python3.5
1212
- python3.5-dev
13+
- python3-venv
1314
- python3-pip
1415
- python3-psycopg2 # used by ansible's postgres modules
1516
_netbox_python_binary: /usr/bin/python3.5

0 commit comments

Comments
 (0)