---
- name: install packages
  only_if: $is_centos
  action: yum pkg=$item state=latest
  with_items:
    - maui

- name: Ensure /var/spool/maui/log directory exists
  action: file path=/var/spool/maui/log state=directory

- name: Ensure MAUI is running
  only_if: $is_centos
  action: service name=$item state=started
  with_items:
    - maui

- name: Check maui configuration
  action: template src=pbs+maui/templates/var/spool/maui/maui.cfg.j2 dest=/var/spool/maui/maui.cfg
  notify: restart maui