diff --git a/tasks/deploy_netbox.yml b/tasks/deploy_netbox.yml index 874fbab..3c95501 100644 --- a/tasks/deploy_netbox.yml +++ b/tasks/deploy_netbox.yml @@ -221,8 +221,8 @@ when: - netbox_stable and netbox_stable_version is version('3.2.2', '>') and netbox_stable_version is version('3.7.0', '<') - or netbox_git and _netbox_git_contains_add_clearcache.rc == 0 - and _netbox_git_contains_remove_clearcache != 0 + or netbox_git and ( _netbox_git_contains_add_clearcache.rc == 0 + and _netbox_git_contains_remove_clearcache.rc != 0 ) become: true become_user: "{{ netbox_user }}" diff --git a/tasks/install_via_git.yml b/tasks/install_via_git.yml index 91cc682..a1a0615 100644 --- a/tasks/install_via_git.yml +++ b/tasks/install_via_git.yml @@ -89,18 +89,18 @@ changed_when: False failed_when: "_netbox_git_contains_add_clearcache.rc not in [0, 1]" + - name: Check existence of commit 2d1f882, removing the clearcache command + shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^2d1f88272497ca72d2e1eca8e291c04538c6810e' + args: + chdir: "{{ netbox_git_repo_path }}" + executable: /bin/bash + register: _netbox_git_contains_remove_clearcache + changed_when: False + failed_when: "_netbox_git_contains_remove_clearcache.rc not in [0, 1]" + become: true become_user: "{{ netbox_user }}" -- name: Check existence of commit 2d1f882, removing the clearcache command - shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^2d1f88272497ca72d2e1eca8e291c04538c6810e' - args: - chdir: "{{ netbox_git_repo_path }}" - executable: /bin/bash - register: _netbox_git_contains_remove_clearcache - changed_when: False - failed_when: "_netbox_git_contains_remove_clearcache.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: