Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 3 additions & 143 deletions misc/install-test-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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.
# Currently only Fedora, CentOS and Debian/Ubuntu are supported by this playbook.

---
- hosts: all
Expand All @@ -11,145 +11,5 @@
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:
- libfdisk-devel
- keyutils-libs-devel
- libnvme-devel
- e2fsprogs-devel
- json-glib-devel
- libatasmart-devel
- libyaml-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
- kernel-modules-extra
- lvm2-dbusd
- mdadm
- ndctl
- nilfs-utils
- nss-tools
- ntfsprogs
- nvme-cli
- nvmetcli
- python3-bytesize
- python3-dbus
- python3-packaging
- python3-pylint
- python3-yaml
- smartmontools
- targetcli
- udftools
- vdo
- volume_key
- xfsprogs
when: ansible_distribution == 'Fedora' 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' and ansible_distribution_major_version < '24')

- name: Add source repositories (Debian/Ubuntu)
shell: "sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version >= '24'

- 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:
- libfdisk-dev
- libkeyutils-dev
- libext2fs-dev
- libjson-glib-dev
- libatasmart-dev
- libyaml-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
- smartmontools
- targetcli-fb
- udftools
- vdo
- 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
- name: Include tasks from libblockdev-tasks.yml
ansible.builtin.include_tasks: libblockdev-tasks.yml
208 changes: 208 additions & 0 deletions misc/libblockdev-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
# ansible tasks for installing libblockdev dependencies,
# see install-test-dependencies.yml for usage

---
####### 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:
- libfdisk-devel
- keyutils-libs-devel
- libnvme-devel
- e2fsprogs-devel
- json-glib-devel
- libatasmart-devel
- libyaml-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
- kernel-modules-extra
- lvm2-dbusd
- mdadm
- ndctl
- nilfs-utils
- nss-tools
- ntfsprogs
- nvme-cli
- nvmetcli
- python3-bytesize
- python3-dbus
- python3-packaging
- python3-pylint
- python3-yaml
- smartmontools
- targetcli
- udftools
- vdo
- volume_key
- xfsprogs
when: ansible_distribution == 'Fedora' and test_dependencies|bool

####### CentOS
- name: Install basic build tools (CentOS)
package: name={{item}} state=present
with_items:
- gcc
- make
- libtool
- autoconf
- automake
when: ansible_distribution == 'CentOS'

- name: Install dnf-plugins-core for dnf builddep (CentOS)
package: name=dnf-plugins-core state=present
when: ansible_distribution == 'CentOS'

- name: Install build dependencies (CentOS)
command: "dnf -y builddep libblockdev --nogpgcheck"
when: ansible_distribution == 'CentOS'

- name: Install build dependencies not covered by dnf builddep (CentOS)
package: name={{item}} state=present
with_items:
- libfdisk-devel
- keyutils-libs-devel
- libnvme-devel
- e2fsprogs-devel
- json-glib-devel
- libatasmart-devel
- libyaml-devel
when: ansible_distribution == 'CentOS'

- name: Install test dependencies (CentOS)
package: name={{item}} state=present
with_items:
- cryptsetup
- device-mapper-multipath
- dosfstools
- e2fsprogs
- glibc-all-langpacks
- lvm2-dbusd
- mdadm
- ndctl
- nss-tools
- nvme-cli
- nvmetcli
- python3-bytesize
- python3-dbus
- python3-packaging
- python3-yaml
- smartmontools
- targetcli
- vdo
- volume_key
- xfsprogs
when: ansible_distribution == 'CentOS' and test_dependencies|bool

- name: Install pylint using pip (CentOS)
pip:
name: ['pylint']
extra_args: --break-system-packages
when: ansible_distribution == 'CentOS' 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' and ansible_distribution_major_version < '24')

- name: Add source repositories (Debian/Ubuntu)
shell: "sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version >= '24'

- 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:
- libfdisk-dev
- libkeyutils-dev
- libext2fs-dev
- libjson-glib-dev
- libatasmart-dev
- libyaml-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
- smartmontools
- targetcli-fb
- udftools
- vdo
- 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
9 changes: 6 additions & 3 deletions plans/blivet.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ prepare:
- sudo dnf -y update

- name: ansible
how: ansible
playbook:
- https://raw.githubusercontent.com/storaged-project/blivet/master/misc/install-test-dependencies.yml
how: shell
script:
- sudo dnf install -y curl ansible
- curl -Ok https://raw.githubusercontent.com/storaged-project/blivet/main/misc/install-test-dependencies.yml
- curl -Ok https://raw.githubusercontent.com/storaged-project/blivet/main/misc/blivet-tasks.yml
- ansible-playbook -K -i "localhost," -c local install-test-dependencies.yml

discover:
how: shell
Expand Down