diff --git a/lib/ansible/modules/system/filesystem.py b/lib/ansible/modules/system/filesystem.py index 322279e6db0..0b9b2fb3cf1 100644 --- a/lib/ansible/modules/system/filesystem.py +++ b/lib/ansible/modules/system/filesystem.py @@ -230,6 +230,7 @@ class Btrfs(Filesystem): class Ocfs2(Filesystem): MKFS = 'mkfs.ocfs2' + MKFS_FORCE_FLAGS = '-Fx' class VFAT(Filesystem): diff --git a/test/integration/targets/filesystem/defaults/main.yml b/test/integration/targets/filesystem/defaults/main.yml index 7208c80cfc4..10c27d2a5f0 100644 --- a/test/integration/targets/filesystem/defaults/main.yml +++ b/test/integration/targets/filesystem/defaults/main.yml @@ -12,5 +12,5 @@ tested_filesystems: xfs: {fssize: 20, grow: False} # grow requires a mounted filesystem btrfs: {fssize: 100, grow: False} # grow not implemented vfat: {fssize: 20, grow: True} - ocfs2: {fssize: 20, grow: False} # grow not implemented + ocfs2: {fssize: '{{ ocfs2_fssize }}', grow: False} # grow not implemented # untested: lvm, requires a block device diff --git a/test/integration/targets/filesystem/tasks/main.yml b/test/integration/targets/filesystem/tasks/main.yml index 03003497a98..6493f553542 100644 --- a/test/integration/targets/filesystem/tasks/main.yml +++ b/test/integration/targets/filesystem/tasks/main.yml @@ -4,6 +4,15 @@ msg: '{{ role_path|basename }}' - import_tasks: setup.yml +- include_vars: "{{ lookup('first_found', search) }}" + vars: + search: + files: + - '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml' + - 'default.yml' + paths: + - '../vars/' + - include_tasks: create_fs.yml vars: dev: '{{ ansible_user_dir }}/ansible_testing/img' diff --git a/test/integration/targets/filesystem/vars/Ubuntu-14.04.yml b/test/integration/targets/filesystem/vars/Ubuntu-14.04.yml new file mode 100644 index 00000000000..96a22bc7463 --- /dev/null +++ b/test/integration/targets/filesystem/vars/Ubuntu-14.04.yml @@ -0,0 +1,2 @@ +--- +ocfs2_fssize: 108 diff --git a/test/integration/targets/filesystem/vars/default.yml b/test/integration/targets/filesystem/vars/default.yml new file mode 100644 index 00000000000..85b052d4c23 --- /dev/null +++ b/test/integration/targets/filesystem/vars/default.yml @@ -0,0 +1,2 @@ +--- +ocfs2_fssize: 20