Mainly bug fix in cloudinit-static-template

Changes in cloudinit-static-template.bash

1. Bug fix in cloudinit-static-template
2. Added function to check the package manager we have to use to download wget, apt-get or yum, depending on if the vm is debian or redhat based.