ansible/test/integration/targets/filesystem/tasks/setup.yml
Pilou e9e316c76b Filesystem: refactor, improvements, add tests (#25519)
* filesystem: list used tools

* filesystem: btrfs and reiserfs don't support resizing

* filesystem: list supported filesystems

use formatting functions and 'filesystem' instead of 'file system'

* filesystem: PEP8

* filesystem: remove useless calls to module.boolean

* filesystem: fail when the requested action isn't implemented

* filesystem: resizefs: list supported FS rather than unsupported

* filesystem: refactor

* filesystem: add integration tests

* filesystem: allow to use image file with 'dev' param

* filesystem: test resizefs (ext2/3/4 filesystems only)

* filesystem: Btrfs, handle older version than v0.20-rc1

* filesystem: use loop keyword (integration tests)

* filesystem: new test, check when another filesystem already exists

* filesystem: add myself as a maintainer

* filesystem: fix tests as filters
2018-01-11 11:10:14 -05:00

45 lines
1.3 KiB
YAML

- name: install filesystem tools
package:
name: '{{ item }}'
state: present
when: ansible_system == 'Linux' or item != 'dosfstools'
with_items:
- e2fsprogs
- xfsprogs
- dosfstools
- block:
- name: install btrfs progs
package:
name: btrfs-progs
state: present
when: ansible_os_family != 'Suse' and not (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('16.04', '<='))
- 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
when: ansible_system == 'Linux'
- 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', '<') }}"