github.com/jlmeeker/kismatic@v1.10.1-0.20180612190640-57f9005a1f1a/ansible/roles/preflight/tasks/direct_lvm_preflight.yaml (about)

     1  ---
     2    - name: stat the block device path
     3      stat:
     4        path: "{{ docker.storage.direct_lvm_block_device.path }}"
     5      register: block_device_stat
     6    - name: fail if the block device does not exists
     7      fail:
     8        msg: "Block device specified for docker storage does not exist."
     9      when: block_device_stat.stat.exists == False
    10    - name: fail if the provided path is not a block device
    11      fail:
    12        msg: "{{ docker.storage.direct_lvm_block_device.path }} is not a block device."
    13      when: block_device_stat.stat.isblk == False
    14    - name: fail if the block device is already mounted
    15      fail:
    16        msg: "Block deviced specified for docker storage is currently mounted. This should be an unmounted, unused device"
    17      with_items: "{{ ansible_mounts }}"
    18      when: item.device == "{{ docker.storage.direct_lvm_block_device.path }}"