add initial vm installer role
[noc.git] / ansible / roles / reboot-and-wait / tasks / main.yml
diff --git a/ansible/roles/reboot-and-wait/tasks/main.yml b/ansible/roles/reboot-and-wait/tasks/main.yml
new file mode 100644 (file)
index 0000000..e648f0a
--- /dev/null
@@ -0,0 +1,10 @@
+- name: reboot machine
+  shell: sleep 2 && shutdown -r now
+  async: 1
+  poll: 0
+  ignore_errors: true
+
+- name: waiting for host to come back
+  wait_for_connection:
+    delay: "{{ reboot_delay }}"
+    timeout: "{{ reboot_timeout }}"