
- hosts: 'DesktopNodes,ComputeNodes,LoginNodes,VisNodes'
  vars_files: 
  - vars/passwords.yml 
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml 
  - vars/slurm.yml 
  - vars/vars.yml 
  tasks:
  - { name: set use shared state, set_fact: usesharedstatedir=False }
  tags: [ always ]

- hosts: 'DesktopNodes,ComputeNodes,LoginNodes'
  vars_files: 
  - vars/passwords.yml 
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml 
  - vars/slurm.yml 
  - vars/vars.yml 
  strategy: free
  roles:
  - { role: move_homedir, tags: [ authentication, filesystems ] }
  - { role: nfs-client, nfsMounts: "{{ computeNfsMounts }}", tags: [ filesystems ] }
  - { role: slurm-common, tags: [ slurm, slurm-common ] }
  - { role: lmod, tags: [ other ] }
  - { role: enable_modules, default_modules: "lmod", tags: [ other ] }
  - { role: postfix, tags: [ mail, other ] }

- hosts: 'VisNodes'
  vars_files:
  - vars/passwords.yml
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml
  - vars/slurm.yml
  - vars/vars.yml
  roles:
  - { role: gpu, tags: [ gpu ] }

- hosts: 'DesktopNodes,ComputeNodes,LoginNodes'
  vars_files:
  - vars/passwords.yml
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml
  - vars/slurm.yml
  - vars/vars.yml
  roles:
  - { role: slurm_config, tags: [slurm, slurm_config] }

- hosts: 'DesktopNodes,ComputeNodes'
  vars_files:
  - vars/passwords.yml
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml
  - vars/slurm.yml
  - vars/vars.yml
  strategy: free
  roles:
  - { role: slurm-start, start_slurmd: True, tags: [ slurm, slurmstart ] }
  - { role: mate-de-install, tags: [ mate-de-install ] }   # TODO this crashes for everything except cmca
