Skip to content

Commit

Permalink
Merge pull request #188 from lae/develop
Browse files Browse the repository at this point in the history
release v1.0.7
  • Loading branch information
lae authored Jul 5, 2024
2 parents b1f4673 + 7812f03 commit 2858bd2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
9 changes: 9 additions & 0 deletions tasks/deploy_netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,14 @@
or netbox_git and ( _netbox_git_contains_add_clearcache.rc == 0
and _netbox_git_contains_remove_clearcache.rc != 0 )

- name: Rebuild the search cache (lazily)
django_manage:
command: "reindex --lazy"
app_path: "{{ netbox_current_path }}/netbox"
virtualenv: "{{ netbox_virtualenv_path }}"
when:
- netbox_stable and netbox_stable_version is version('3.4.4', '>')
or netbox_git and _netbox_git_contains_reindex_lazy.rc == 0

become: true
become_user: "{{ netbox_user }}"
9 changes: 9 additions & 0 deletions tasks/install_via_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@
changed_when: False
failed_when: "_netbox_git_contains_remove_clearcache.rc not in [0, 1]"

- name: Check existence of commit 5a4d8a7, adding the reindex lazy command
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^5a4d8a71075a4529be8d5ef22d76d69861240f45'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_reindex_lazy
changed_when: False
failed_when: "_netbox_git_contains_reindex_lazy.rc not in [0, 1]"

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

Expand Down
21 changes: 21 additions & 0 deletions vars/amazon-2023.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
netbox_install_epel: false
_netbox_packages:
- gcc
- libpq-devel
- libxml2-devel
- libxslt-devel
- libffi-devel
- libjpeg-turbo-devel
- graphviz
- openssl-devel
_netbox_python_packages:
- python3
- python3-devel
- python3-setuptools
- python3-psycopg2
- python3-libselinux
- python3-pip
_netbox_python_binary: /usr/bin/python3.9
_netbox_ldap_packages:
- openldap-devel
7 changes: 5 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ _netbox_storages_map:
sftpstorage: []

netbox_superuser_script: |
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from base64 import b64decode
User = get_user_model()
password = b64decode("{{ netbox_superuser_password | b64encode }}").decode("UTF-8")
query = User.objects.filter(username="{{ netbox_superuser_username }}")
if not query.exists():
Expand All @@ -33,7 +34,8 @@ netbox_superuser_script: |
netbox_superuser_token: |
from users.models import Token
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.get(username="{{ netbox_superuser_username }}")
query = Token.objects.filter(user=user)
if not query.exists():
Expand All @@ -45,3 +47,4 @@ netbox_python_compat_matrix:
- { netbox_version_min: '2.8.0', python_needed: '3.6.0' }
- { netbox_version_min: '3.0.0', python_needed: '3.7.0' }
- { netbox_version_min: '3.2.0', python_needed: '3.8.0' }
- { netbox_version_min: '4.0.0', python_needed: '3.10.0' }

0 comments on commit 2858bd2

Please sign in to comment.