From d953a2fa6bc9a3303f593ecd7e808497a2430939 Mon Sep 17 00:00:00 2001 From: Jens Heinitz Date: Thu, 10 Jun 2021 16:12:09 +0200 Subject: [PATCH] removed duplicate playbooks --- reboot.yml | 27 --------------------------- reboot_required.yml | 39 --------------------------------------- test.txt | 1 - 3 files changed, 67 deletions(-) delete mode 100644 reboot.yml delete mode 100644 reboot_required.yml delete mode 100644 test.txt diff --git a/reboot.yml b/reboot.yml deleted file mode 100644 index a7995c3..0000000 --- a/reboot.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Reboot host - hosts: all - remote_user: root - tasks: - - name: reboot host - shell: 'sleep 5 && shutdown -r now "Reboot by Ansible."' - register: reboot - async: 1 - poll: 0 - ignore_errors: true - - - name: wait for server to come down - local_action: wait_for host={{ inventory_hostname }} port=22 state=stopped - - - name: wait for server to come up - local_action: wait_for host={{ inventory_hostname }} port=22 state=started - - - name: check uptime - shell: 'uptime' - register: uptime - - - name: show uptime - debug: - msg: "Uptime: {{ uptime.stdout }}" -... - diff --git a/reboot_required.yml b/reboot_required.yml deleted file mode 100644 index 72d6ea6..0000000 --- a/reboot_required.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: Reboot host - hosts: all - remote_user: root - tasks: - - name: check if reboot is required - stat: - path: /lib/modules/{{ ansible_kernel }} - register: modules - - - name: reboot host - shell: 'sleep 5 && shutdown -r now "Reboot by Ansible."' - register: reboot - async: 1 - poll: 0 - ignore_errors: true - when: modules.stat.isdir is not defined - - - name: wait for server to come down - local_action: wait_for host={{ inventory_hostname }} port=22 state=stopped - when: - - reboot.stdout is defined - - "'Reboot by Ansible.' in reboot.stdout" - - - name: wait for server to come up - local_action: wait_for host={{ inventory_hostname }} port=22 state=started - when: - - reboot.stdout is defined - - "'Reboot by Ansible.' in reboot.stdout" - - - name: check uptime - shell: 'uptime' - register: uptime - - - name: show uptime - debug: - msg: "Uptime: {{ uptime.stdout }}" -... - diff --git a/test.txt b/test.txt deleted file mode 100644 index 6de7b8c..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test file.