2018-01-11 17:10:14 +01:00
|
|
|
|
- name: install filesystem tools
|
|
|
|
|
package:
|
|
|
|
|
name: '{{ item }}'
|
|
|
|
|
state: present
|
2019-02-21 23:15:12 +01:00
|
|
|
|
# xfsprogs on OpenSUSE requires Python 3, skip this for our newer Py2 OpenSUSE builds
|
|
|
|
|
when: not (item == 'xfsprogs' and ansible_os_family == 'Suse' and ansible_python.version.major == 2 and ansible_distribution_major_version|int != 42)
|
2018-01-11 17:10:14 +01:00
|
|
|
|
with_items:
|
|
|
|
|
- e2fsprogs
|
|
|
|
|
- xfsprogs
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: install btrfs progs
|
|
|
|
|
package:
|
|
|
|
|
name: btrfs-progs
|
|
|
|
|
state: present
|
2018-06-21 10:24:28 +02:00
|
|
|
|
when:
|
|
|
|
|
- ansible_os_family != 'Suse'
|
|
|
|
|
- not (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('16.04', '<='))
|
|
|
|
|
- ansible_system != "FreeBSD"
|
2018-11-20 21:50:04 +01:00
|
|
|
|
- not (ansible_distribution == "RedHat" and ansible_distribution_major_version|int >= 8)
|
2018-01-11 17:10:14 +01:00
|
|
|
|
|
|
|
|
|
- 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:
|
2019-02-21 23:15:12 +01:00
|
|
|
|
- python{{ ansible_python.version.major }}-xml
|
2018-01-11 17:10:14 +01:00
|
|
|
|
- btrfsprogs
|
2018-01-31 15:32:18 +01:00
|
|
|
|
|
2018-03-30 08:42:02 +02:00
|
|
|
|
- name: install ocfs2 (Debian)
|
2018-01-31 15:32:18 +01:00
|
|
|
|
package:
|
|
|
|
|
name: ocfs2-tools
|
|
|
|
|
state: present
|
2018-03-30 08:42:02 +02:00
|
|
|
|
when: ansible_os_family == 'Debian'
|
2018-05-21 17:13:26 +02:00
|
|
|
|
|
|
|
|
|
- when:
|
|
|
|
|
- ansible_os_family != 'RedHat' or ansible_distribution == 'Fedora'
|
|
|
|
|
- ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('16.04', '>=')
|
2018-06-21 10:24:28 +02:00
|
|
|
|
- ansible_system != "FreeBSD"
|
2018-05-21 17:13:26 +02:00
|
|
|
|
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") }}'
|
|
|
|
|
|
2018-06-21 10:24:28 +02:00
|
|
|
|
- name: install dosfstools and lvm2 (Linux)
|
|
|
|
|
package:
|
|
|
|
|
name: '{{ item }}'
|
|
|
|
|
with_items:
|
|
|
|
|
- dosfstools
|
|
|
|
|
- lvm2
|
|
|
|
|
when: ansible_system == 'Linux'
|
2018-01-11 17:10:14 +01:00
|
|
|
|
|
2018-02-06 11:56:43 +01:00
|
|
|
|
- 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', '>='))
|
|
|
|
|
|
2018-01-11 17:10:14 +01:00
|
|
|
|
- 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', '<') }}"
|
2018-02-06 11:56:43 +01:00
|
|
|
|
# Earlier versions have a segfault bug
|
|
|
|
|
resize_vfat: "{{ fatresize_version|default('0.0') is version('1.0.4', '>=') }}"
|