From 00e4043bcad5ae79c9422040be79fbbff9ca08f8 Mon Sep 17 00:00:00 2001 From: Sebastian Haderecker Date: Wed, 10 Apr 2019 10:47:07 +0000 Subject: [PATCH] Added Reboot Playbook --- cloud/ansible/reboot.yaml | 11 +++++++++++ cloud/ansible/roles/reboot/tasks/main.yaml | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 cloud/ansible/reboot.yaml create mode 100644 cloud/ansible/roles/reboot/tasks/main.yaml diff --git a/cloud/ansible/reboot.yaml b/cloud/ansible/reboot.yaml new file mode 100644 index 00000000..883e2a43 --- /dev/null +++ b/cloud/ansible/reboot.yaml @@ -0,0 +1,11 @@ +# This playbook reboots a T-Pot + +- hosts: TPOT + remote_user: linux + become: yes + become_user: root + become_method: sudo + gather_facts: no + + roles: + - reboot diff --git a/cloud/ansible/roles/reboot/tasks/main.yaml b/cloud/ansible/roles/reboot/tasks/main.yaml new file mode 100644 index 00000000..f58c86a1 --- /dev/null +++ b/cloud/ansible/roles/reboot/tasks/main.yaml @@ -0,0 +1,10 @@ +- name: Waiting for SSH connection + wait_for_connection: + timeout: 300 + +- name: Gathering Facts + setup: + +- name: Finally rebooting t-pot in one minute - make sure your next login is on port 64295 or via https:// on port 64297 + shell: /sbin/shutdown -r -t 1 + become: true