jprorama / CRI_XCBC

Home of the XSEDE Compatible Basic Cluster
MIT License
2 stars 11 forks source link

build vs deploy - two versions of slurm.conf #222

Open eesaanatluri opened 3 years ago

eesaanatluri commented 3 years ago

Currently we are maintaining slurm template file in two places one during the build phase in https://github.com/jprorama/CRI_XCBC/blob/feat-openstack/roles/ohpc_install/templates/slurm_conf.j2 and the other in https://github.com/jprorama/CRI_XCBC/blob/feat-openstack/roles/ohpc_install_cloud/templates/slurm_conf.j2 .

This would create an issue if we make a change to any vars in /CRI_XCBC/roles/ohpc_install/templates/slurm_conf.j2 they won't take effect as they will be replaced by the vars from /CRI_XCBC/roles/ohpc_install_cloud/templates/slurm_conf.j2.

Also, the second issue with using a template file in the deploy phase is that we are only using it when the condition in the task https://github.com/jprorama/CRI_XCBC/blob/feat-openstack/roles/ohpc_install_cloud/tasks/main.yml#L7 fails for eg. 22e3bc5 changes would only apply in the case of failure of above mentioned condition.

I think it should be an in-place line in file kind of change rather than a template substitution for updating runtime controller and slurmdbd host in slurm.conf

diedpigs commented 3 years ago

I feel line in file replacement makes more sense here.

Here's another approach, sharing files across different roles. https://stackoverflow.com/questions/34287465/ansible-shared-files-between-roles