Commit Graph

486 Commits (600a4657b43894454fa5109d1b77adf65d1b0ed7)

Author SHA1 Message Date
James Tanner 20262b6c15 Remove unused variable in _executor_internal 2014-03-17 15:53:48 -04:00
Michael DeHaan 6144c5e1e2 Merge pull request #5714 from eggsby/patch-2
Allow templates in ansible_sudo_pass inventory var
2014-03-16 15:42:12 -05:00
Cristian Ciupitu 0749112286 Micro-optimization: replace s.find(x)!=-1 with x in s
timeit shows a speedup of ~3x on Python 2.7.5 x86_64.
It also makes the code a bit shorter.
2014-03-16 13:10:28 -04:00
James Cammarata 6c25e78299 Merge branch 'devel' of https://github.com/dparalen/ansible into dparalen-devel 2014-03-11 15:34:15 -05:00
Richard Isaacson 4993cb57f4 Merge pull request #6283 from magicrobotmonkey/upstream
fix missing stdin in _parallel_runner

Tested with GIST https://gist.github.com/risaacson/7290d30a612e0c70ea1b.
Passes "make tests"
Passes non_destructive tests.
2014-03-10 14:38:56 -05:00
Michael DeHaan d2cb35f898 Merge pull request #6320 from angstwad/instance-redo
Use isinstance() rather than a check using type()
2014-03-07 20:41:33 -06:00
James Cammarata f80d02d841 Properly wrap logical elements together for su/sudo detection 2014-03-07 00:07:10 -06:00
Paul Durivage 3cce3650e5 Use isinstance() rather than a check using type() 2014-03-06 16:16:25 -06:00
Andrew Resch 4d80019ac8 Fix logic checking for both sudo and su, and their respective users 2014-03-06 10:24:16 -08:00
aresch 23a0468a4b Fix respecting remote_tmp when sudo is used 2014-03-05 16:25:42 -08:00
Luca Berruti 7cf363910a fixes #6244 2014-03-05 09:18:01 +01:00
Aaron Bassett 5c589af191 fix missing stdin in _parallel_runner 2014-03-04 16:00:26 -05:00
Richard Isaacson e79d859dfb Merge pull request #6213 from sergevanginderachter/fix-delegate-templating
Fixes templating of ansible_ssh_host for delegates.

Tested that this works. Confirmed.
2014-03-03 23:10:09 -06:00
Michael DeHaan 46ec8759d5 Remove the legacy templating code, which was guarded by deprecation warnings in the previous two releases, and undocumented for a long time. use {{ foo }} to access variables instead of ${foo} or $foo. 2014-02-28 18:38:45 -05:00
James Cammarata 79645535c0 Handle empty results from failed connections in _remote_md5()
Fixes #5800
2014-02-28 12:50:03 -06:00
Gilles Cornu 04f6367172 Fully clean 'ssh_old' and 'paramiko_alt' options
These transports have been removed in 33857855ad
2014-02-28 18:28:04 +01:00
Serge van Ginderachter 9833263417 Fixes templating of ansible_ssh_host for delegates 2014-02-27 18:06:34 +01:00
James Cammarata c11e2100e0 Save the original transport in runner after detecting the smart transport
Fixes #6192
2014-02-27 10:30:50 -06:00
James Tanner 876035c0b1 Fixes #6161 Get the delegate host info properly from the hostvars object 2014-02-25 11:18:06 -05:00
James Tanner 0f95a905d9 Fixes #5965 Ensure the inject for each item in a loop is un-altered 2014-02-24 20:54:26 -05:00
jctanner 93c746db9c Merge pull request #5651 from nikut/sshfix
allow ansible_ssh_private_key_file to be templated (thanks to benno)
2014-02-24 14:26:48 -05:00
James Tanner 4af1d6098b Fixes #5939 Allow for delegate hosts that are not in inventory 2014-02-21 15:54:09 -05:00
James Tanner 427b8dc78d Ansible vault: a framework for encrypting any playbook or var file. 2014-02-18 15:35:12 -05:00
Niku Toivola 2faaff78ee removed comment 2014-02-18 11:32:06 +02:00
Niku Toivola 68a3e8163e allow ansible_ssh_private_key_file to be templated (thanks to benno) 2014-02-18 11:32:05 +02:00
Brian Coca 31b5728618 directory detection should now work on BSDs, added AIX alternate path 2014-02-13 08:23:56 -05:00
Michael DeHaan 633d685bb7 Revert "Revert "Revert "This patch makes Ansible reuse fork allocation between seperate instantations of the runner API, therefore the overhead of recreating forks"""
This reverts commit 73ca1a173c.
2014-02-07 20:38:20 -05:00
Michael DeHaan ad8c275887 Revert "While the previous work on the foon class can't be quite recycled, it's still a nice abstraction."
This reverts commit caab52aee2.
2014-02-07 20:38:18 -05:00
Michael DeHaan caab52aee2 While the previous work on the foon class can't be quite recycled, it's still a nice abstraction. 2014-02-07 19:32:19 -05:00
Michael DeHaan 73ca1a173c Revert "Revert "This patch makes Ansible reuse fork allocation between seperate instantations of the runner API, therefore the overhead of recreating forks""
This reverts commit 6685b4989e.
2014-02-07 18:14:27 -05:00
Michael DeHaan 6685b4989e Revert "This patch makes Ansible reuse fork allocation between seperate instantations of the runner API, therefore the overhead of recreating forks"
This reverts commit 85d66b9a0c.
2014-02-07 18:10:38 -05:00
Michael DeHaan 85d66b9a0c This patch makes Ansible reuse fork allocation between seperate instantations of the runner API, therefore the overhead of recreating forks
between tasks in a playbook is avoided.  The fork pool will be regenerated when a second play comes along and needs more hosts.
2014-02-07 16:53:35 -05:00
Richard Isaacson 2d88246c9d Merge pull request #5885 from risaacson/issue5739_4
Addresses #5739 and cleans up copy.py
2014-02-07 13:49:06 -06:00
Richard C Isaacson ac0a5c8ad5 Dug into the remaining FIXME and replaced with comments to document the expected behavior. 2014-02-05 11:39:22 -06:00
Richard C Isaacson a3261500dd Addresses #5739 and cleans up copy.py
The copy action_plugin is not easy to read. Part of this commit is taking that file, restructuring it, and adding comments. No functionality changed in how it interacts with the world.

The fix for #5739 ends up being the assumption that there is a cleanup 'rm -rf' that happens at the end of the copy loop. This was not the fact before and we made a bunch of tmp directories that we hoped would end up being cleaned up. Now we just use the tmp directory that the runner provides and cleanup inline if it is a single file to be coppied or after the loop if it is a recursive copy.

As a part of this we did end up having to change runner to provide a flag so that we could short the inline tmp directory removal. This flag defaults to True so it will not change the behavior of other modules that are being called.
2014-02-04 12:44:10 -06:00
James Tanner 5fafc61008 Fixes 5870 Template delegate hostname earlier in the process 2014-02-04 13:31:22 -05:00
James Tanner d355d3c698 Fixes #5818 Default to all known connection information for the delegate host 2014-02-03 16:59:30 -05:00
James Cammarata 75e3b59bbd Adding no_log: capability for tasks
Fixes #4088
2014-01-31 16:58:46 -06:00
Adam Heath aed2194b1d self.su_user is done earlier in the code path, and is auto-vivified from
su_user_var.  My last PR was only half merged, and when the bug fix for
the su/su_pass typo was merged, the removed line in this commit was
mistakenly reintroduced.
2014-01-28 11:04:24 -06:00
James Cammarata 88e2595a90 Fixing bug relating to su without an su_pass 2014-01-27 16:27:02 -06:00
Adam Heath fac7c6d3fe Allow su_user to be templated, same as sudo_user. 2014-01-27 16:27:02 -06:00
jeromew ef69d23715 Bug: chmod should be called only if the tmp dir was created in the first place 2014-01-22 14:04:39 +00:00
Thomas Omans 9343db69b4 Fixing whitespace 2014-01-21 12:44:36 -08:00
Thomas Omans ce0b5d16b3 Allow templates in ansible_sudo_pass inventory var
Template ansible_sudo_pass the same way we template ansible_ssh_pass.
2014-01-21 12:37:04 -08:00
James Tanner 61d283e2ad Fix merge conflicts from #5519 2014-01-21 13:35:06 -05:00
Paul Durivage f72f5a20df Revert "Revert "Merge pull request #5325 from angstwad/add-su-support""
This reverts commit c17d0e0357.

Conflicts:
	lib/ansible/runner/connection_plugins/paramiko_ssh.py
2014-01-20 19:19:03 -06:00
Jesse Keating 6013f0738e Store the list of hosts to run on in runner object
This reduces the number of times inventory.list_hosts is called, which
can be costly. When coming from a playbook that data is already known.
2014-01-20 16:22:28 -08:00
James Tanner c17d0e0357 Revert "Merge pull request #5325 from angstwad/add-su-support"
This reverts commit 6f4bfa2cff, reversing
changes made to c91ba3a7c7.
2014-01-20 16:10:11 -05:00
Paul Durivage 8cf071f697 Hostvars support for su 2014-01-20 12:01:28 -06:00
Paul Durivage 4088243deb Proposing fix for Issue #4324; adding support for su in connection plugins ssh, ssh_alt
Fixes for ssh_alt support, adding in references to in_data where appropriate
2014-01-20 11:25:10 -06:00
James Cammarata 02ce5af6df Added ANSIBLE_SSH_PIPELINING option to enable/disable pipelining support
Pipelining will be disabled by default, since it requires users remove
the 'requiretty' option from the servers sudoers configuration.
2014-01-16 12:41:33 -06:00
James Cammarata 233aae5861 Reverting paramiko_ssh/alt changes from yesterday 2014-01-16 09:45:28 -06:00
James Cammarata 36e6709771 Don't use pipelining when ANSIBLE_KEEP_REMOTE_FILES is enabled 2014-01-15 16:03:18 -06:00
James Cammarata df13b19fe1 Moving {ssh,paramiko}_alt connection types to be the defaults
The previous implementations will be kept for now as _old
2014-01-15 16:03:18 -06:00
James Cammarata c27db84e41 Adding paramiko_alt - pipelining support for paramiko connections 2014-01-15 16:03:17 -06:00
James Tanner 09e0d052ca Ensure sys.stdout has an istty method 2014-01-10 17:42:43 -05:00
James Tanner d7c8cf6ca7 Fixes #4958 Truncate printed stdout if it contains non-printable characters 2014-01-10 15:08:45 -05:00
jeromew c9b01febb3 Make sure 'tmp' is in the remote tmp dirname to ensure correct cleanup 2014-01-07 20:56:12 +00:00
Michael DeHaan 10350d1639 Update various copyrights. Not complete, but sufficient. 2014-01-04 13:32:04 -05:00
Michael DeHaan 8e5b7d3095 Remove code underlying when_* and only_if, which are deprecated features slated for removal in the 1.5 release. 2014-01-03 19:13:21 -05:00
James Tanner fc473b3246 Fixes #5146 Handle missing stdin when running under celery with rabbitmq or redis 2014-01-03 09:46:16 -05:00
dparalen 6bf5d664dc allow per-host sudo operation 2013-12-20 15:49:25 +01:00
jeromew 5c965a75f0 ssh_alt.py / decrease # of ssh roundtrips 2013-12-13 14:23:40 -05:00
Michael DeHaan 74e4ccb59b Revert "ssh_alt.py / decrease # of ssh roundtrips"
This reverts commit 7f8863f96d.
2013-12-10 19:23:52 -05:00
jeromew 7f8863f96d ssh_alt.py / decrease # of ssh roundtrips 2013-12-10 06:00:21 -05:00
Steve Smith 5b81f88c8f Cast the retrieved `retries` var to an int before incrementing as it may be in string form.
For example, the following method of calculating the value will result in a type error:

    appstatus_waitfor: 4  # Minutes
    appstatus_delay: 5 # seconds
    appstatus_retries: "{{ mins * 60 / delay }}"
2013-12-07 10:35:14 +01:00
Matt Martz 5f0f3566a6 Skipped only has 2 p's not 3 2013-12-03 15:42:34 -06:00
James Tanner b6879ca2bd Fixes #5030 compare connection user and sudo user and disable sudo if identical 2013-11-27 17:01:53 -05:00
James Tanner 903c4cae7b Fixes #5031 Template the delay value and cast to float for loops 2013-11-25 10:13:55 -05:00
jctanner 5c84d7e445 Merge pull request #5002 from ovcharenko/devel
Allow to specify ansible_ssh_private_key_file location related to user home directory
2013-11-22 06:39:07 -08:00
James Tanner 512ebdb971 Revert "Merge pull request #5001 from ovcharenko/devel"
This reverts commit d6c3103a00, reversing
changes made to b11f96eaa4.
2013-11-22 00:09:37 -05:00
Aleksey Ovcharenko 9af44b1b42 Update to 4 space indent 2013-11-22 04:20:14 +02:00
Aleksey Ovcharenko 30678e04ac Make tests happy 2013-11-22 04:06:10 +02:00
Aleksey Ovcharenko 2222f6df58 Allow to specify ansible_ssh_private_key_file location related to user home directory 2013-11-22 01:47:03 +02:00
jctanner 8d9b53b445 Merge pull request #4733 from sivel/4323-sudo-pass
Add ansible_sudo_pass hostvar support. Fixes #4323
2013-11-05 15:01:19 -08:00
James Tanner c1ed47933b Fixes #4485 add an ipv6 parameter to accelerate so that the daemon will bind to an ipv6 port instead of ipv4 2013-11-04 17:20:03 -05:00
Michael DeHaan 99687749a3 Merge pull request #4775 from steverweber/fix-4640
dont sudo if sudo_user is the same as the connection user
2013-11-01 15:27:55 -07:00
Steve Weber 5bd52796ec dont sudo if sudo_user is the same as the active user 2013-11-01 14:19:33 -04:00
Michael DeHaan d34a26e307 Undo an inadvertant revert from template changes so we still allow pythonic imports in module land. 2013-10-31 16:53:05 -04:00
Michael DeHaan 7b331ef6ed Fix code typo. I'll blame jet lag for now :) 2013-10-30 21:28:47 -04:00
Michael DeHaan 7201a6ffad Evaluate the conditional for each item for modules that normally try to group with_items results
like yum and apt.
2013-10-30 20:35:33 -04:00
James Tanner 078aaa95a2 Revert 1f6edf7d76 and re-enable passing lists to yum and apt 2013-10-30 20:17:17 -04:00
Matt Martz ea2ec6237a Add ansible_sudo_pass hostvar support 2013-10-30 13:18:35 -05:00
James Tanner d154bf8781 Revert templating enhancements from 73dbab70 e6c28658 d409352c 9858b1f2 4587528b 9b1fe455 214b0b05 8d3db803 7f9504d1 5031104c 35cb9dc2 2bd8cb57 1e85c754 2013-10-30 10:50:16 -04:00
James Tanner 9249cf578d Fixes #4572 Run until loop if until is set, ignoring result failures 2013-10-28 12:56:46 -04:00
Michael DeHaan 9858b1f2f3 Enable imports to work on a snippet based system, allowing for instance a library of common EC2 functions
to be reused between modules.  See library/system/service and library/system/ping for initial examples.  Can
work the old way to just import 'basic', or can import the new way to import multiple pieces of code from
module_utils/.
2013-10-26 11:09:30 -04:00
James Tanner 1f6edf7d76 Fixes #4665 and #4666 If task is conditional do not flatten items list for packaging modules 2013-10-25 13:46:41 -04:00
Serge van Ginderachter 6277e770a1 include basedir as 'playbook_dir' variable
closes #4246
2013-10-25 07:53:52 +02:00
Michael DeHaan 5031104c3a Finishing touches on template cleanup. 2013-10-19 11:40:48 -04:00
Gabe Mulley 84a57b7545 ensure non-root users can read arguments file when using sudo_user
Non-standard modules must read in the arguments file in order to access their arguments, however, when this file is transfered to the remote host it may only have the permissions 600.  This means that using sudo and sudo_user will result in permission denied errors when attempting to read the arguments file.

This patch fixes #4438 by explicitly forcing the arguments file to be world readable before executing the module.
2013-10-16 08:18:11 -04:00
jeromew dec364ae80 Template sudo_user via with_items 2013-10-10 09:22:26 +00:00
Michael DeHaan 19386c43a7 Merge 2013-10-07 10:02:21 -04:00
James Cammarata 994dfb84fc Minor pep8 cleanup and CHANGELOG update for do-until 2013-09-25 15:51:49 -05:00
James Cammarata 202c4f5294 Merge branch 'do_until_14' of https://github.com/bennojoy/ansible into bennojoy-do_until_14 2013-09-25 15:49:14 -05:00
bennojoy 70a9a797fa Fix for accelerate when ansible_ssh_user is specified 2013-09-25 19:24:54 +05:30
bennojoy 0e749611ac doc update and add attempts 2013-09-25 09:56:14 +05:30
bennojoy 21529de82e dountil feature commit 2 2013-09-24 15:23:01 +05:30
bennojoy 53e48b63a9 dountil feature commit 1 2013-09-24 13:59:38 +05:30
Michael DeHaan 319a0f9523 Merge pull request #4154 from mplonka/AIX_MD5
using AIX 'csum' command for generating MD5 checksums
2013-09-23 08:27:12 -07:00
Andrey Shorin cb4b964070 Allow for dynamic accelerate_port: and port: in plays 2013-09-23 13:33:36 +04:00