Skip to content

Commit 390c1df

Browse files
committed
Mergh branch 'release/v2.1.4' into master
2 parents bb6b37e + 929a0c8 commit 390c1df

File tree

9 files changed

+51
-5
lines changed

9 files changed

+51
-5
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ matrix:
1313
fast_finish: true
1414
env:
1515
- LXC_DISTRO=debian LXC_RELEASE=jessie
16+
- LXC_DISTRO=debian LXC_RELEASE=stretch
1617
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial
1718
- LXC_DISTRO=centos LXC_RELEASE=7
1819
before_cache:
@@ -27,7 +28,7 @@ install:
2728
- sudo apt-get install -y expect-dev
2829
- pip install ansible
2930
- ansible --version
30-
- printf '[defaults]\nroles_path=../\ncallback_whitelist=profile_tasks' >ansible.cfg
31+
- printf '[defaults]\nroles_path=../\ncallback_whitelist=profile_tasks\nforks=10\npipelining=True' >ansible.cfg
3132
- ansible-galaxy install lae.travis-lxc
3233
- ansible-playbook -vvv tests/install.yml -i tests/inventory
3334
script:

defaults/main.yml

Lines changed: 2 additions & 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.1.3
4+
netbox_stable_version: 2.1.4
55
netbox_stable_uri: "https://github.com/digitalocean/netbox/archive/v{{ netbox_stable_version }}.tar.gz"
66

77
netbox_git: false
@@ -28,6 +28,7 @@ netbox_config:
2828
- 127.0.0.1
2929
#NAPALM_USERNAME:
3030
#NAPALM_PASSWORD:
31+
MEDIA_ROOT: "{{ netbox_shared_path }}/media"
3132

3233
netbox_user: netbox
3334
netbox_group: netbox

tasks/deploy_netbox.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@
6363
notify:
6464
- reload netbox.service
6565

66-
- name: Set MEDIA_ROOT to shared media directory
66+
- name: Set MEDIA_ROOT to shared media directory (will be deprecated - if this is not skipped please update your NetBox)
6767
lineinfile:
6868
path: "{{ netbox_config_path }}/settings.py"
6969
regexp: '^MEDIA_ROOT\s*='
7070
line: 'MEDIA_ROOT = "{{ netbox_shared_path }}/media/"'
7171
state: present
7272
notify:
7373
- reload netbox.service
74+
when:
75+
- (netbox_stable and netbox_stable_version | version_compare('2.1.4', '<')) or (netbox_git and __netbox_git_contains_media_root_change.rc == 1)
7476

7577
- name: Run database migrations for NetBox
7678
django_manage:

tasks/install_via_git.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111
path: "{{ netbox_git_deploy_path }}"
1212
state: directory
1313

14+
- name: Check existence of commit 643f64d, affecting MEDIA_ROOT
15+
shell: 'git log --format=%H "{{ netbox_git_version }}" | grep ^643f64df3f02912957c2faf1a7555876fe00e2bc'
16+
args:
17+
chdir: "{{ netbox_git_repo_path }}"
18+
register: __netbox_git_contains_media_root_change
19+
changed_when: False
20+
failed_when: "__netbox_git_contains_media_root_change.rc not in [0, 1]"
21+
22+
- name: Ensure MEDIA_ROOT is defined if commit 643f64d exists
23+
fail:
24+
msg: "Please define MEDIA_ROOT in netbox_config."
25+
when:
26+
- __netbox_git_contains_media_root_change.rc == 0 and "MEDIA_ROOT" not in netbox_config
27+
1428
- name: Archive and extract snapshot of git repository
1529
shell: 'git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'
1630
args:

tasks/validate_variables.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@
3636
msg: "Please define NAPALM_USERNAME and NAPALM_PASSWORD in netbox_config to use NAPALM."
3737
when:
3838
- netbox_napalm_enabled and ("NAPALM_USERNAME" not in netbox_config or "NAPALM_PASSWORD" not in netbox_config)
39+
40+
- name: Ensure MEDIA_ROOT is defined
41+
fail:
42+
msg: "Please define MEDIA_ROOT in netbox_config."
43+
when:
44+
- netbox_stable and netbox_stable_version | version_compare('2.1.4', '<') and "MEDIA_ROOT" not in netbox_config

tests/group_vars/netbox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ netbox_socket: "0.0.0.0:8080"
44
netbox_config:
55
ALLOWED_HOSTS:
66
- "{{ inventory_hostname }}"
7+
MEDIA_ROOT: "{{ netbox_shared_path }}/media"
78
netbox_superuser_password: netbox
89
netbox_database: "netbox_{{ inventory_hostname_short }}"
910
netbox_database_host: 10.0.3.1

vars/debian-8.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ netbox_pip3_binary: /usr/bin/pip3
2121
netbox_ldap_packages:
2222
- libldap2-dev
2323
- libsasl2-dev
24-
- libssl-dev

vars/debian-9.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
netbox_packages:
3+
- libxml2-dev
4+
- libxslt1-dev
5+
- libffi-dev
6+
- graphviz
7+
- libpq-dev
8+
- libssl-dev
9+
netbox_python2_packages:
10+
- python2.7
11+
- python-dev
12+
- python-pip
13+
netbox_python2_binary: /usr/bin/python2.7
14+
netbox_pip2_binary: /usr/bin/pip2
15+
netbox_python3_packages:
16+
- python3.5
17+
- python3.5-dev
18+
- python3-pip
19+
netbox_python3_binary: /usr/bin/python3.5
20+
netbox_pip3_binary: /usr/bin/pip3
21+
netbox_ldap_packages:
22+
- libldap2-dev
23+
- libsasl2-dev

vars/ubuntu-16.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ netbox_pip3_binary: /usr/bin/pip3
2121
netbox_ldap_packages:
2222
- libldap2-dev
2323
- libsasl2-dev
24-
- libssl-dev

0 commit comments

Comments
 (0)