Commit Graph

49 Commits (3ec043ec177d6ac5187f43052e34357890196315)

Author SHA1 Message Date
jeromew 69febcefde remove useless create/delete remote tmp dir roundtrip in copy module 2014-01-08 15:22:12 +00:00
Michael DeHaan 10350d1639 Update various copyrights. Not complete, but sufficient. 2014-01-04 13:32:04 -05:00
Stephen Fromm 833e1f6e2a Make sure action plugin copy cleans up tmp dir
The copy action plugin creates its own tmp dir for each file that it
copies to the target machine.  However, it does not clean up the
original tmp path it was given when run() is called.  This cleans up the
tmp path before it begins looping on source files.
2013-12-20 14:58:34 -08: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
James Tanner 33242cacf3 Merge pull request #4375 from pfalcon/ansible
copy: Implement recursive copying if src is a directory.
2013-11-13 15:52:40 -05:00
James Tanner 0faecdf7d1 Fixes #4653 Set dest on results for copy module even if using file module 2013-10-28 22:50:55 -04:00
Paul Sokolovsky 2e668f14f7 copy: Handle "no copy/propagate attrs only" for recursive mode well.
For this, add internal "original_basename" param to file module,
similar to copy module. (Param name is a bit misnormer now, should
be treated as "original basepath").
2013-10-15 18:40:40 +03:00
Paul Sokolovsky ce88df3cf4 copy: Handle dest path variations for recursive mode. 2013-10-15 18:40:39 +03:00
Paul Sokolovsky 6cf3975e2e copy: Set suitable default result for check mode. 2013-10-15 18:40:39 +03:00
Paul Sokolovsky 612b446856 copy: Don't modify input module_args in a recursive file handling loop. 2013-10-15 18:40:39 +03:00
Paul Sokolovsky b3b4f9885f copy: Implement recursive copying if src is a directory.
If src param to copy is a directory, all files under it are collected
and pushed one by one to target. Source dir path handled in a way
simalar to rsync: if it ends with slash, only inside contents of
directory are copied to destination, otherwise the dir itself is
copied (with all contents of course). Original idea and implementation
by https://github.com/ansible/ansible/pull/1809 . Rewritten to address
review comments and simplify/correct logic.
2013-10-15 18:40:39 +03:00
Michael DeHaan 4987c73bb6 Proper check for raw as module options versus raw being in the string. 2013-10-06 09:54:28 -04:00
Stoned Elipot f0743fc32a Introduce the 'always_run' task clause.
The 'always_run' task clause allows one to execute a task even in
check mode.

While here implement Runner.noop_on_check() to check if a runner
really should execute its task, with respect to check mode option
and 'always_run' clause.

Also add the optional 'jinja2' argument to check_conditional() :
it allows to give this function a jinja2 expression without exposing
the 'jinja2_compare' implementation mechanism.
2013-08-20 23:09:44 +02:00
Serge van Ginderachter 9991a530ab fix an encoding bug in copy content = lookup plugin
closes #3518
2013-08-10 17:37:04 -04:00
Michael DeHaan c07dd07767 Add raw copy support (raw=yes), tweak tempfile error message string. 2013-07-22 08:25:55 -04:00
Peter Hudec e8ff3c43ad fixed first_available_file and roles support
for copy and template action
2013-06-03 22:47:50 +02:00
Jeremiah Heller 7de718cd51 Fix copy when force=no and update _remote_md5 docs.
Previously setting force=no caused copy to subversively
fail when target did not exist on remote host.

Caused by Runner._remote_md5 returning 1
when files don't exist, rather than 0.
2013-05-29 10:14:47 -04:00
Dale Sedivec 515fd9e915 copy action plug-in check mode respects force=no
The copy action accepts force=no, which tells it not to replace an
existing file even if it differs from the source.  The copy action
plug-in wasn't respecting this option when operated in check mode, so it
would report that changes are necessary in check mode even though copy
would make no changes when run normally.

Runner._remote_md5 was changed to make the logic for setting rc perhaps
a little more clear, and to make sure that rc=0 when the file does not
exist.
2013-04-16 20:22:51 -04:00
Darryl Stoflet c63207bf75 Quick fix for first_available_file and roles 2013-04-11 20:40:23 -07:00
Michael DeHaan 81a926547c Some continued work on new-style templates and associated test code changes. Legacy template functions
are marked with "legacy_" for possible future removal.
2013-04-10 19:09:57 -04:00
Michael DeHaan b09ef21ec9 Add code to flag legacy templating like $foo.{bar} as deprecated in favor of Jinja2 {{ foo.bar }} so we
can remove the legacy system at a later date.
2013-04-10 17:52:35 -04:00
Michael DeHaan 892484812e Much requested feature -- allows relative imports of content within roles or relative to any task or handler include (../templates for template ../files for copy) 2013-04-06 12:13:04 -04:00
Michael DeHaan 3c5890f42b Ensure that when transferring a file to a directory the name of the file is the correct basename and not 'source'. 2013-03-25 22:19:35 -04:00
Michael DeHaan 6e2ea327d1 A very simple fix to enable spaces in the files sent via the copy module. 2013-03-11 17:11:53 -04:00
Michael DeHaan f2c8df2a93 Clarify an error message 2013-03-17 23:33:13 -04:00
Patrick Pelletier c7c7a63ee5 Add support to directly set content in copy module 2013-03-17 23:33:13 -04:00
Daniel Hokka Zakrisson 76f3351b02 Move complex_args templating to be with module_args
Keeps every action plugin from having to do the same thing.
2013-03-07 11:09:29 +01:00
Michael DeHaan ffbd4b5a2c Template options sooner on complex args copy 2013-03-07 00:35:40 -05:00
Michael DeHaan 2bb305f6d5 Fix args templating for complex args with the copy module. 2013-03-07 00:28:06 -05:00
Daniel Hokka Zakrisson ae8d6ac303 Ensure complex_args is considered in all action_plugins 2013-02-28 14:27:42 +01:00
Stoned Elipot 8816dc7ca7 Make diff header lines more explicit about what the diff is about
This gives a more readable output when producing diff for a task
with multiple items (with_items).
2013-02-26 16:53:59 +01:00
Stoned Elipot 10e9f1fc1e Implement --diff for the copy module. 2013-02-25 23:32:52 +01:00
Michael DeHaan 1ecf4a6943 Working on complex argument support. 2013-02-17 15:01:49 -05:00
Daniel Hokka Zakrisson 7e2999ed2d Add directory detection to _remote_md5 and use this in copy
If it is a directory, change the destination path by appending the
basename of the source file, like is done if the destination ends with a
/, and try to get the MD5 of the new path.
2013-02-12 22:39:05 +01:00
Michael DeHaan fed82c2188 This implements a basic --check mode which for now is only implemented on template & copy operations. More detail will be shared with the list
shortly.
2013-02-03 20:34:13 -05:00
Daniel Hokka Zakrisson 7782923ea2 Revert #1818 but avoid double-dwim, fixing relative fileglob 2013-01-09 14:52:52 +01:00
Dag Wieers b781438480 Clean up imports (taken from PR #1804) 2013-01-09 13:51:27 +01:00
Daniel Hokka Zakrisson f89f07871d Fix typo in first_available_file error path 2012-11-19 23:02:26 +01:00
Michael DeHaan cbc12f0dba Various performance streamlining and making the file features usable in all modules without daisy chaining. 2012-10-20 22:55:09 -04:00
Michael DeHaan 019f775a93 DWIM the paths for first_available_file 2012-10-20 11:11:31 -04:00
Daniel Hokka Zakrisson 519a1f3f23 Remove debug print statements 2012-10-17 22:45:17 +02:00
Michael DeHaan c5d2f6b0d3 implement lookup plugins for arbitrary enumeration over arbitrary things. See the mailing list for some cool examples. 2012-10-12 20:07:05 -04:00
Daniel Hokka Zakrisson 34f7e6ffa0 Pass module arguments as argument instead of keeping it in runner 2012-09-23 23:38:26 +02:00
Daniel Hokka Zakrisson cc948f339c Allow including files through variables
$FILE{file} will be replaced with the contents of "file"
$PIPE{cat file} will be replaced with the output of "cat file"
2012-09-19 17:57:17 +02:00
Michael DeHaan b8c4bb9e6e Revert "Allow including files through variables"
This reverts commit bf47bb4753.

Conflicts:

	lib/ansible/utils.py
	test/TestUtils.py
2012-09-19 10:31:23 -04:00
Daniel Hokka Zakrisson bf47bb4753 Allow including files through variables
$FILE{file} will be replaced with the contents of "file"
$PIPE{cat file} will be replaced with the output of "cat file"
2012-09-17 16:03:59 +02:00
Michael DeHaan 633e513a65 Modular server-side actions (squash merge) 2012-09-06 18:57:04 -04:00