#!/usr/bin/python2

import config
import header
import cgi,commands,os,MySQLdb
import datetime


def remove(nfs_id):
	
	removeString = """
- hosts: web
  tasks:
  
  - command: sudo umount -l /nfs-share/{0}
  
  - lvol:
      vg: vg1
      lv: {0}
      state: absent
      force: yes """. format(nfs_id)

	ansibleProg = open("/Arcus/public/tmp/nfs/remove.yaml", "w")
	ansibleProg.write(removeString)
	ansibleProg.close()

	ansF = commands.getstatusoutput("sudo ansible-playbook /Arcus/public/tmp/nfs/remove.yaml")
	
	if(ansF[0] == 0):