Only allocate a PTY when sudo is used

Postpone the paramiko.Channel.get_pty until we know sudo is used. If
sudo is not used, then we do not need a PTY. In fact, the paramiko docs
explicitly state that it's not desirable to allocate a PTY for a simple
exec_command.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Initialise PTY from calling environment

If we need to acquire a PTY for sudo's use, then it should really
inherit the capabilities of the calling environment. This is what
OpenSSH does, and so it makes sense to copy this behaviour for the
paramiko connection type.

Closes: #2065
Signed-off-by: martin f. krafft <madduck@madduck.net>
Adding ec2-related module example to examples/playbooks
Add support for additional EXAMPLES string in Ansible modules
return DOC and EXAMPLES as a list
add moduledev explanation
more
Don't consider packages missing from the cache an error on remove

Fixes #2017.
fixes freebsd setup issues with jails
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
Prevents PATH, PYTHONPATH etc... to be re-added.
Add support for security group id parameter, remove default for group name (since AWS already sets a default). ISSUE #2029
Removes exception is sysctl file is missing

When syscl file was missing, sysctl module was complaining about it and
bailing out.
This behaviour prevents usage of /etc/sysctl.d directory, present in
some distributions.
This patch accepts a missing sysctl.conf file so sysctl.d directory can
be used.
However, it will bail out if the destination directory doesn't exist.
Changed when new sysctl file is created

When destination sysctl file is missing, it is created.
But, for idempotency purposes, the creation process now takes place just before it is used, in the
main code path so an empty file is not left over if the code
module.fail_jsons before the file is really used.
Always adjust file attributes with the template module.
Merge pull request #2141 from dorfsmay/pullreq-env-simple

Prevents PATH, PYTHONPATH etc... to be re-added.
Merge pull request #2143 from lwade/ec2_group_id

Add support for security group id parameter ISSUE #2029
Removes useless empty string write

It s not necessary to write an empty string for the file to be created.
Merge pull request #2115 from kavink/devel

teach apt module to support --check mode
Merge pull request #2138 from bcoca/2137_fix_setup_bsdjails

fixes freebsd setup issues with jails
Merge pull request #2122 from lwade/devel

Adding ec2-related module example to examples/playbooks
Add virtualenv_site_packages param to easy_install
uri: load JSON for content-type: application/json
document
check prefix of content-type and merge dicts
amend doc
load JSON into 'json' subkey
Easy_install and pip module support a virtualenv_command parameter.

This allows flexible selection of the Python version to use while
creating the virtualenv.