diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..ecd6a21 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1 @@ +filesystems_state: mounted diff --git a/tasks/main.yml b/tasks/main.yml index 928a7fd..5170d5b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,9 +1,6 @@ --- -- setup: - gather_subset: "!all" - -- name: install btrfsutils +- name: install btrfs-tools apt: pkg: btrfs-tools state: installed @@ -22,7 +19,7 @@ filesystem: fstype: "{{ item.fstype }}" dev: "{{ item.device }}" - opts: "-U {{ item.uuid }}" + opts: -U {{ item.uuid }} force: "{{ filesystems_state == 'formated' }}" with_items: "{{ filesystems }}" when: @@ -35,8 +32,9 @@ name: "{{ root_target_directory | default('') }}/{{ item.mount_point }}" src: "UUID={{ item.uuid }}" fstype: "{{ item.fstype }}" + opts: '{{ item.mount_options | default("defaults") }}' state: mounted with_items: "{{ filesystems }}" when: filesystems_state == "mounted" or - filesystems_state == "formated" \ No newline at end of file + filesystems_state == "formated"