-
Notifications
You must be signed in to change notification settings - Fork 35
HOWTOs
Steve Brasier edited this page Sep 16, 2021
·
31 revisions
Hooks from parent environments don't get run by default as site.yml relies on APPLIANCES_ENVIRONMENT_ROOT
to find them. But you can explicitly run them using :
# environments/child/hooks/pre/yml
- name: Import parent hook
vars:
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
import_playbook: "{{ appliances_environment_root }}/../parent/hooks/pre.yml"
where child
and parent
are the environment names.
-
Create a group
control
containing just the first compute node, and add that group intohpctests
, e.g. inenvironments/<myenv>/inventory/groups
:[control] combined-compute-0 [hpctests:children] control
-
Do NOT create a group
login
(that is for login-only nodes) -
Create a post-hook like this:
- hosts: control become: true tasks: - name: Prevent ansible_user's processes being killed on compute nodes at job completion replace: path: /etc/slurm/slurm.epilog.clean regexp: 'if \[ \$SLURM_UID -lt 100 \] ; then' replace: "if [[ $SLURM_UID -lt 100 || $SLURM_JOB_USER -eq {{ ansible_user }} ]] ; then"