--- - name: Create munge key # https://github.com/dun/munge/wiki/Installation-Guide when: PrimaryController|bool shell: | set -xe mkdir -p {{SlurmConfigDir}} # If MungeKeySsmParameter is set and the parameter already exists then get the munge key and use it. # Otherwise, create a new key and save it in the parameter if [[ ":{{MungeKeySsmParameter}}" != ":" ]] && aws ssm get-parameter --name {{MungeKeySsmParameter}} &> /dev/null; then aws ssm get-parameter --name {{MungeKeySsmParameter}} --query 'Parameter.Value' --output text | base64 -d > {{SlurmConfigDir}}/munge.key else # Create a new munge key dd if=/dev/random bs=1 count=1024 > {{SlurmConfigDir}}/munge.key chmod 0400 {{SlurmConfigDir}}/munge.key if [[ ":{{MungeKeySsmParameter}}" != ":" ]]; then # Save the new key in SSM Parameter Store value=$(base64 -w 0 {{SlurmConfigDir}}/munge.key) aws ssm put-parameter --name {{MungeKeySsmParameter}} --description 'Munge key to be shared by SLURM clusters' --type String --value $value fi fi - name: Create {{SlurmAnsibleDir}} when: PrimaryController|bool file: path: "{{SlurmAnsibleDir}}" state: directory owner: root group: root mode: 0755 - name: rsync playbooks to file system when: PrimaryController|bool shell: cmd: | set -ex rsync -av /root/playbooks/ {{SlurmAnsibleDir}}/playbooks rsync -av /root/ansible_extra_vars.yml {{SlurmAnsibleDir}}/ - { include: packages.yml, tags: packages } - { include: rc_local.yml, tags: rc_local } - { include: networking.yml, tags: networking } - { include: user_slurm.yml, tags: users } - { include: slurm_directories.yml, tags: slurm_directories } - { include: slurm_scripts.yml, tags: slurm_scripts } - { include: slurmrestd.yml, tags: slurmrestd } - { include: slurm_accounting.yml, tags: slurm_accounting } - { include: munge.yml, tags: munge } - { include: slurm_modulefiles.yml, tags: slurm_modulefiles } - { include: crontab.yml, tags: crontab } - { include: slurm_configuration.yml, tags: slurm_configuration }