Skip to content

Commit

Permalink
Merge pull request #93 from lae/fix/webhooks-deprecation
Browse files Browse the repository at this point in the history
Rename webhooks Redis connection to tasks
  • Loading branch information
lae authored May 6, 2020
2 parents 1064342 + 65eca50 commit bcab5ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tasks/install_via_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
changed_when: False
failed_when: "_netbox_git_contains_issue_2239_fix.rc not in [0, 1]"

- name: Check existence of commit 3590ed3, renaming webhooks to tasks
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^3590ed378d161dd724fad2dc73ff56da746352f8'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_tasks_rename
changed_when: False
failed_when: "_netbox_git_contains_tasks_rename.rc not in [0, 1]"

- name: Archive and extract snapshot of git repository
shell: 'set -o pipefail; git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'
args:
Expand Down
8 changes: 7 additions & 1 deletion templates/configuration.py.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ ansible_managed | comment }}
import json
import os
{{ ansible_managed | comment }}

{% if netbox_metrics_enabled %}
if "prometheus_multiproc_dir" in os.environ:
Expand Down Expand Up @@ -30,7 +30,13 @@ DATABASE = {
}

REDIS = {
{# https://github.com/netbox-community/netbox/pull/4366 #}
{% if netbox_stable and netbox_stable_version is version('2.7.11', '>=') or
netbox_git and _netbox_git_contains_tasks_rename %}
'tasks': {
{% else %}
'webhooks': {
{% endif %}
'HOST': '{{ netbox_redis_host }}',
'PORT': {{ netbox_redis_port }},
'PASSWORD': '{{ netbox_redis_password }}',
Expand Down

0 comments on commit bcab5ba

Please sign in to comment.