Commit Graph

45 Commits (587d3c368b210d33cde011b4e0121c95182cab75)

Author SHA1 Message Date
Sergei Smolianinov 9753cac530 Fix synchronize module incorrect remote host processing. (#15993)
Fixes  #15539
2016-06-14 19:37:26 -04:00
Matt Martz a521b70217 Merge pull request #15306 from sivel/ansible-modules-core/issue/3370
Cascade ssh_*args configurations in synchronize
2016-05-12 18:59:37 -05:00
peter.jang 65856f2231 added suport rsync protocol (#12197)
* added suport rsync protocol

* use startswith method for safety
2016-04-08 11:42:07 -04:00
Matt Martz bce79c67c3 Cascade ssh_*args configurations in synchronize instead of limiting to just ssh_args. See https://github.com/ansible/ansible-modules-core/issues/3370 2016-04-06 10:27:58 -05:00
Toshio Kuratomi 0fffb6c60c Merge pull request #15163 from ansible/synchronize-connection-vs-play_context
Use _connection instead of _play_context for information about the connection
2016-03-27 10:24:46 -07:00
Toshio Kuratomi 0cabd133ba have to always run dwim() on the path to get the full absolute path.
Fixes #14944
2016-03-25 12:09:30 -07:00
Toshio Kuratomi e2f5762232 Use _connection instead of _play_context for information about the connection
If we're not delegating then we change _connection into a local
connection midway through the file but we don't change
_play_context.connection (no need to alter that).  When we later check
it in process_remote() we need to know the actual connection, not the
connection that we thought we were going to use at the start of run().
So we have to use _connection.transport in process_remote().  The rest
of the places could use either one (because we have not yet changed to
a local connection) but we go ahead and switch those to
_connection.transport as well to avoid confusion in the future.

Fixes https://github.com/ansible/ansible-modules-core/issues/3136
2016-03-25 09:25:19 -07:00
Toshio Kuratomi f323eb858e nv_por is needed later in the file
Fixes #14654
2016-03-24 06:58:56 -07:00
Toshio Kuratomi fe278202f2 Fix saving of tracebacks on module failure 2016-03-15 20:31:40 -07:00
Toshio Kuratomi 2c825539ff When setting up the local connection for the rsync we need to set the shell as well.
Fixes #13490
2016-01-28 16:02:57 -08:00
Toshio Kuratomi 3f3e3e3d5b Return an error when synchronize is used with something other than an ssh connection
Suggested in #2832
2016-01-27 12:48:15 -08:00
Toshio Kuratomi cb2b19ced8 Fix for inventory hosts on localhost with alternate ports.
Fixes https://github.com/ansible/ansible-modules-core/issues/2831
2016-01-26 13:53:42 -08:00
Toshio Kuratomi 3cf59d30f7 For synchronize, fix sudo to execute on the remote end of the connection
* In 2.0.0.x become was reversed for synchronize. It was happening on
  the local machine instead of the remote machine. This restores the
  ansible-1.9.x behaviour of doing become on the remote machine.
  However, there's aspects of this that are hacky (no hackier than
  ansible-1.9 but not using 2.0 features).  The big problem is that it
  does not understand any become method except sudo.  I'm willing to use
  a partial fix now because we don't want people to get used to the
  reversed semantics in their playbooks.
* synchronize copying to the wrong host when inventory_hostname is
  localhost
* Fix problem with unicode arguments (first seen as a bug on synchronize)

Fixes #14041
Fixes #13825
2016-01-25 19:33:31 -08:00
Toshio Kuratomi d75e707af5 Simplify code a little 2015-11-19 09:55:06 -08:00
Joern Heissler 647b92a79b Use ansible_host in synchronize module
Fixes #13073
2015-11-08 13:15:16 +01:00
Jason O'Donnell 9dfa3719be Fixing typo 2015-10-26 17:13:49 -04:00
Toshio Kuratomi ca32d5bacc Potential fix for #12816 2015-10-23 13:38:44 -07:00
Toshio Kuratomi 2e87c1f74e Two fixes to action plugins
* Fix the task_vars parameter to not default to a mutable type (dict)
* Implement invocation in the base class's run() method have each action
  module call the run() method's implemention in the base class.
* Return values from the action plugins' run() method takes the return
  value from the base class run() method into account so that invocation
  makes its way to the output.

Fixes #12869
2015-10-22 16:07:26 -07:00
Toshio Kuratomi 5617f6aad4 Update synchronize to use the correct host when delegating
Fixes #12752
2015-10-14 18:57:10 -07:00
Toshio Kuratomi 45a161b0a1 Merge pull request #12429 from edmstudio/devel
Update synchronize module plugin to work on OS X
2015-10-09 16:05:46 -07:00
Petr Mifek 6e035a3e94 Move nested function test for ipv6 to top level in synchronize module. 2015-10-10 00:01:22 +02:00
James Cammarata 1e7fd2196d Fixing synchronize + delegate_to user bug
Fixes #12464
2015-09-22 16:06:52 -04:00
Petr Mifek 27f779a7cc Small clean up and refactor of the rsync target ipv6 observing formatter for synchronize action. 2015-09-18 11:46:33 +02:00
Petr Mifek 6f3f4dff7a Change synchronize module plugin to be backwards compatible with RSync 2.6.9 with regard to handling IPv6 addresses. 2015-09-17 23:19:11 +02:00
Gaurav Jain 6c107258fa Fix rsync connections to IPv6 addresses
Similar to https://github.com/ansible/ansible/pull/11816 we can unconditionally
wrap the host address in square brackets. This is required by rsync for IPv6
addresses.
2015-09-06 22:20:45 -07:00
Toshio Kuratomi 017bd7b1cd Fix synchronize lookup of localhost info 2015-08-26 13:36:50 -07:00
Thomas Quenolle c948af3b1e Synchronize fix error
Fix the error:
 "RuntimeError: dictionary changed size during iteration"
2015-08-26 11:01:00 +02:00
Brian Coca 961bee00d5 centralized the definition of 'localhost' 2015-08-19 15:49:37 -04:00
Brian Coca 950622cebd made sure they all look in files/vars/template dirs also when executed in play and not only from task 2015-08-16 02:37:21 -04:00
Toshio Kuratomi e7b5cb8782 Fix synchronize source path with roles and local connection
Fixes #8261
2015-08-05 13:32:12 -07:00
Toshio Kuratomi 308bf80055 Cleanups to synchronize including:
* Better comments
* Reorganize code so related settings are close to each other
* Add ::1 to the "localhost" patterns we look for
* Make the dest_port parameter override the ansible_ssh_port setting
* Fix dest_port (wasn't being set)
* more complete detection of delegate_to
* Fix set_remote_user (wasn't being looked for in parameters)
* Instead of removing mode here, have the ansible module accept it
  (better documents the parameters doing it htat way)
2015-08-05 13:16:08 -07:00
Toshio Kuratomi ca941ec632 style cleanup because -ECANNOTUNDERSTAND without it 2015-08-03 15:05:26 -07:00
Toshio Kuratomi f86245dcb0 Add a warning about python3 in the synchronize plugin 2015-08-03 15:05:26 -07:00
Toshio Kuratomi f0431eaea9 Make ansible_python_interpreter work with synchronize
Fixes #11836
2015-08-03 13:32:24 -07:00
Toshio Kuratomi 0d72be3953 become protection for local connections no longer needed 2015-07-31 18:26:30 -07:00
Toshio Kuratomi d1933accc3 Fixes for synchronize with delegate_to 2015-07-31 17:41:41 -07:00
Brian Coca 9aa4214417 fixed delegate_to ref in syncronize 2015-07-30 20:53:18 -04:00
Toshio Kuratomi 088682f518 Synchronize in wasn't running on localhost in the default case which meant that rsync was run on the wrong host.
Fixes #11649
2015-07-29 09:10:24 -07:00
Toshio Kuratomi b06353791c Don't pass mode from synchronize action plugin to the ansible module
Fixes https://github.com/ansible/ansible-modules-core/issues/1783
2015-07-23 00:42:27 -07:00
James Cammarata e64989beb4 Moving ConnectionInformation -> PlayContext
Also making PlayContext a child class of the Playbook Base class,
which gives it access to all of the FieldAttribute code to ensure
field values are correctly typed after post_validation

Fixes #11381
2015-07-21 12:13:50 -04:00
James Cammarata ee5e166563 Fixing ansible_*_interpreter use
Fixes ansible/ansible-modules-core#1459
2015-06-04 15:43:07 -04:00
James Cammarata 198476e345 Cleaning up some portions of synchronize action plugin (v2) 2015-05-07 13:06:51 -05:00
Matt Martz 88e8ecb620 Actually get the synchronize action plugin to work 2015-05-07 12:27:30 -05:00
Matt Martz 4f4df29cb0 Add ability to specify using ssh_args in synchronize for v2 2015-05-07 11:38:15 -05:00
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00