You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/filesystem/tasks/setup.yml

94 lines
2.7 KiB
YAML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

- name: install filesystem tools
package:
name: '{{ item }}'
state: present
with_items:
- e2fsprogs
- xfsprogs
- block:
- name: install btrfs progs
package:
name: btrfs-progs
state: present
when:
- ansible_os_family != 'Suse'
- not (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('16.04', '<='))
- ansible_system != "FreeBSD"
- name: install btrfs progs (Ubuntu <= 16.04)
package:
name: btrfs-tools
state: present
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('16.04', '<=')
- name: install btrfs progs (OpenSuse)
package:
name: '{{ item }}'
state: present
when: ansible_os_family == 'Suse'
with_items:
- python-xml
- btrfsprogs
- name: install ocfs2 (Debian)
package:
name: ocfs2-tools
state: present
when: ansible_os_family == 'Debian'
- when:
- ansible_os_family != 'RedHat' or ansible_distribution == 'Fedora'
- ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('16.04', '>=')
- ansible_system != "FreeBSD"
block:
- name: install f2fs
package:
name: f2fs-tools
state: present
- name: fetch f2fs version
command: mkfs.f2fs /dev/null
ignore_errors: yes
register: mkfs_f2fs
- set_fact:
f2fs_version: '{{ mkfs_f2fs.stdout | regex_search("F2FS-tools: mkfs.f2fs Ver:.*") | regex_replace("F2FS-tools: mkfs.f2fs Ver: ([0-9.]+) .*", "\1") }}'
- name: install dosfstools and lvm2 (Linux)
package:
name: '{{ item }}'
with_items:
- dosfstools
- lvm2
when: ansible_system == 'Linux'
- block:
- name: install fatresize
package:
name: fatresize
state: present
- command: fatresize --help
register: fatresize
- set_fact:
fatresize_version: '{{ fatresize.stdout_lines[0] | regex_search("[0-9]+\.[0-9]+\.[0-9]+") }}'
when:
- ansible_system == 'Linux'
- ansible_os_family != 'Suse'
- ansible_os_family != 'RedHat' or (ansible_distribution == 'CentOS' and ansible_distribution_version is version('7.0', '>='))
- command: mke2fs -V
register: mke2fs
- set_fact:
# mke2fs 1.43.6 (29-Aug-2017)
e2fsprogs_version: '{{ mke2fs.stderr_lines[0] | regex_search("[0-9]{1,2}\.[0-9]{1,2}(\.[0-9]{1,2})?") }}'
- set_fact:
# http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.43
# Mke2fs no longer complains if the user tries to create a file system
# using the entire block device.
force_creation: "{{ e2fsprogs_version is version('1.43', '<') }}"
# Earlier versions have a segfault bug
resize_vfat: "{{ fatresize_version|default('0.0') is version('1.0.4', '>=') }}"