File tree 9 files changed +51
-5
lines changed
9 files changed +51
-5
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ matrix:
13
13
fast_finish : true
14
14
env :
15
15
- LXC_DISTRO=debian LXC_RELEASE=jessie
16
+ - LXC_DISTRO=debian LXC_RELEASE=stretch
16
17
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial
17
18
- LXC_DISTRO=centos LXC_RELEASE=7
18
19
before_cache :
@@ -27,7 +28,7 @@ install:
27
28
- sudo apt-get install -y expect-dev
28
29
- pip install ansible
29
30
- 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
31
32
- ansible-galaxy install lae.travis-lxc
32
33
- ansible-playbook -vvv tests/install.yml -i tests/inventory
33
34
script :
Original file line number Diff line number Diff line change 1
1
---
2
2
# defaults file for lae.netbox
3
3
netbox_stable : false
4
- netbox_stable_version : 2.1.3
4
+ netbox_stable_version : 2.1.4
5
5
netbox_stable_uri : " https://github.com/digitalocean/netbox/archive/v{{ netbox_stable_version }}.tar.gz"
6
6
7
7
netbox_git : false
@@ -28,6 +28,7 @@ netbox_config:
28
28
- 127.0.0.1
29
29
# NAPALM_USERNAME:
30
30
# NAPALM_PASSWORD:
31
+ MEDIA_ROOT : " {{ netbox_shared_path }}/media"
31
32
32
33
netbox_user : netbox
33
34
netbox_group : netbox
Original file line number Diff line number Diff line change 63
63
notify :
64
64
- reload netbox.service
65
65
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)
67
67
lineinfile :
68
68
path : " {{ netbox_config_path }}/settings.py"
69
69
regexp : ' ^MEDIA_ROOT\s*='
70
70
line : ' MEDIA_ROOT = "{{ netbox_shared_path }}/media/"'
71
71
state : present
72
72
notify :
73
73
- 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)
74
76
75
77
- name : Run database migrations for NetBox
76
78
django_manage :
Original file line number Diff line number Diff line change 11
11
path : " {{ netbox_git_deploy_path }}"
12
12
state : directory
13
13
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
+
14
28
- name : Archive and extract snapshot of git repository
15
29
shell : ' git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'
16
30
args :
Original file line number Diff line number Diff line change 36
36
msg : " Please define NAPALM_USERNAME and NAPALM_PASSWORD in netbox_config to use NAPALM."
37
37
when :
38
38
- 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
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ netbox_socket: "0.0.0.0:8080"
4
4
netbox_config:
5
5
ALLOWED_HOSTS:
6
6
- "{{ inventory_hostname }}"
7
+ MEDIA_ROOT: "{{ netbox_shared_path }}/media"
7
8
netbox_superuser_password: netbox
8
9
netbox_database: "netbox_{{ inventory_hostname_short }}"
9
10
netbox_database_host: 10.0.3.1
Original file line number Diff line number Diff line change @@ -21,4 +21,3 @@ netbox_pip3_binary: /usr/bin/pip3
21
21
netbox_ldap_packages :
22
22
- libldap2-dev
23
23
- libsasl2-dev
24
- - libssl-dev
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -21,4 +21,3 @@ netbox_pip3_binary: /usr/bin/pip3
21
21
netbox_ldap_packages :
22
22
- libldap2-dev
23
23
- libsasl2-dev
24
- - libssl-dev
You can’t perform that action at this time.
0 commit comments