---
- hosts: kv:index:n1ql
  tasks:
  - name: umounting data parition
    mount:
      name: /data
      state: unmounted
      src: /dev/sdb1
      fstype: ext4
  - name: re-creating filesystem
    filesystem:
      fstype: ext4
      dev: /dev/sdb1
  - name: mounting data parition
    mount:
      name: /data
      state: mounted
      src: /dev/sdb1
      fstype: ext4
  - name: discarding unused blocks
    shell: fstrim -v /data
  - name: ensuring ownership of "/data" directory
    file: path=/data  owner=couchbase group=couchbase

---
- hosts: kv:index:n1ql
  tasks:
  - name: umounting data parition
    mount:
      name: /data
      state: unmounted
      src: /dev/sdb1
      fstype: ext4
  - name: re-creating filesystem
    filesystem:
      fstype: ext4
      dev: /dev/sdb1
      force: yes
  - name: mounting data parition
    mount:
      name: /data
      state: mounted
      src: /dev/sdb1
      fstype: ext4
  - name: discarding unused blocks
    shell: fstrim -v /data
  - name: ensuring ownership of "/data" directory
    file: path=/data  owner=couchbase group=couchbase

Create new filesystem on devices that already has filesystem.
Create new filesystem on devices that already has filesystem.

Change-Id: I3c36fa33ca1d436f3481e896e0ce16f970b911eb
Reviewed-on: http://review.couchbase.org/70121
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com>
