Skip to content

Instantly share code, notes, and snippets.

View sharanpeetani's full-sized avatar
🏠
Working from home

$h@R@n sharanpeetani

🏠
Working from home
View GitHub Profile
Sun Feb 7 18:57:19 UTC 2021
@sharanpeetani
sharanpeetani / os_update_docker.yml
Last active May 27, 2021 14:58
sample playbook to update os and install docker
---
- name: OS update and install docker
hosts: localhost
become: yes
tasks:
- name: Remove useless packages from the cache
apt:
autoclean: yes
- name: remove unrequired packages
apt:
@sharanpeetani
sharanpeetani / swapfile_configure.yml
Created August 27, 2021 17:29
Swapfile creation on Debian servers
## PLaybook is used to create or delete swapfile
## Author: Maithili Peetani
---
- hosts: all
gather_facts: yes
become: yes
vars_files:
- swapfile_vars.yml
@sharanpeetani
sharanpeetani / package_check.yml
Created September 1, 2021 19:04
To check installed package status
---
- hosts: all
become: yes
vars:
package_name: "rabbitmq-server"
tasks:
## with package_facts ##
@sharanpeetani
sharanpeetani / ssh_uptime_check.sh
Last active February 17, 2022 18:40
script to check ssh connection and uptime
#!/bin/sh
USR='username'
for host in $(cat host_list)
do
sshpass -f pd_file ssh -q -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=5 ${USR}@${host} exit
let ret_code=$?
if [ $ret_code -eq 5 ]; then
echo "${i} Connection Refused!" $ret_code