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
mail module: properly set charset
sysctl module: fixed issue when checks_after fail on comparing keys with values separated by white strings
sysctl module: fixed issue when checks_after fail on comparing keys with values separated by white strings
Merge pull request #2131 from lessmian/sysctl_module

sysctl module: fixed issue when checks_after fail on comparing keys with...
Merge pull request #2130 from lessmian/devel

mail module: properly set charset
Fix #2125 and clean up a few things along the way
Don't consider packages missing from the cache an error on remove

Fixes #2017.
teach apt module to support --check mode
teach lineinfile module to support --check mode
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.