diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-07-05 16:22:58 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-07-05 16:22:58 +0200 |
commit | 0b3d99f96dabb1aa2fbf7f99559852916a97d610 (patch) | |
tree | b56e453cf5182a24c6878c23f5985781928d1e57 /roles/cuda/handlers | |
parent | 5416f8599ffa92b69bb87434dc1175d760760bbe (diff) | |
parent | 813756495d5ef33fa3cc95d69b6d88418ebe7bb1 (diff) | |
download | itm-0b3d99f96dabb1aa2fbf7f99559852916a97d610.tar.gz itm-0b3d99f96dabb1aa2fbf7f99559852916a97d610.tar.bz2 itm-0b3d99f96dabb1aa2fbf7f99559852916a97d610.tar.xz itm-0b3d99f96dabb1aa2fbf7f99559852916a97d610.zip |
Merge commit '813756495d5ef33fa3cc95d69b6d88418ebe7bb1' as 'roles/cuda'
Diffstat (limited to 'roles/cuda/handlers')
-rw-r--r-- | roles/cuda/handlers/main.yml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/roles/cuda/handlers/main.yml b/roles/cuda/handlers/main.yml new file mode 100644 index 0000000..adba3b7 --- /dev/null +++ b/roles/cuda/handlers/main.yml @@ -0,0 +1,43 @@ +--- +# handlers file for ansible-role-cuda +- name: reload systemd unit files + shell: systemctl daemon-reload + +- name: Initialize the GPUs + command: /bin/bash /usr/local/bin/cuda_init.sh + when: + - cuda_init + - cuda_init_restart_service + +- name: Restart cuda_init service + service: + name: cuda_init + state: restarted + when: + - cuda_init + - cuda_init_restart_service + - ansible_service_mgr == "systemd" + +- name: ZZ CUDA Restart server + command: sleep 2 && /sbin/shutdown -r now "Node software upgrade reboot" + async: 1 + poll: 0 + ignore_errors: true + when: + - cuda_packages_installation.changed + - cuda_restart_node_on_install + +# define the variable running_as_ansible_pull in the ansible-pull playbook, like local.yml +- name: ZZ CUDA Wait for server to restart + wait_for: + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + state: started + delay: 30 + timeout: 300 + connection: local + become: false + when: + - cuda_restart_node_on_install + - (running_as_ansible_pull is not defined or running_as_ansible_pull == False) + +# vim:ft=ansible: |