---

- name: install packages
  apt:
    force_apt_get: true
    install_recommends: false
    name: "{{ ocfs2_packages }}"

- name: configure cluster
  notify: restart o2cb
  template:
    src: cluster.conf.j2
    dest: /etc/ocfs2/cluster.conf

- name: load at boot
  notify: restart o2cb
  replace:
    path: /etc/default/o2cb
    regexp: '^O2CB_ENABLED=.*$'
    replace: 'O2CB_ENABLED=true'
    backup: true

- meta: flush_handlers

- name: format mapped device
  when: inventory_hostname == play_hosts[0]
  filesystem:
    fstype: ocfs2
    opts: -T mail -Jblock64
    dev: /dev/rbd0

- name: mount mapped device
  mount:
    path: "{{ ocfs2_mount_path }}"
    src: "{{ ocfs2_mount_device }}"
    fstype: ocfs2
    opts: _netdev,nointr,noatime
    backup: true
    state: mounted

# FIREWALL

- name: firewall
  when: ocfs2_firewall_enabled
  vars:
    ferm_rules_filename: "{{ ocfs2_ferm_rules_filename }}"
    ferm_input_rules: "{{ ocfs2_ferm_input_rules }}"
    ferm_output_rules: "{{ ocfs2_ferm_output_rules }}"
    ferm_global_settings: "{{ ocfs2_ferm_global_settings }}"
  include_role:
    name: ferm-configure

...
