From cb159a13033674e930a22ab121ef8a5ac1e49bf7 Mon Sep 17 00:00:00 2001 From: Yerlan Sergaziyev Date: Wed, 17 Apr 2024 17:42:08 +0200 Subject: [PATCH] ansible --- ansible_puppet/commands.txt | 9 +++++++++ ansible_puppet/reboot_hosts.yaml | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 ansible_puppet/commands.txt create mode 100644 ansible_puppet/reboot_hosts.yaml diff --git a/ansible_puppet/commands.txt b/ansible_puppet/commands.txt new file mode 100644 index 0000000..70c3161 --- /dev/null +++ b/ansible_puppet/commands.txt @@ -0,0 +1,9 @@ +List repositories +apt-cache policy | grep http + +OpenSSL +Check that key matches certificate +openssl rsa -modulus -noout -in myserver.{key,crt} | openssl md5 + +Check certificate information +echo | openssl s_client -showcerts -connect localhost:443 2>/dev/null | openssl x509 -inform pem -noout -text | head -n 13 diff --git a/ansible_puppet/reboot_hosts.yaml b/ansible_puppet/reboot_hosts.yaml new file mode 100644 index 0000000..e9378a3 --- /dev/null +++ b/ansible_puppet/reboot_hosts.yaml @@ -0,0 +1,17 @@ +# ansible-playbook -i hosts.txt -K reboot_hosts.yaml +- name: Reboot servers one by one + hosts: all + serial: 1 + # become: true + # become_method: sudo + any_errors_fatal: true + tasks: + # - name: Reboot + # ansible.builtin.reboot: + # reboot_timeout: 1200 + - name: Check if service is running + ansible.builtin.command: + cmd: systemctl status + - name: Pause + pause: + minutes: 30