forked from lae/ansible-role-netbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_via_git.yml
90 lines (81 loc) · 3.44 KB
/
install_via_git.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
- name: Clone specified NetBox git repository
git:
repo: "{{ netbox_git_uri }}"
dest: "{{ netbox_git_repo_path }}"
version: "{{ netbox_git_version }}"
register: _netbox_git_repo
become: true
become_user: "{{ netbox_user }}"
- name: Create git deployment directory for NetBox
file:
path: "{{ netbox_git_deploy_path }}"
owner: "{{ netbox_user }}"
group: "{{ netbox_group }}"
state: directory
- name: Check existence of commit 1fb67b7, fixing issue netbox#2239
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^1fb67b791f1a91c624dae4a1cd256e4cf3ddbb77'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_issue_2239_fix
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: Check existence of commit 90dbe9b, renaming DEFAULT_TIMEOUT to RQ_DEFAULT_TIMEOUT
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^90dbe9bf60ab3c72be10fd070c65c26dca543ca5'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_rq_timeout
changed_when: False
failed_when: "_netbox_git_contains_rq_timeout.rc not in [0, 1]"
- name: Check existence of commit f560693, introducing trace_paths management command
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^f560693748d1f35e79ad9d006a8a9b75ef5ae37b'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_trace_paths
changed_when: False
failed_when: "_netbox_git_contains_trace_paths.rc not in [0, 1]"
- name: Check existence of commit d87ec82, introducing nightly housekeeping command
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^d87ec82fe34d92a84ee6f2a97ba0a87a53eed015'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_housekeeping
changed_when: False
failed_when: "_netbox_git_contains_housekeeping.rc not in [0, 1]"
- name: Check existence of commit 028c876, removing the invalidate command
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^028c876bcafbaede2731f191512bbebe3f1b6a9e'
args:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
register: _netbox_git_contains_invalidate_removed
changed_when: False
failed_when: "_netbox_git_contains_invalidate_removed.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:
chdir: "{{ netbox_git_repo_path }}"
executable: /bin/bash
notify:
- reload netbox.service
when:
- _netbox_git_repo is changed
become: true
become_user: "{{ netbox_user }}"
- name: Symlink git repository to current NetBox directory
file:
src: "{{ netbox_git_deploy_path }}"
dest: "{{ netbox_current_path }}"
owner: "{{ netbox_user }}"
group: "{{ netbox_group }}"
state: link