Commit Graph

5521 Commits (7334389de60c8cae6430de8560c47e2522fb0574)

Author SHA1 Message Date
Toshio Kuratomi 5d8ab9b01b Update module refs 9 years ago
Toshio Kuratomi b23a083776 Make vault use a mapping of cipher name to classes instead of formatting the name for safety. 9 years ago
Toshio Kuratomi baa309309d Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 9 years ago
Lars Kellogg-Stedman aa0b7536c9 correct value of remote_user for local connections
When using 'local' connections, privilege escalation would fail if
ansible_ssh_user was in the current context to the same value as
become_user.

This commit ensures that for 'local' connections we reset remote_user to
the local username.

This fixes #12782.
9 years ago
Toshio Kuratomi 28c933ce5e properly fail_json when we don't have ssl on a non-redhat distro 9 years ago
Marius Gedminas 98958ec990 Simplify join expression 9 years ago
Marius Gedminas 56184a3d8c Python 3: avoid %-formatting of byte strings
This is needed for Python 3.4 compatibility; Python 3.5 can use
`b'%s\n' bytestring` again.
9 years ago
Brian Coca 9b088a1e40 implemented inventory_hostname lookup in v2 9 years ago
Brian Coca aee6de5a76 group_names should not include implied 'all', fixes #12763 9 years ago
James Cammarata dce58a78c9 Make random cowsay truly random
Also adds a cowsay whitelist config option, because there are some
truly NSFW stencils that come with cowsay by default.
9 years ago
Marius Gedminas 4fb6f62f1b Fix Unexpected Exception: global name 'os' is not defined
I inadvertently introduced it in
ca826508d9 and didn't notice, because
there are no unit tests for playbook_executor.py.  Sorry!

(The "from ansible.errors import *" was used *only* to get the 'os'
module, which makes go "what?")
9 years ago
Marius Gedminas ab569cea22 Move to_str alias into ansible.utils.unicode
@abadger suggested on IRC that it's useful enough to go into
ansible.utils.unicode.
9 years ago
Marius Gedminas ca826508d9 Python 3: fix AnsibleError formatting
If you convert the error string to bytes and embed it inside another
error string, you get

  Prefix:

  b'Embedded\nerror\nstring'

which is not what we want.

But we also don't want Unicode in error messages causing unexpected
UnicodeEncodeErrors when on Python 2.

So let's convert the error message into the native string type (bytes on
Python 2, unicode on Python 3).
9 years ago
Toshio Kuratomi 5617f6aad4 Update synchronize to use the correct host when delegating
Fixes #12752
9 years ago
Toshio Kuratomi 85abd61001 Add some more info to docstring 9 years ago
James Cammarata d923d05a33 Reworking the way all() works in plugin_loader
* Don't throw away the full path of the module code being loaded,
  as this can cause conflicts when files of the same name are being
  instantiated
* Generalize the module loading code

Fixes #12738
9 years ago
James Cammarata 45b803efb4 Properly use test_loader from SharedPluginLoaderObj 9 years ago
Toshio Kuratomi c8ad55103e Update extras modules ref to fix docs 9 years ago
Toshio Kuratomi e00eeba9c3 Update submodule refs 9 years ago
James Cammarata 91b0b4d40c Check is_directory() before not is_file() in inventory basedir
Fixes #12742
9 years ago
Brian Coca c57200925f made syslog import optional as intel's edison custom compiles python w/o it 9 years ago
James Cammarata ee559e03f7 Merge pull request #12725 from mgedmin/py3k
Python 3: there's no basestring
9 years ago
James Cammarata e6d3c6745f Revert to using local file/dir tests in inventory instead of loader's
Fixes #12719
9 years ago
Brian Coca c637d60a8d fixed deprecation message 9 years ago
Brian Coca f5227d494b added missing cachefile and changed str(e) to to_bytes(e) 9 years ago
Marius Gedminas 9ba6c087d3 Python 3: there's no basestring 9 years ago
Marius Gedminas f03da5be42 Python 3: there's no iteritems() 9 years ago
James Cammarata 2d77c643e4 Merge pull request #12723 from mgedmin/py3k
Make ansible.vars.unsafe_proxy Python 3 friendly
9 years ago
Marius Gedminas e511d6d458 Make UnsafeProxy work on Python 3
Instead of str and unicode we have to deal with bytes and str.
9 years ago
Marius Gedminas af6a316d9b Remove unused import
Fixes ImportError: No module named '__builtin__' on Python 3.
9 years ago
James Cammarata 426187489f Add variable for format parameter 9 years ago
Toshio Kuratomi 8277747a04 Fix password lookup when password file exists and the password is not encrypted 9 years ago
James Cammarata cd2cb178ae Totally rework the way UnsafeProxy does things 9 years ago
Toshio Kuratomi 15d7f53846 AnsibleModules.log() fix for python3
Also add unittests for AnsibleModules.log()

Fixes #12586
9 years ago
Toshio Kuratomi b49e0995cb Fix typo 9 years ago
Toshio Kuratomi b58d7470d4 Cleanup logic and be more paranoid about passwords with spaces 9 years ago
James Cammarata 5c5806d669 Fixing bugs related to jfonfile cache plugin
* corrupt/invalid file causes tracebacks
* incorrect initialization of display/_display in BaseCacheModule class
* tweaking the way errors in get() on jsonfile caches work, to raise
  a proper AnsibleError in that situation so the playbook/task is stopped

Fixes #12708
9 years ago
Toshio Kuratomi b441bcb678 Fix display when run through a testing framework that overrides stderr/stdout 9 years ago
James Cammarata d15fcf05f0 Fix bug in the way temp vars were created for templating vars_files
Fixes #12711
9 years ago
Brian Coca f5f3bf06e4 Merge pull request #12550 from redrampage/remove-pw-salt-deletion
Removed deletion of salt by 'password' lookup
9 years ago
James Cammarata 73661d1761 Merge branch 'devel' of https://github.com/ansible/ansible into devel 9 years ago
Charles Paul 3d533cb423 fixing calls to fail_json 9 years ago
Brian Coca 50372eecc9 Merge pull request #12455 from privateip/devel
added methods for retrieving vapp and vm
9 years ago
James Cammarata 82e76e42e5 Tweak to the way serial percentages are handled 9 years ago
James Cammarata 63e288354e Fix bug in way omitted values were set 9 years ago
James Cammarata 4c85ae0712 Merge branch 'serial_should_be_string' of https://github.com/klshxsh/ansible into klshxsh-serial_should_be_string 9 years ago
klshxsh ac00c9ced7 changed 'string' to 'percent' for _serial
Note that this allows both integers (e.g. 3) and percentages (e.g. "30%")
Also changed default back to 0 rather than '0'
9 years ago
James Cammarata eb60ce1b6e Merge pull request #12703 from keitwb/inventory_file_var
Adding the inventory_file var back
9 years ago
James Cammarata 71a1a3c903 Submodule pointer update 9 years ago
Ben Keith 1f82971283 Adding the inventory_file var back 9 years ago
Toshio Kuratomi 45a161b0a1 Merge pull request #12429 from edmstudio/devel
Update synchronize module plugin to work on OS X
9 years ago
Petr Mifek 6e035a3e94 Move nested function test for ipv6 to top level in synchronize module. 9 years ago
Brian Coca 45788fbfad <homer>doh!</homer> 9 years ago
Brian Coca d24532757c remove fix for local_action/connection local that is now not needed 9 years ago
klshxsh 4a5e52b2d2 The serial keyword can be specified as a percentage, e.g '30%' or a number e.g. '3'; therefore it needs to be a string to allow both types 9 years ago
Brian Coca b9d54e9a01 corrects previous fix to deal with missing item key in results dict 9 years ago
Brian Coca abf2e13955 Revert "Track local_action internally to prevent it from being overridden"
This reverts commit 49ca0eb797.
9 years ago
Brian Coca 101c8785ec removed changes to make local action equate connection=local and brought it back to equate delegate_to=localhost 9 years ago
Brian Coca bcb173996b Merge pull request #12695 from matburt/fix_cache_plugins_for_v2
Fix an issue where cache plugins weren't updated in certain scenarios
9 years ago
Brian Coca fbf4cafab5 on skipped you 'might' not have an item, changed to getattr to avoid keyerror
fixes #12683
9 years ago
Matthew Jones 7da478a4f4 Fix an issue where cache plugins weren't updated
The first call to persisting facts would work due to the assignment of a
MutableMapping calling __setitem__ but subsequent module fact data would
not be propogated to the fact cache plugins because update() doesn't
invoke __setitem__.  This changes the behavior a little bit and ensures
set() is called on cache plugins.
9 years ago
Brian Coca ec02b255c3 Merge pull request #12689 from soarpenguin/bugfix
Remove some warning of undefined name and fix classmethod syntax error.
9 years ago
James Cammarata 770032648a Show -> localhost for local_action tasks 9 years ago
James Cammarata f415d39dfd Merge pull request #12690 from stelligent/devel
Use AWS_DEFAULT_REGION env var if none specified
9 years ago
James Cammarata cfa62e7a2a Submodule pointer update 9 years ago
James Cammarata 868819f9fa Make sure shlex split is returning properly encoded strings
Fixes #12676
9 years ago
Shayne Clausson 55b3f9e4e5 Use AWS_DEFAULT_REGION env var if none specified 9 years ago
soarpenguin b11ea17385 fix classmethod syntax error. 9 years ago
soarpenguin 5efa4d29e3 fix some warning of undefined name. 9 years ago
James Cammarata 59d655c543 Double echo temp directory name to handle spaces and ~ expansion both
Fixes #12667
9 years ago
Toshio Kuratomi d1b98ec776 Correct typo 9 years ago
Toshio Kuratomi 2f5e817007 Do not mix byte str with unicode type 9 years ago
Toshio Kuratomi 01ba2e94c0 Wait until later to convert to byte strings for output
Also some pre-emptive python3 compat and a code simplification
9 years ago
Brian Coca 76feba00c4 avoid callbacks during syntax check and listing
fixes #12682
9 years ago
Brian Coca 4463ced8ba simpler safe output 9 years ago
James Cammarata de792ba3c2 Improve handling of unicode errors
Fixes #12669
9 years ago
James Cammarata 5a0f5f1254 Load vars for localhost when created implicitly
Fixes #12666
9 years ago
Brian Coca d8769c93c7 updated ec2 region description to add missing other env var 9 years ago
Brian Coca c77733e64e added docs for commonly used region parameter in some ec2 modules 9 years ago
Brian Coca 638bc14566 now deps is always a list 9 years ago
Brian Coca dac3684fd1 changed task color to dark gray to keep it from being confused with ignore/skip 9 years ago
Brian Coca c459dd4e18 Merge pull request #12663 from Juraci/task-path
Displays the absolute path of a given task when verbosity is above level 3
9 years ago
James Cammarata dbae110f6f Merge pull request #12660 from apollo13/fix_galaxy_init
Show a nice error if the role name is missing.
9 years ago
Juraci e52950a939 Displaying task_path on task start when verbosity is more than 3 9 years ago
Juraci 254d6be520 Adding get_path method to Task class 9 years ago
Florian Apolloner 354383874f Show a nice error if the role name is missing. 9 years ago
= 345ce424c6 Explictly set the version of strict mode to use for powershell modules. 9 years ago
James Cammarata 9e364c2eb5 Don't modify results in callbacks
Fixes #12654
9 years ago
James Cammarata 8107c4efc7 Fixing a bug in galaxy parsing of text spec file lines 9 years ago
James Cammarata 7a815b7296 Force connection to local when localhost is delegated to 9 years ago
Toshio Kuratomi 97e8d25eb4 Fix for encoding errors when a command returns non-utf8 encoded values 9 years ago
Toshio Kuratomi 4f6f2c21e8 range vs xrange doesn't matter here and six.moves.range isn't available in six-1.3.0 (rhel7) 9 years ago
James Cammarata 5ae74f7d38 Version bump for 2.0.0-0.3.beta1 9 years ago
James Cammarata d9b79b1bbc Also template the role name when loading roles
Fixes #12602
9 years ago
James Cammarata 9c9897805f More ansible-galaxy fixes for the old spec file format 9 years ago
James Cammarata fb822a4305 Merge pull request #12637 from rcleere/rekey_fix
Fix ansible-vault rekey
9 years ago
James Cammarata 3b8eaf6128 Cleaning up some ansible-galaxy stuff 9 years ago
Ryan Cleere 0400ab8c0f Fix ansible-vault rekey 9 years ago
James Cammarata d91b3c6b9d Make sure magic variables are available when templating vars_files
Also does some reorganization/cleanup on the magic vars/delegated
variable generation portions of VariableManager to make the above
possible.

Fixes #12633
9 years ago
James Cammarata 284bd118a0 Properly switch to the default transport when delegating from localhost 9 years ago
Brian Coca 6f88f79de9 removed dupe install code, now trap errors forom role.install 9 years ago
Brian Coca f73329401b galaxy updates
better error reporting on fetching errors
use scm if it exists over src
unified functions in requirements
simplified logic
added verbose to tests
cleanup code refs, unused options and dead code
moved get_opt to base class
fixes #11920
fixes #12612
fixes #10454
9 years ago
Brian Coca a3ed9fc131 updated to 'fixed' get_url so docs build again 9 years ago
Brian Coca f3d0468726 updated submodule refs 9 years ago
James Cammarata 323012be2e Pop tags out of playbook include params
Fixes #12605
9 years ago
Toshio Kuratomi 10a4a4e986 Quote any file paths that we have to use with dd to copy.
This is because we pass the whole dd command string into the shell
that's running on the contained environment rather than running it
directly from python via subprocess without a shell.
9 years ago
Toshio Kuratomi b83988d9fb Port libvirt_lxc connection plugin to v2 9 years ago
Toshio Kuratomi 567deb5ac2 Add explicit substitution of relative paths on the remote host just in case the connection programs do something unexpected. 9 years ago
Brian Coca 8528b20702 fixed usage text 9 years ago
Brian Coca 04a2b221b9 removed conflicting short options 9 years ago
James Cammarata 38528c8ef3 Show more info in the minimal callback for unreachable hosts
Fixes #12621
9 years ago
Toshio Kuratomi 613e87db6c FIx typo arg_path (not plural) 9 years ago
Brian Coca 4ba5ebd1c8 Merge pull request #12538 from yesbox/url_lookup_plugin_httperror_fix
Fix url lookup plugin HTTPError message not being reachable
9 years ago
Peter Sprygada ab3239ecd7 added methods for retrieving vapp and vm 9 years ago
Toshio Kuratomi 10750214ea Since Connection.execute_command() returns bytes, deal with the repurcussions here. 9 years ago
Brian Coca e2ae3215f6 corrected no_log for items and skipped tasks
corrected output from default callback
added new tests for no_log loops
updated makefile test to check for both positive and negative occurrences of no_log
9 years ago
James Cammarata c28758d2a8 Merge branch 'ssh-args' of https://github.com/amenonsen/ansible into amenonsen-ssh-args 9 years ago
James Cammarata 82faba619e Also add args_path param to powershell shell plugin 9 years ago
James Cammarata 30d481ac57 Fix old-style (non-python) module support 9 years ago
Toshio Kuratomi e40e08d799 Update core sumodule ref to fix docs 9 years ago
Abhijit Menon-Sen b127221f50 Pass default None to getattr, remove repeated call 9 years ago
Abhijit Menon-Sen 96c4dc273a Set explicit default for ANSIBLE_SSH_ARGS
The earlier code behaved exactly as though this default had been set,
but it was actually handled as a(n unnecessary) special case inside the
connection plugin, rather than set as an explicit default.

If the default is overriden either in ansible.cfg or the environment,
the new code will continue to work (in fact, it won't know or care,
since it just uses the value set in the PlayContext).

This is submitted as a separate commit for easier review to address
backwards-compatibility concerns.
9 years ago
Abhijit Menon-Sen 1981bf2b95 Aggregate ssh arguments in PlayContext instead of the connection plugin
Using set_host_overrides() in the connection plugin to access the ssh
argument variables from the inventory didn't see group_vars/host_vars
settings, as noted earlier. Instead, we can set the correct values in
the PlayContext, which has access to all command-line options, task
settings, and variables.

The only downside of doing so is that the source of the settings is no
longer available in ssh.py, and therefore can't be logged. But the code
is simpler, and it actually works.

This change was suggested by @jimi-c in response to the FIXME in the
earlier commit.
9 years ago
Abhijit Menon-Sen 3ad9b4cba6 Rework additional ssh argument handling
Now we have the following ways to set additional arguments:

1. [ssh_connection]ssh_args in ansible.cfg: global setting, prepended to
   every command line for ssh/scp/sftp. Overrides default ControlPersist
   settings.
2. ansible_ssh_common_args inventory variable. Appended to every command
   line for ssh/scp/sftp. Used in addition to ssh_args, if set above, or
   the default settings.
3. ansible_{sftp,scp,ssh}_extra_args inventory variables. Appended to
   every command line for the relevant binary only. Used in addition to
   #1 and #2, if set above, or the default settings.
3. Using the --ssh-common-args or --{sftp,scp,ssh}-extra-args command
   line options (which are overriden by #2 and #3 above).

This preserves backwards compatibility (for ssh_args in ansible.cfg),
but also permits global settings (e.g. ProxyCommand via _common_args) or
ssh-specific options (e.g. -R via ssh_extra_args).

Fixes #12576
9 years ago
Toshio Kuratomi f13d5201b8 Update module refs 9 years ago
Brian Coca 4c9f58a152 added no_log censoring to item output
should be last commit that fixes #12214
9 years ago
Brian Coca ba4afcbbb6 added no_log to results
normalized outputs to use display class
cleaned up unused imports
9 years ago
Brian Coca c27bd4fab0 {sudo,su}_user does not imply become 9 years ago
James Cammarata 57372906aa Pull host/group vars when adding hosts/groups
Fixes #12582
9 years ago
James Cammarata aa3687d736 Fix syntax error for octal in encrypt methods 9 years ago
James Cammarata 538568305a Submodule pointer update for accelerate module fixes 9 years ago
James Cammarata 8ef78b1cf8 Fixing accelerated connection plugin 9 years ago
Brian Coca 3705d54485 fixed error reporting on splitter 9 years ago
Brian Coca de2f62bd9e fixed error reporting for unkown become user 9 years ago
Brian Coca 6d6bfbc3d2 added missing import for pwd, was being obscured by exception catching and fallback 9 years ago
Brian Coca a680ef66dd fixed vault password file script execution 9 years ago
Brian Coca 6b842d9c49 fixed incorrect data passing on certain events 9 years ago
Brian Coca 2463922306 fixed error reporting when missing redis import 9 years ago
Brian Coca 6e96188085 added missing entry for dealing with bcc 9 years ago
Brian Coca 6ec5abf1c3 fixed some pyflakes 9 years ago
Abhijit Menon-Sen 49b35ad5dd Remove mysterious old cruft
The two lines were added in 2673eb0a and modified in 60e1a1f8, but foo
is completely unused. Removing it doesn't break anything: out it goes!
9 years ago
Brian Coca fe0e4f27ad Merge pull request #12584 from amenonsen/fixups
Remove an unwanted FIXME annotation
ok, confirmed we don't want to support it
9 years ago
Brian Coca 6c190aa8a4 updated ansible-doc to ignore more stuff that has been added to the module repos 9 years ago
Brian Coca 1a56a5c442 created debug method, renamed debug attribute to _debug 9 years ago
James Cammarata deff045aa9 Fix bug caused by options not having start_at_task when used through adhoc
Fixes #12590
9 years ago
Toshio Kuratomi a0920c06e1 Pull submodule refs to fix docs builds 9 years ago
Toshio Kuratomi 4dae7eeca1 Update submodule refs 9 years ago
Toshio Kuratomi 56fa9a5098 Port to v2 API 9 years ago
Toshio Kuratomi d35c9a30fb Minor refactorings 9 years ago
Toshio Kuratomi 888bcd65a8 Create error messages instead of tracebacks. 9 years ago