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
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
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
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
uri: load JSON for content-type: application/json
document
check prefix of content-type and merge dicts
amend doc
load JSON into 'json' subkey
Merge pull request #2119 from jpmens/uri_json

uri: load JSON for content-type: application/json
pause: Fix small documentation glitch
Added more users of ansible (TCHPC and DRI)
Merge pull request #2153 from jcftang/devel

Added more users of ansible (TCHPC and DRI)
Merge pull request #2152 from dagwieers/pause-doc

pause: Fix small documentation glitch
Fix diff output vertical spacing