---
- name: Create filesystem for /var/lib/origin/openshift.local.volumes
  filesystem:
    fstype: "{{ local_volumes_fstype }}"
    dev: "{{ local_volumes_device }}"

- name: Create local volumes directory
  file:
    path: "{{ local_volumes_path }}"
    state: directory
    recurse: yes

- name: Create fstab entry
  mount:
    name: "{{ local_volumes_path }}"
    src: "{{ local_volumes_device }}"
    fstype: "{{ local_volumes_fstype }}"
    opts: "{{ local_volumes_fsopts }}"
    state: present

- name: Mount fstab entry
  mount:
    name: "{{ local_volumes_path }}"
    src: "{{ local_volumes_device }}"
    fstype: "{{ local_volumes_fstype }}"
    opts: "{{ local_volumes_fsopts }}"
    state: mounted
