Skip to content

Commit f9288b2

Browse files
committed
Run "git log" under the same user that cloned the repo
This avoids "fatal: detected dubious ownership in repository" errors that cause all feature-detection commands to fail.
1 parent c192d30 commit f9288b2

File tree

1 file changed

+69
-64
lines changed

1 file changed

+69
-64
lines changed

tasks/install_via_git.yml

Lines changed: 69 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,77 +15,82 @@
1515
group: "{{ netbox_group }}"
1616
state: directory
1717

18-
- name: Check existence of commit 1fb67b7, fixing issue netbox#2239
19-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^1fb67b791f1a91c624dae4a1cd256e4cf3ddbb77'
20-
args:
21-
chdir: "{{ netbox_git_repo_path }}"
22-
executable: /bin/bash
23-
register: _netbox_git_contains_issue_2239_fix
24-
changed_when: false
25-
failed_when: "_netbox_git_contains_issue_2239_fix.rc not in [0, 1]"
18+
- name: Check for presence of various commits in git history
19+
block:
20+
- name: Check existence of commit 1fb67b7, fixing issue netbox#2239
21+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^1fb67b791f1a91c624dae4a1cd256e4cf3ddbb77'
22+
args:
23+
chdir: "{{ netbox_git_repo_path }}"
24+
executable: /bin/bash
25+
register: _netbox_git_contains_issue_2239_fix
26+
changed_when: false
27+
failed_when: "_netbox_git_contains_issue_2239_fix.rc not in [0, 1]"
2628

27-
- name: Check existence of commit 3590ed3, renaming webhooks to tasks
28-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^3590ed378d161dd724fad2dc73ff56da746352f8'
29-
args:
30-
chdir: "{{ netbox_git_repo_path }}"
31-
executable: /bin/bash
32-
register: _netbox_git_contains_tasks_rename
33-
changed_when: false
34-
failed_when: "_netbox_git_contains_tasks_rename.rc not in [0, 1]"
29+
- name: Check existence of commit 3590ed3, renaming webhooks to tasks
30+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^3590ed378d161dd724fad2dc73ff56da746352f8'
31+
args:
32+
chdir: "{{ netbox_git_repo_path }}"
33+
executable: /bin/bash
34+
register: _netbox_git_contains_tasks_rename
35+
changed_when: false
36+
failed_when: "_netbox_git_contains_tasks_rename.rc not in [0, 1]"
3537

36-
- name: Check existence of commit 90dbe9b, renaming DEFAULT_TIMEOUT to RQ_DEFAULT_TIMEOUT
37-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^90dbe9bf60ab3c72be10fd070c65c26dca543ca5'
38-
args:
39-
chdir: "{{ netbox_git_repo_path }}"
40-
executable: /bin/bash
41-
register: _netbox_git_contains_rq_timeout
42-
changed_when: False
43-
failed_when: "_netbox_git_contains_rq_timeout.rc not in [0, 1]"
38+
- name: Check existence of commit 90dbe9b, renaming DEFAULT_TIMEOUT to RQ_DEFAULT_TIMEOUT
39+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^90dbe9bf60ab3c72be10fd070c65c26dca543ca5'
40+
args:
41+
chdir: "{{ netbox_git_repo_path }}"
42+
executable: /bin/bash
43+
register: _netbox_git_contains_rq_timeout
44+
changed_when: False
45+
failed_when: "_netbox_git_contains_rq_timeout.rc not in [0, 1]"
4446

45-
- name: Check existence of commit f560693, introducing trace_paths management command
46-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^f560693748d1f35e79ad9d006a8a9b75ef5ae37b'
47-
args:
48-
chdir: "{{ netbox_git_repo_path }}"
49-
executable: /bin/bash
50-
register: _netbox_git_contains_trace_paths
51-
changed_when: False
52-
failed_when: "_netbox_git_contains_trace_paths.rc not in [0, 1]"
47+
- name: Check existence of commit f560693, introducing trace_paths management command
48+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^f560693748d1f35e79ad9d006a8a9b75ef5ae37b'
49+
args:
50+
chdir: "{{ netbox_git_repo_path }}"
51+
executable: /bin/bash
52+
register: _netbox_git_contains_trace_paths
53+
changed_when: False
54+
failed_when: "_netbox_git_contains_trace_paths.rc not in [0, 1]"
5355

54-
- name: Check existence of commit e165dca, introducing mkdocs command during update
55-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^7058d6ca5ae2901383874bcea5fedad31e165dca'
56-
args:
57-
chdir: "{{ netbox_git_repo_path }}"
58-
executable: /bin/bash
59-
register: _netbox_git_contains_mkdocs
60-
changed_when: False
61-
failed_when: "_netbox_git_contains_mkdocs.rc not in [0, 1]"
56+
- name: Check existence of commit e165dca, introducing mkdocs command during update
57+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^7058d6ca5ae2901383874bcea5fedad31e165dca'
58+
args:
59+
chdir: "{{ netbox_git_repo_path }}"
60+
executable: /bin/bash
61+
register: _netbox_git_contains_mkdocs
62+
changed_when: False
63+
failed_when: "_netbox_git_contains_mkdocs.rc not in [0, 1]"
6264

63-
- name: Check existence of commit d87ec82, introducing nightly housekeeping command
64-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^d87ec82fe34d92a84ee6f2a97ba0a87a53eed015'
65-
args:
66-
chdir: "{{ netbox_git_repo_path }}"
67-
executable: /bin/bash
68-
register: _netbox_git_contains_housekeeping
69-
changed_when: False
70-
failed_when: "_netbox_git_contains_housekeeping.rc not in [0, 1]"
65+
- name: Check existence of commit d87ec82, introducing nightly housekeeping command
66+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^d87ec82fe34d92a84ee6f2a97ba0a87a53eed015'
67+
args:
68+
chdir: "{{ netbox_git_repo_path }}"
69+
executable: /bin/bash
70+
register: _netbox_git_contains_housekeeping
71+
changed_when: False
72+
failed_when: "_netbox_git_contains_housekeeping.rc not in [0, 1]"
7173

72-
- name: Check existence of commit 028c876, removing the invalidate command
73-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^028c876bcafbaede2731f191512bbebe3f1b6a9e'
74-
args:
75-
chdir: "{{ netbox_git_repo_path }}"
76-
executable: /bin/bash
77-
register: _netbox_git_contains_invalidate_removed
78-
changed_when: False
79-
failed_when: "_netbox_git_contains_invalidate_removed.rc not in [0, 1]"
74+
- name: Check existence of commit 028c876, removing the invalidate command
75+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^028c876bcafbaede2731f191512bbebe3f1b6a9e'
76+
args:
77+
chdir: "{{ netbox_git_repo_path }}"
78+
executable: /bin/bash
79+
register: _netbox_git_contains_invalidate_removed
80+
changed_when: False
81+
failed_when: "_netbox_git_contains_invalidate_removed.rc not in [0, 1]"
8082

81-
- name: Check existence of commit b172ae6, adding the clearcache command
82-
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^b172ae65d24f6dc161c4b609477a4547bb62a50b'
83-
args:
84-
chdir: "{{ netbox_git_repo_path }}"
85-
executable: /bin/bash
86-
register: _netbox_git_contains_add_clearcache
87-
changed_when: False
88-
failed_when: "_netbox_git_contains_add_clearcache.rc not in [0, 1]"
83+
- name: Check existence of commit b172ae6, adding the clearcache command
84+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^b172ae65d24f6dc161c4b609477a4547bb62a50b'
85+
args:
86+
chdir: "{{ netbox_git_repo_path }}"
87+
executable: /bin/bash
88+
register: _netbox_git_contains_add_clearcache
89+
changed_when: False
90+
failed_when: "_netbox_git_contains_add_clearcache.rc not in [0, 1]"
91+
92+
become: true
93+
become_user: "{{ netbox_user }}"
8994

9095
- name: Archive and extract snapshot of git repository
9196
shell: 'set -o pipefail; git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'

0 commit comments

Comments
 (0)