-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathinstall-test-dependencies.yml
More file actions
204 lines (182 loc) · 5.91 KB
/
install-test-dependencies.yml
File metadata and controls
204 lines (182 loc) · 5.91 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# This is a simple ansible playbook for installing packages needed by the
# libblockdev test suite.
# You can do this by using 'make install-requires' or manually using
# 'ansible-playbook -K -i "localhost," -c local install-test-dependencies.yml'
# Currently only Fedora, CentOS 8 and Debian/Ubuntu are supported by this playbook.
---
- hosts: all
become: true
vars:
test_dependencies: true # whether to install test dependencies or not
tasks:
####### Fedora
- name: Install basic build tools (Fedora)
package: name={{item}} state=present
with_items:
- gcc
- make
- libtool
- autoconf
- automake
when: ansible_distribution == 'Fedora'
- name: Install dnf-plugins-core for dnf builddep (Fedora)
package: name=dnf-plugins-core state=present
when: ansible_distribution == 'Fedora'
- name: Install build dependencies (Fedora)
command: "dnf -y builddep libblockdev --nogpgcheck"
when: ansible_distribution == 'Fedora'
- name: Install build dependencies not covered by dnf builddep (Fedora)
package: name={{item}} state=present
with_items:
- btrfs-progs-devel
- libfdisk-devel
- keyutils-libs-devel
- libnvme-devel
- e2fsprogs-devel
when: ansible_distribution == 'Fedora'
- name: Install test dependencies (Fedora)
package: name={{item}} state=present
with_items:
- btrfs-progs
- cryptsetup
- device-mapper-multipath
- dosfstools
- e2fsprogs
- exfatprogs
- f2fs-tools
- glibc-all-langpacks
- lvm2-dbusd
- mdadm
- ndctl
- nilfs-utils
- nss-tools
- ntfsprogs
- nvme-cli
- nvmetcli
- python3-bytesize
- python3-dbus
- python3-packaging
- python3-pylint
- python3-yaml
- targetcli
- udftools
- volume_key
- xfsprogs
when: ansible_distribution == 'Fedora' and test_dependencies|bool
####### CentOS 8
- name: Install basic build tools (CentOS 8)
package: name={{item}} state=present
with_items:
- gcc
- make
- libtool
- autoconf
- automake
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Enable EPEL repository (CentOS 8)
package: name=epel-release state=present
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Enable powertools repository (CentOS 8)
command: yum config-manager --set-enabled powertools
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install dnf-plugins-core for dnf builddep (CentOS 8)
package: name=dnf-plugins-core state=present
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install build dependencies (CentOS 8)
command: "dnf -y builddep libblockdev --nogpgcheck"
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install build dependencies not covered by dnf builddep (CentOS 8)
package: name={{item}} state=present
with_items:
- libfdisk-devel
- keyutils-libs-devel
- e2fsprogs-devel
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install test dependencies (CentOS 8)
package: name={{item}} state=present
with_items:
- cryptsetup
- device-mapper-multipath
- dosfstools
- e2fsprogs
- glibc-all-langpacks
- kmod-kvdo
- lvm2-dbusd
- mdadm
- ndctl
- nss-tools
- ntfsprogs
- nvme-cli
- nvmetcli
- python3-bytesize
- python3-dbus
- python3-packaging
- python3-pylint
- python3-yaml
- targetcli
- vdo
- volume_key
- xfsprogs
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8' and test_dependencies|bool
####### Debian/Ubuntu
- name: Update apt cache (Debian/Ubuntu)
apt:
update_cache: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install basic build tools (Debian/Ubuntu)
package: name={{item}} state=present
with_items:
- gcc
- make
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Add source repositories (Debian/Ubuntu)
shell: "grep '^deb ' /etc/apt/sources.list | perl -pe 's/deb /deb-src /' >> /etc/apt/sources.list"
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Update apt cache (Debian/Ubuntu)
apt:
update_cache: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install build dependencies (Debian/Ubuntu)
apt:
name: libblockdev
state: build-dep
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install build dependencies not covered by apt build-dep (Debian/Ubuntu)
package: name={{item}} state=present
with_items:
- libbtrfsutil-dev
- libfdisk-dev
- libkeyutils-dev
- libext2fs-dev
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install test dependencies (Debian/Ubuntu)
package: name={{item}} state=present
with_items:
- btrfs-progs
- cryptsetup
- dosfstools
- e2fsprogs
- exfatprogs
- f2fs-tools
- libnss3-tools
- locales-all
- lvm2-dbusd
- mdadm
- ndctl
- nilfs-tools
- ntfs-3g
- pylint
- python3-bytesize
- python3-packaging
- python3-pydbus
- python3-yaml
- targetcli-fb
- udftools
- volume-key
- xfsprogs
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' and test_dependencies|bool
####### Common actions
- name: Start LVM DBus service
service: name=lvm2-lvmdbusd state=started
ignore_errors: yes
when: test_dependencies|bool