Added repos for new fabric and ubuntu-cloud-archive in sources.list of lb

Fabric version in ubuntu repos are older version which lacks some required features.
So added chris-lea ppa for newer version of fabric and added ubuntu-cloud-archive for
python-paramiko version which is required for new fabric.
Update floating ip deletion code

The previous version of the ip deletion
code was problematic b/c it was looking for
unassigned ip addresses and deleting them.

It was assumed that b/c the VMs were deleted
first (and leaving floating addresses stranded)
that all unassigned address could be cleaned up.

After further thought, this could create a race
condition where ip addresses that are created,
yet unassigned (by the build process) might
get deleted as well.

This code updates the floating ip deletion as
follows:
- performs deletion before vms are deleted
- gets the address and id of subnet related to project
to ensure that correct address is disaccoiciated and
deleted.
Removing .users.yaml.swp from hiera
Merge pull request #11 from hkumarmk/add_apt_sources

Added repos for new fabric and ubuntu-cloud-archive in sources.list of l...
Merge pull request #14 from alokjani/master

Removing .users.yaml.swp from hiera
Merge pull request #13 from bodepd/update_floating_ip_deletion

Update floating ip deletion code
Added code to build and copy relevant files to cloud system and run setup

Now resource_spawner prepare temporary directory by populating required files
including ssh keys, puppet code, fabric and userdata script.

Fab functions are added to copy the temporary directory to lb node (jump host)
of the cloud system being built, run userdata to do basic setup, install puppet code,
setup fab by copying fabfile to ubuntu home directory. and then to run fab function
"setup" to setup the entire cloud system.

Here are the files to be copied from build system to cloud
1. ssh keys for ubuntu user - these keys are generated by resource_spawner script
2. jiocloud_puppet_builder directory - this contains base puppet code, fabfile and userdata script
3. Puppet modules - puppet modules are built by resource_spawner script using puppet-librarian-simple.

Here are the changes in resource_spawner script:

Added new function setupTmpDir:

Earlier mktemp was called directly in the main code, moved that code to new function and added code to copy jiocloud_puppet_builder to temporary location.

Changed setupPuppet function:

Now setup pupet modules in temporary directory - before setupPuppet runs,
jiocloud_puppet_builder is copied to temp directory and then run this fucntion to setup puppet modules.

Also added sudo on apt-get install and gem install to make this script work for non-root user also.
Now script will only trying apt-get install if librarian-puppet-simple is not installed

Now fab code will copy the temporary directory prepared by resource spawner to lb

Modified putFiles()

Added code to make directory if not exists before copy. Also added one argument t

Modified initiateSetup()

Takes directory path as arugment and make a tar of directory.
Copy the tar file to lb server of cloud system
Untar the file on lb
copy puppet code to /var/puppet
copy fabfile to ~ubuntu/
Run userdata.sh to setup basic things and install fabric and puppet
Run fab (function setup) to setup the entire cloud system.

Modified setup()

Now copy puppet code and user data to all systems
run userdata for basic setup and puppet installation
setup the cloud systems by running puppet.

Now accept three parameters:
dir: directory path to copy to all cloud systems
verify: whtether to run checkAll function to verify the cloud systems or not
verbose: yes or no

Removed unnecessary functions:

getHostname: this was to do a reverse dns lookup and prepare a dictionary of host
callHosts: this was to call getHostname
Added generic python functions to read and write yaml files.

These functions will be used to pass the arguments to puppet as hiera files.

rdYaml()
This function read yaml file and return python dictionary object

wtYaml()
This function accept python dict object, and write it to yaml file.
Optionally it may append to existing yaml file
Merge pull request #12 from hkumarmk/fab_deploy_cloud

Added code to build and copy relevant files to cloud system and setup
Merge pull request #16 from hkumarmk/added_generic_yaml_functions

Added generic python functions to read and write yaml files.
Merge pull request #15 from amar266/master

To derive the ip addresses for all nodes in our stack and correctly popu...