import subprocess
def script_os_distributor(os_distributor_server):
distributor_out = subprocess.check_output('ansible -m shell -a \'lsb_release -a\' %s | grep \'Distributor ID:\' | awk -F\':\' \'{print $2}\''%os_distributor_server, shell=True)
return distributor_out
def script_os_release(os_release_server):
release_out = subprocess.check_output('ansible -m shell -a \'lsb_release -a\' %s | grep \'Release:\' | awk -F\':\' \'{print $2}\''%os_release_server, shell=True)
return release_out
def script_os_kernel(os_kernel_server):
kernel_out = subprocess.check_output('ansible -m shell -a \'uname -r\' %s | grep \-'%os_kernel_server, shell=True)
return kernel_out
def script_os_uptime(os_uptime_server):
uptime_out = subprocess.check_output('ansible -m shell -a \'uptime\' %s | grep \, | awk \'{print $3,$4}\' | awk -F\',\' \'{print $1}\''%os_uptime_server, shell=True)
return uptime_out