Move more responsibility to common EC2 module

Moved `AWS_REGIONS` into `ec2` module
Created `ec2_connect` method in `ec2` module
Updated modules able to use `ec2_connect` and `AWS_REGIONS`
Don't override sudo if transport is set to local.
https://github.com/ansible/ansible/pull/5251
Modified docsite layout to use Google custom search.
setup caching 1st draft
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
setup cache 1st draft, commit 2
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now actually loads the filters, but breaks at trying to run cache ..
fixing
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now still always returns dict even if someone set value to None for a
key
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
fixed None and clear() corner cases
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
switched to using dictmixin for cache object, mulling about
collections.mutablemappings as alternative
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
ensure name is stirng

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
cleaned up remanents from prev iteratoin
fixed issue with setter
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now value is correct for in memory cache, if it comes from cache plugin,
new facts or default (dict).

corrected setdefault param mismatch

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now only returns values if it expired
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
moved default factory to None and now pass dict (closer to defaultdict
behaviour)

added __contains__ method in cache

currently merges local cache with facts, for some reason 'in' doesn't
seem to match existing keys.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
added new functions and error checking

- now checks if cachd_dir is actualy a dir
- cached function returns list of cached keys/hosts
- now stats file to se if it has 'expired'

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
fixed bug in contains, added keys and validate_key methods
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
reverted to inherit for dict and use dict methods directly
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
now forces save when destroyed
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
Work in progress on fact caching implementation.
Tests that rely on event count returns do not actually test correctly, and should be expunged.