Skip to content
Snippets Groups Projects
mockSlurmData.yml 1.83 KiB
Newer Older
Andreas Hamacher's avatar
Andreas Hamacher committed
---
- hosts: ManagementNodes,LoginNodes,ComputeNodes
  gather_facts: false
  tasks:
  - name: add user hpctest
    user:
      name: hpctest
      shell: /bin/bash
    become: true

- hosts: ManagementNodes
  gather_facts: false
  tasks:
  - name: Create a parent account
    command: ./sacctmgr -i add account parentAccount cluster=cicd Description="Test parent account" Organization="Monash"
    args:
      chdir: '/opt/slurm-latest/bin'
    become: true
    register: result 
    failed_when: result.rc != 0 and result.stdout != " Nothing new added."
    
  - name: Create a project associated with a given parent
    command: ./sacctmgr -i add account testProject parent=parentAccount cluster=cicd Organization="Monash"
    args:
      chdir: '/opt/slurm-latest/bin'
    become: true
    register: result 
    failed_when: result.rc != 0 and result.stdout != " Nothing new added."
    
  - name: Create a user and associate them with a project
    command: ./sacctmgr -i create user hpctest cluster=cicd account=testProject partition=batch
    args:
      chdir: '/opt/slurm-latest/bin'
    become: true 
    register: result 
    failed_when: result.rc != 0 and result.stdout != " Nothing new added."

  - name: restart slurmctld
    service:
      name: slurmctld
      state: restarted
    become: true

  #- name: reconfigure scontrol
  #  command: ./scontrol reconfigure 
  #  args:
  #    chdir: '/opt/slurm-latest/bin'
  #  become: true
  #  become_user: slurm
    
#sudo `which sacctmgr` modify user where name=hpctest set maxjobs=200
##  18  sudo `which sacctmgr` update account hpctest set qos=normal
#   22  sudo `which sacctmgr` update account testProject set qos=normal

- hosts: LoginNodes,ComputeNodes,ManagementNodes
  gather_facts: false
  tasks:
  - name: make sure munge is running
    service:
      name: munge
      state: restarted
    become: true