# Basic stuff to make the nodes functionl
# i.e. upgrade operating systems, etc
#

- hosts: 'ManagementNodes'
  vars_files: 
  - vars/passwords.yml 
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml 
  - vars/slurm.yml 
  - vars/vars.yml 
  tasks:
      #  - { name: set hostgroup, set_fact: hostgroup='ManagementNodes' }
  - { name: set use shared state, set_fact: usesharedstatedir=True }
  tags: [ always ]

- hosts: 'ManagementNodes'
  strategy: free
  gather_facts: False
  vars_files: 
  - vars/passwords.yml 
  - vars/names.yml
  - vars/ldapConfig.yml
  - vars/filesystems.yml 
  - vars/slurm.yml 
  - vars/vars.yml 
  roles:
#  - { role: ldapclient, tags: [ authentication ] }
#  - { role: ssh-password-login }
#  - { role: enable_sudo_group }

  - { role: nfs-client, nfsMounts: "{{ mgmtNfsMounts }}", tags: [ nfs ] }
  - { role: slurmdb-config, tags: [ slurm, slurmdb-config ] }
  - { role: slurm-common, tags: [ slurm, slurm-common ]  }
  - { role: slurm_config, tags: [ slurm, slurm-config ] }
  - { role: slurm-start, start_slurmdbd: True, start_slurmctld: True, tags: [ slurm-start ]  }
  - { role: telegraf, tags: [ monitoring, SiteSpecific ] }
#  - { role: provision_slurm, use_active_directory: False, lockpath: "/mnt/home", tags: [ slurm ]  }
#  - { role: provision_homedir, use_active_directory: False, mntpt: "/mnt/home", tags: [ provisioning ] }

