Commit Graph

54 Commits (ac7edef2be84d4d22081d33393f584fa89fdda4f)

Author SHA1 Message Date
Jesse Keating 8e38f7475f Do not set docker use to None. (#18706)
The user variable defaults to None, and was being passed in as a user
named None. This was breaking rsync unless a specific user was set.

Fixes 16306
9 years ago
Yannig 900b3ffcba Implement docker support for synchronize module. (#18145)
* Implement docker support for synchronize module.

Note : you need rsync installation on your docker container.
Have a look at https://github.com/ansible/ansible/issues/16306 for more details.
Support Ansible options for remote access.

* Give user name to docker command.
9 years ago
Brian Coca ca1514cf2a unified boolean function
optimized boolean function
fixes #17815
9 years ago
Matt Clay 0d46805979 Clean up shebangs for various files.
- Remove shebangs from:
  - ini files
  - unit tests
  - module_utils
  - plugins
  - module_docs_fragments
  - non-executable Makefiles
- Change non-modules from '/usr/bin/python' to '/usr/bin/env python'.
- Change '/bin/env' to '/usr/bin/env'.

Also removed main functions from unit tests (since they no longer
have a shebang) and fixed a python 3 compatibility issue with
update_bundled.py so it does not need to specify a python 2 shebang.

A script was added to check for unexpected shebangs in files.
This script is run during CI on Shippable.
9 years ago
Adrian Likins 2addc09050 cast/copy keys() to list to avoid py3 errors
In py3, dict.keys() is a view and not a copy of the
dicts keys, so attempting to delete items from the dict
while iterating over the keys results int

RuntimeError: dictionary changed size during iteration

Resolve by casting .keys() to a list() type.
9 years ago
peter.jang 0d94d39689 fix for rsync protocol support (#16756) 9 years ago
ovcharenko f326e49d75 Fix for issue @synchronize doesn't substitute variables properly #16347 (#16349)
* Fix for issue @synchronize doesn't substitute variables properly #16347
9 years ago
Toshio Kuratomi 16211e7dab Check that required arguments src and dest are present.
Fixes #16301
10 years ago
jctanner dc9b53a6aa Add further commentary about synchronize process_remote. (#16292)
Addresses #16284
10 years ago
Sergei Smolianinov 9753cac530 Fix synchronize module incorrect remote host processing. (#15993)
Fixes  #15539
10 years ago
Matt Martz a521b70217 Merge pull request #15306 from sivel/ansible-modules-core/issue/3370
Cascade ssh_*args configurations in synchronize
10 years ago
peter.jang 65856f2231 added suport rsync protocol (#12197)
* added suport rsync protocol

* use startswith method for safety
10 years ago
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 10 years ago
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
10 years ago
Toshio Kuratomi 0cabd133ba have to always run dwim() on the path to get the full absolute path.
Fixes #14944
10 years ago
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
10 years ago
Toshio Kuratomi f323eb858e nv_por is needed later in the file
Fixes #14654
10 years ago
Toshio Kuratomi fe278202f2 Fix saving of tracebacks on module failure 10 years ago
Toshio Kuratomi 2c825539ff When setting up the local connection for the rsync we need to set the shell as well.
Fixes #13490
10 years ago
Toshio Kuratomi 3f3e3e3d5b Return an error when synchronize is used with something other than an ssh connection
Suggested in #2832
10 years ago
Toshio Kuratomi cb2b19ced8 Fix for inventory hosts on localhost with alternate ports.
Fixes https://github.com/ansible/ansible-modules-core/issues/2831
10 years ago
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
10 years ago
Toshio Kuratomi d75e707af5 Simplify code a little 10 years ago
Joern Heissler 647b92a79b Use ansible_host in synchronize module
Fixes #13073
10 years ago
Jason O'Donnell 9dfa3719be Fixing typo 10 years ago
Toshio Kuratomi ca32d5bacc Potential fix for #12816 10 years ago
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
10 years ago
Toshio Kuratomi 5617f6aad4 Update synchronize to use the correct host when delegating
Fixes #12752
10 years ago
Toshio Kuratomi 45a161b0a1 Merge pull request #12429 from edmstudio/devel
Update synchronize module plugin to work on OS X
10 years ago
Petr Mifek 6e035a3e94 Move nested function test for ipv6 to top level in synchronize module. 10 years ago
James Cammarata 1e7fd2196d Fixing synchronize + delegate_to user bug
Fixes #12464
10 years ago
Petr Mifek 27f779a7cc Small clean up and refactor of the rsync target ipv6 observing formatter for synchronize action. 10 years ago
Petr Mifek 6f3f4dff7a Change synchronize module plugin to be backwards compatible with RSync 2.6.9 with regard to handling IPv6 addresses. 10 years ago
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.
10 years ago
Toshio Kuratomi 017bd7b1cd Fix synchronize lookup of localhost info 10 years ago
Thomas Quenolle c948af3b1e Synchronize fix error
Fix the error:
 "RuntimeError: dictionary changed size during iteration"
10 years ago
Brian Coca 961bee00d5 centralized the definition of 'localhost' 10 years ago
Brian Coca 950622cebd made sure they all look in files/vars/template dirs also when executed in play and not only from task 10 years ago
Toshio Kuratomi e7b5cb8782 Fix synchronize source path with roles and local connection
Fixes #8261
11 years ago
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)
11 years ago
Toshio Kuratomi ca941ec632 style cleanup because -ECANNOTUNDERSTAND without it 11 years ago
Toshio Kuratomi f86245dcb0 Add a warning about python3 in the synchronize plugin 11 years ago
Toshio Kuratomi f0431eaea9 Make ansible_python_interpreter work with synchronize
Fixes #11836
11 years ago
Toshio Kuratomi 0d72be3953 become protection for local connections no longer needed 11 years ago
Toshio Kuratomi d1933accc3 Fixes for synchronize with delegate_to 11 years ago
Brian Coca 9aa4214417 fixed delegate_to ref in syncronize 11 years ago
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
11 years ago
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
11 years ago
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
11 years ago
James Cammarata ee5e166563 Fixing ansible_*_interpreter use
Fixes ansible/ansible-modules-core#1459
11 years ago