Commit Graph

92 Commits (b1fe7ee24afe8e563e9c84088b85fec2681db7cb)

Author SHA1 Message Date
James Cammarata 4880cfb5ea Merge pull request #6568 from sivel/ssl-cert-validation-osx
Make SSL verification on Mac OS X work out of the box
2014-03-19 13:45:45 -05:00
James Tanner 67517e96d3 Fixes #6567 put the git wrapper script in the module temp dir 2014-03-19 10:30:10 -04:00
Matt Martz 1d3d73a0b6 Only write the DUMMY_CA_CERT on OS X 2014-03-19 09:01:13 -05:00
Matt Martz 3b5aa8bd30 Provide a dummy ca to allow OS X to do it's OpenSSL keychain magic 2014-03-18 17:16:44 -05:00
James Cammarata 3f5440f7df Make modules set a valid working directory
Fixes #6546
2014-03-18 10:37:52 -05:00
Michael DeHaan 13f69dad05 Merge pull request #6527 from patrickheeney/hosts-bug
Fix for hostkey directory
2014-03-17 17:35:27 -04:00
James Cammarata 5d8c9d3f0f Merge branch 'file_fixes_clean' of https://github.com/bcoca/ansible into bcoca-file_fixes_clean 2014-03-17 14:03:26 -05:00
patrickheeney a9aab23f11 Fix for hostkey directory 2014-03-17 09:00:08 -07:00
Greg Dallavalle 77229553a3 fetch_url: Avoid credential stripping for FTP-scheme URLs 2014-03-16 20:41:03 -05:00
Michael DeHaan b0dbc61d63 Move facts to 'module_utils' so they can be referenced by other modules. Note unlike other module_utils/ dirs this keeps the original
license -- so usage of facts code in modules will be limited to GPLv3 modules.
2014-03-16 16:12:02 -04:00
Brian Coca 2d25577e11 Fixes and cleanup to file functions and module
- unified set attribute functions ... not sure why 2 identical functions
exist with diff names, now there are 3 while i repoint all modules to 1
- fixed issue with symlinks being created w/o existing src when force=no
- refactored conditionals, simplified where possible
- added tests for symlink to nonexistant source, with both force options
- made symlink on existing attomic (force)
2014-03-15 13:54:24 -04:00
James Cammarata a0cb974575 Be sure to return to the old directory if cwd is set in run_command 2014-03-13 16:24:29 -05:00
James Tanner a348f67238 Reset the current directory after running subprocess.Popen 2014-03-13 17:15:23 -04:00
James Cammarata 677008bef7 Rejoin args list into a string for run_command when using an unsafe shell
This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
2014-03-13 14:31:32 -05:00
James Cammarata 5233d4bc31 Fix typo in run_command when sending data that is not binary 2014-03-13 14:28:51 -05:00
James Cammarata b1a37dcc08 Revert "Rejoin args list into a string for run_command when using an unsafe shell"
This reverts commit 4273cb2d8e.
2014-03-13 14:04:51 -05:00
James Cammarata 4273cb2d8e Rejoin args list into a string for run_command when using an unsafe shell
This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
2014-03-13 13:51:59 -05:00
James Cammarata 303e085f8b Only use cwd in run_command kwargs if the directory exists 2014-03-12 15:59:55 -05:00
James Cammarata 60a7f57300 Make sure the cwd exists in run_command before trying to use it 2014-03-12 14:33:31 -05:00
Dan Koch bbf320fd22 Work around for cwd stat problems with run_command and sudo
This fixes issue #6443
2014-03-12 14:59:50 -04:00
James Cammarata 2c7d58abe0 Compile ca certs into a temp file to reduce number of attempts
For those who may have a large number of certs found, this can reduce
the number of ssl connections attempted.
2014-03-12 13:45:16 -05:00
Michael DeHaan d37f0c6d12 Use same implementation as ssh.py for "is in host file" checks in module code, prevents git module from adding keys more than once. 2014-03-12 14:11:45 -04:00
Michael DeHaan 6d841d120e Don't process shell commands as arrays. 2014-03-12 11:57:28 -04:00
James Cammarata a9017af2bb Adding validate_certs to all modules that use fetch_url 2014-03-12 10:19:54 -05:00
Michael DeHaan cfabc2e28a module.run_command is intended to bypass the shell here, so can't do ">>" 2014-03-12 10:57:49 -04:00
James Cammarata 7f38cff989 Remove unused code from get_ca_certs() function 2014-03-12 09:33:19 -05:00
James Cammarata 804e4166c8 Rewriting ssl validation to try multiple certs found in paths
Previously, the function checked only for a single CA root cert, however
some distributions may have multiple certs in a directory. This will now
try any .crt or .pem file contained within several common paths for
each platform.

Fixes #6412
2014-03-12 09:21:19 -05:00
Michael DeHaan 0b0ca95731 Expand environment variables and tildes passed to commands generically across the board. 2014-03-12 10:11:09 -04:00
James Cammarata 430cce9df3 Merge branch 'ec2_security_token' of https://github.com/willthames/ansible into willthames-ec2_security_token 2014-03-11 10:45:38 -05:00
Michael DeHaan 411bcb7161 Merge remote branch 'real/devel' into devel 2014-03-10 19:11:21 -04:00
James Tanner ba0fec4f42 Force command action to not be executed by the shell unless specifically enabled 2014-03-10 16:13:30 -05:00
James Cammarata 9730157525 Validate SSL certs accessed through urllib*
* Adds another module utility file which generalizes the
  access of urls via the urllib* libraries.
* Adds a new spec generator for common arguments.
* Makes the user-agent string configurable.

Fixes #6211
2014-03-10 16:06:52 -05:00
Franck Cuny 82f99bfa3d Add BSD license to module_utils/gce.py 2014-03-10 12:02:45 -07:00
James Cammarata 2a0028e687 Sanitize run_command argument output
Fixes #6316
2014-03-06 13:34:22 -06:00
Will Thames b9a7352e0a Work to allow security tokens and profiles to work with Ansible
Allow security tokens and profiles to be used as arguments
to the 'common' ec2 modules

Mostly refactoring to provide two new methods,
`get_aws_connection_info`, which results in a dict that can be
passed through to the boto `connect_to_region` calls, and
`connect_to_aws` that can pass that dict through to the
`connect_to_region` method of the appropriate module.

Tidied up some variable names

Works around boto/boto#2100

profiles don't work with boto < 2.24, but this detects for that
and fails with an appropriate message. It is designed to work
if profile is not passed but boto < 2.24 is installed.

Modifications to allow empty aws auth variables to be passed
(this is useful if wanting to have the keys as an optional
parameter in ec2 calls - if set, use this value, if not set,
use boto config or env variables)

Reworked validate_certs improvements to work with refactoring

Added documentation for profile and security_token to affected modules
2014-03-06 16:28:30 +10:00
Franck Cuny 6294264dc4 Add credential parameters to the GCE modules.
In order to simplify the workflow with the GCE modules, it's now
possible to add the parameters and project name as arguments to the
various GCE modules.

The inventory plugin also returns the IP of the host in
`ansible_ssh_host` so that you don't have to specify IPs into the
inventory file.

Some update to the documentation are also added.

Closes #5583.
2014-03-04 19:27:49 -08:00
James Cammarata 14ba10393b Minor tweak to region config in boto configuration file 2014-02-26 15:40:33 -06:00
James Cammarata 88acb48e61 Merge branch 'ec2_boto_config_region' of https://github.com/willthames/ansible into willthames-ec2_boto_config_region 2014-02-26 15:32:05 -06:00
James Cammarata 8a7c68dc18 Merge branch 'ec2-params' of https://github.com/scottanderson42/ansible into scottanderson42-ec2-params
Conflicts:
	lib/ansible/module_utils/ec2.py
	library/cloud/ec2
2014-02-26 09:37:26 -06:00
James Cammarata 3b2d409906 Fixing several bugs in assemble and updating tests
Bugfixes:
* the remote_src param was not being converted to a boolean correctly,
  resulting in it never being used by the module as the default behavior
  was remote_src=True (issue #5581)
* the remote_src param was not listed in the generic file params, leading
  to a failure when the above bug regarding remote_src was fixed
* the delimiter should always end with a newline to ensure that the file
  fragments do not run together on one line

Fixes #5581
2014-02-24 14:27:23 -06:00
James Cammarata b6222abee6 Fix unicode decode error in syslog for modules
Fixes #6056
2014-02-19 09:42:01 -05:00
Martin Thorsen Ranang 7e23ed345f Avoid breaking on unicode input when logging to syslog in modules
After commit 254f87e, non-ascii input broke logging to syslog.
2014-02-17 23:56:08 +01:00
James Cammarata 0cfaabf9cb Make sure unicode params don't break logging in modules 2014-02-17 13:37:48 -06:00
James Cammarata faa645c834 Merge pull request #6001 from jimi-c/issue_4087_sanitize_output
Filter out messages that match the pattern username:password@host
2014-02-14 09:54:05 -06:00
Chris Hoffman affed67ebd Small fix for ec2 validate_certs option 2014-02-13 16:30:31 -05:00
James Cammarata b8646991db Filter out messages that match the pattern username:password@host
This filtering is done in both the module invocation logging and in
the regular verbose() logging output.

Fixes #4087
2014-02-13 14:23:49 -06:00
James Cammarata 056d54ebd3 Adding 'validate_certs' option to EC2 modules
When disabled, the boto connection will be instantiated without validating
the SSL certificate from the target endpoint. This allows the modules to connect
to Eucalyptus instances running with self-signed certs without errors.

Fixes #3978
2014-02-13 12:32:49 -06:00
James Cammarata 254f87e7dd Fix log handling of unicode output to syslog in modules 2014-02-12 11:27:52 -06:00
James Cammarata a023cbce14 When using jsonify in modules, try several unicode encoding for dumps()
Fixes #4821
2014-02-11 14:19:40 -06:00
Scott Anderson baf508a379 Change standard AWS access and secret key parameter names to aws_access_key and aws_secret_key. Fixes an authentication problem with the rds module and standardizes the naming convention on something more encompassing than ec2_*_key. 2014-02-08 18:35:26 -05:00