Commit Graph

1113 Commits (e81d3ecc63346b6717416698c28cbf4a4056888e)

Author SHA1 Message Date
Michael DeHaan a24d3f78d9 Merge pull request #6634 from pilou-/fix
Remove print statements
2014-03-23 16:12:04 -04:00
James Cammarata 31628d86a1 Adding in a configurable option for the accelerate daemon timeout
This was apparently an oversite, as it has never been configurable
despite having a module parameter for the timeout.
2014-03-23 14:45:49 -05:00
James Cammarata 3ea5d573aa Acclerate improvements
* Added capability to support multiple keys, so clients from different
  machines can connect to a single daemon instance
* Any activity on the daemon will cause the timeout to extend, so that the
  daemon must be idle for the full number of minutes before it will auto-
  shutdown
* Various other small fixes to remove some redundancy

Fixes #5171
2014-03-23 14:45:49 -05:00
Pierre-Louis Bonicoli d3a470db0c Remove print statements
"print item" raises an exception when type of item is
jinja2.runtime.StrictUndefined
2014-03-23 03:58:44 +01:00
Michael DeHaan d0cbb51170 Merge pull request #6615 from 8191/devel
Addresses #6591 Hide diff for lineinfile if file did not change.
2014-03-21 10:46:29 -04:00
Manuel Faux b8158f5f6a Addresses #6591 Hide diff for lineinfile if file did not change. 2014-03-21 08:40:38 +01:00
Joshua Conner 1c504eff68 etcd lookup: use $ANSIBLE_ETCD_URL if it exists in the env 2014-03-20 15:16:28 -07:00
James Tanner ea5186ca63 Fixes #6590 add set_remote_user parameter to synchronize
This allows usage of custom ssh configs for remote hosts where
the inventory user does not match the configured user.
2014-03-20 13:56:07 -04:00
James Cammarata c9fcbf7bdd Change print message to vvv for missing known hosts in ssh.py 2014-03-18 12:26:10 -05:00
James Tanner 49807877fa Fixes #6550 Use shell for pipe lookup subprocess.popen calls 2014-03-18 12:21:26 -04:00
Michael DeHaan 94e3350b38 Catch a unquoted line error. Fixes #6532 2014-03-17 17:15:42 -04:00
James Tanner 20262b6c15 Remove unused variable in _executor_internal 2014-03-17 15:53:48 -04:00
James Tanner ebb6b8442b Catch unicode unescape failures in copy action plugin 2014-03-17 12:14:29 -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
Michael DeHaan 3d44f7cd51 Merge pull request #6217 from ashokrajar/patch-1
pause plugin doesn't flush raw_input prompt
2014-03-16 12:32:58 -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
brdo 3963a64a4f Set keepalive to 5 seconds in paramiko_ssh.py
This update resolves https://github.com/ansible/ansible/issues/6476.
2014-03-15 11:18:47 -07:00
James Cammarata 6c25e78299 Merge branch 'devel' of https://github.com/dparalen/ansible into dparalen-devel 2014-03-11 15:34:15 -05:00
James Tanner e4e64a9699 Rename lxc to libvirt_lxc 2014-03-11 16:16:24 -04:00
James Cammarata bca6adc812 Merge pull request #4064 from mscherer/lxc
Add a plugin that permit to use ansible for lxc system, using libvirt
2014-03-11 15:12:51 -05:00
James Tanner ba0fec4f42 Force command action to not be executed by the shell unless specifically enabled 2014-03-10 16:13:30 -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
James Cammarata 9b79591f23 Merge branch 'devel' of https://github.com/aresch/ansible into aresch-devel 2014-03-06 15:17:55 -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
James Cammarata 9f2999df79 Un-escape newlines in delimiters for assemble module 2014-03-06 09:44:56 -06:00
aresch 23a0468a4b Fix respecting remote_tmp when sudo is used 2014-03-05 16:25:42 -08:00
James Tanner 4e8ed92130 Fixes #6077 decode escaped newline characters in content for the copy module 2014-03-05 18:49:54 -05:00
James Tanner 6129ea7566 Fixes #6298 and adds a sudo unit test for synchronize 2014-03-05 14:51:40 -05: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 92aacb198c Merge pull request #6156 from iiordanov/devel
Add support for checking host against global known host files.

The effect of this is that before this fix if files are spread across the known_hosts file but not in the ~/known_hosts file the hosts will execute sequentially. This PR augments the functionality so that all of the knowns hosts will execute in parallel.
2014-03-03 23:51:51 -06: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
Tefnet c652802d29 missing import in assert module
Fixed missing ansible.errors import in assert module
2014-03-02 00:59:17 +01: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
Ashok Raja R cb3c6417dd pause plugin doesn't flush raw_input prompt
##### Issue Type:

Bugfix Pull Request

##### Ansible Version:

ansible 1.4.3

##### Environment:

N/A

##### Summary:

We are using a wrapper python script to run ansible-playbook. We use subprocess to execute and print the stdout as and when its written. Problem is when we use pause it doesn't display the prompt string as raw_input does not flush stdout before reading from stdin.

It looks like a dirty fix to add "\n" to the prompt string but i don't see any other way to over come this. If anyone else have a better fix please do propose/suggest.

##### Steps To Reproduce:

```yaml
#File: test_play.yml
- name: Test
  hosts: $nodes
  gather_facts: false

  tasks:
    - name: Waiting for User
      local_action: pause prompt="Do you want to continue (yes/no)? "
```

```python
#!/usr/bin/env python
#File: test.py
import shlex, subprocess

def run_process(process):
    process = process.encode("utf-8")
    command = shlex.split(process)
    p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    for line in iter(p.stdout.readline, b''):
        print line,

cmd = "/usr/bin/python -u /usr/bin/ansible-playbook -i hosts.txt test_play.yml -e 'nodes=local'"
run_process(cmd)
```

```
shell $ python test.py
```

##### Expected Results:
```
PLAY [Test] *******************************************************************

TASK: [Waiting for User] ******************************************************
[localhost]
Do you want to continue (yes/no)? :
```

##### Actual Results:
```
PLAY [Test] *******************************************************************

TASK: [Waiting for User] ******************************************************
[localhost]
```
2014-02-28 11:28:38 +05:30
James Cammarata df9de6ea71 Expand the source path in the action plugin when not using a remote source
Fixes #6209
2014-02-27 12:50:35 -06: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
Michael DeHaan cd7d7eb1bc Merge pull request #6202 from muffl0n/unarchive_destdir
unarchive: output dest in error-message
2014-02-27 10:36:10 -05:00
muffl0n 17946b23d5 output dest in error-message 2014-02-27 13:29:26 +01:00
James Cammarata 2a383786dd And remove the expanduser calls from the action_plugin 2014-02-26 15:29:00 -06:00
James Cammarata 96f1c3ce2e Move where the expanduser call is made, to avoid issues with None 2014-02-26 12:33:17 -06:00
James Cammarata e659d55d62 Merge branch 'devel' of https://github.com/muffl0n/ansible into muffl0n-devel 2014-02-26 12:28:26 -06:00
Michael DeHaan 33857855ad removing some unusued files. Paramiko alt was an experiment to attempt pipeline for paramiko, ssh_old is the non-pipelining-supported earlier
version of the OpenSSH transport, which is configurable now and unified.
2014-02-26 11:26:52 -05:00
Richard C Isaacson af616fe15e Rename flatten funciton.
flatten(x) is used a lot in the various lookup plugins where in each it is slightly different. This is to make this name slightly more unique.
2014-02-25 14:59:06 -06:00
Kent R. Spillner 1fcc9ff666 lookup_plugins: loop over hashes
Create a lookup plugin named dict that can be used to loop over hashes.
It converts a dict into a list of key-value pairs, with attributes named
"key" and "value."  Also adds a brief explanation and simple example to
the docs.

Signed-off-by: Kent R. Spillner <kspillner@acm.org>
2014-02-25 11:20:15 -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 9209581565 Fixes #6155 Inject checkmode into synchronize module args 2014-02-25 08:58:58 -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
Iordan Iordanov a1854bb762 Add support for checking host against global known host files. 2014-02-24 16:05:03 -05:00
James Cammarata 3b2d409906 Fixing several bugs in assemble and updating tests
Bugfixes:
* the remote_src param was not being converted to a boolean correctly,
  resulting in it never being used by the module as the default behavior
  was remote_src=True (issue #5581)
* the remote_src param was not listed in the generic file params, leading
  to a failure when the above bug regarding remote_src was fixed
* the delimiter should always end with a newline to ensure that the file
  fragments do not run together on one line

Fixes #5581
2014-02-24 14:27:23 -06: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
Richard C Isaacson 8be8dbc9ed Formatting cleanup. 2014-02-24 11:11:47 -06:00
Richard C Isaacson aaf0a182e1 Merge remote-tracking branch 'jeromew/ansible_script_creates' into issues_4986 2014-02-24 10:16:39 -06:00
James Tanner 4af1d6098b Fixes #5939 Allow for delegate hosts that are not in inventory 2014-02-21 15:54:09 -05:00
Michael DeHaan bc65956798 Add tests that leverage most of our custom filters. A few more to add. 2014-02-20 15:24:03 -05:00
James Cammarata f5505425f9 Adding 'expanduser' filter to the core filters list
Example usage: {{ my_path | expanduser }} # my_path: "~/path/to/file"
2014-02-20 13:48:07 -05:00
James Cammarata ef2df8157a Fixup result dictionary when copy module calls file module 2014-02-19 18:05:59 -05:00
muffl0n b0f00cc097 already call expanduser in action_plugin 2014-02-19 21:41:57 +01:00
muffl0n 5f0e882d01 call expanduser for src and dest 2014-02-19 21:30:53 +01:00
root 0df166e7c0 Copy tests WIP, fix bug in assert module upgrades where the wrong value was being checked. 2014-02-19 14:36:54 -05:00
James Cammarata 54117ab28f Modified assert module to take tests as an array 2014-02-19 14:05:03 -05:00
Richard Isaacson dc403eb21e Merge pull request #6058 from jctanner/vault_squashed_2
Ansible vault: a framework for encrypting any playbook or var file.
2014-02-19 11:39:55 -05:00
James Tanner 3fc87e011b Fix all other calls to yaml 2014-02-19 11:01:21 -05:00
James Tanner 427b8dc78d Ansible vault: a framework for encrypting any playbook or var file. 2014-02-18 15:35:12 -05:00
Richard C Isaacson 1ac19cb981 Copy action_plugin: encode content when dict.
When content is processed and found to be valid JSON it is decoded into a dict. To write it out to a file we need to encode it back into a string.

Addresses GH-5914.
2014-02-18 13:23:44 -06:00
James Cammarata f29ce80d12 Default port to 22 for paramiko when it is unset 2014-02-18 09:53:24 -06:00
jeromew 7a14cb61c4 Add creates= and removes= to the script: action 2014-02-18 12:52:09 +00:00
Niku Toivola 6cc9b16f06 allow templating of ansible_ssh_private_key_file also in the synchronize module 2014-02-18 11:32:33 +02: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
James Cammarata 788ac51185 Sanitize sudo success_key from stdout for raw/script modules
Fixes #5533
Closes #5605
Closes #5606
Closes #5607
2014-02-17 12:47:47 -06:00
Michael DeHaan c91ceddfac Add the start of an integration test structure using Ansible playbooks, also added an assert action plugin to make writing those easier. 2014-02-13 18:28:29 -05:00
Brian Coca 31b5728618 directory detection should now work on BSDs, added AIX alternate path 2014-02-13 08:23:56 -05:00
Richard Isaacson eb4a730933 Merge pull request #5969 from risaacson/pull_5136
Updates for the unarchive module and action_plugin.
2014-02-12 10:10:25 -06:00
Richard C Isaacson 598b9c6b7c Cleanup per notes.
Some small changes to per notes from @mpdehann.
2014-02-12 10:01:10 -06:00
Richard C Isaacson cb7c2b7524 Updates for the unarchive module and action_plugin.
There is a bit going on with the changes here. Most of the changes are cleanup of files so that they line up with the standard files.

PR #5136 was merged into the current devel and brought up to working order. A few bug fixes had to be done to get the code to test correctly. Thanks out to @pib!

Issue #5431 was not able to be confirmed as it behaved as expected with a sudo user.

Tests were added via a playbook with archive files to verify functionality.

All tests fire clean including custom playbooks across multiple linux and solaris systems.
2014-02-12 01:57:00 -06:00
Jacob Weber 35742fe008 Add regex_replace jinja2 filter 2014-02-11 22:02:53 -08:00
Richard C Isaacson e6c9705058 Merge remote-tracking branch 'pib/unarchive_remote' into pull_5136 2014-02-11 22:55:34 -06:00
James Tanner 9ce46e5f41 Refactor the synchronize action plugin and add unit tests 2014-02-10 23:39:17 -05:00
Richard C Isaacson 786e3d2fd2 Refining the fix made in #5885.
It turns out that some of the assumptions in #5885 were slightly off. The previous fix relied on a call to the module to creat a tmp_path. This is insufficent as there are few cases that we need to have the tmp directory before we make the module call. If we don't have a tmp_path before we do a recursive call or when we find a file that does not match the remote md5 hash we need to create a tmp directory. Also we are not more percise when we will need to clean up the remote tmp_path.
2014-02-08 02:25:42 -06:00
Michael DeHaan 1609dfbca4 Revert "Revert "Revert "Add the fork manager code (related to previous patch)."""
This reverts commit 60d3611b70.
2014-02-07 20:38:24 -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 60d3611b70 Revert "Revert "Add the fork manager code (related to previous patch).""
This reverts commit c53538dc77.
2014-02-07 18:14:13 -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 c53538dc77 Revert "Add the fork manager code (related to previous patch)."
This reverts commit adb1719fe8.
2014-02-07 18:10:29 -05:00
Michael DeHaan adb1719fe8 Add the fork manager code (related to previous patch). 2014-02-07 16:53:35 -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
Luca Berruti 75b7a1d9c7 Fix slow ssh
We break the read while loop after waiting "the end of the process" and
the pipes are empty, otherwise we do another select that waits all the
timeout.
2014-02-05 09:45:03 +01: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
Timur Batyrshin 658c15930e reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852) 2014-02-03 13:00:40 -06:00
James Cammarata 2d0e9cd75d Revert "Fix for issue 5739. The copy module does not delete directories it will only unlinks symlinks."
This reverts commit b20dc4f578.
2014-02-03 12:54:52 -06:00
James Cammarata 9ff99acaff Merge branch 'issue5739_3' of https://github.com/risaacson/ansible into risaacson-issue5739_3 2014-02-03 09:52:50 -06:00
Brian Coca ff024b65b2 now with_items also accepts sets
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2014-02-01 17:55:38 -05:00
Richard C Isaacson b20dc4f578 Fix for issue 5739. The copy module does not delete directories it will only unlinks symlinks. 2014-01-31 17:19:44 -06:00
James Cammarata 75e3b59bbd Adding no_log: capability for tasks
Fixes #4088
2014-01-31 16:58:46 -06:00
James Tanner e6aeb191d5 Revert "Merge branch 'slow_ssh' of git://github.com/lberruti/ansible into lberruti-slow_ssh"
This reverts commit fe091ec00d, reversing
changes made to aed2194b1d.
2014-01-30 16:02:05 -05:00
James Cammarata 9574f89471 Detect remote_user change in accelerate daemon and allow a restart
Fixes #5812
2014-01-30 14:40:41 -06:00
jctanner 6c25ea1b91 Merge pull request #5527 from sergevanginderachter/basedirdwim
path_dwim: fix when basedir not set
2014-01-30 10:54:19 -08:00
Michael DeHaan d07a3b5e9b AnsibleWorks -> Ansible 2014-01-28 20:29:42 -05:00
Heikki Hokkanen b6875b3b87 Fix .ssh/known_hosts path expansion.
In particular, do not rely on the $USER environment variable always existing.
tmux for example seems to clear it, causing lots of invalid messages:
"previous known host file not found"

This broke in commit 80fd22dc, but instead of reverting that commit, we now
fall back to expanding just ~ when $USER is not set.
2014-01-28 15:11:44 -06:00
James Tanner fe091ec00d Merge branch 'slow_ssh' of git://github.com/lberruti/ansible into lberruti-slow_ssh 2014-01-28 13:06:07 -05: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
James Cammarata 3fddd78ec5 Fixing traceback caused by incorrect argument passing to json.dumps
Fixes #5756
2014-01-27 11:28:07 -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
Paul Durivage 4c84ba74b0 Resolve su bug in paramiko libs 2014-01-20 19:16:37 -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 d21281ff43 Resolve rebase conflicts 2014-01-20 11:46:05 -06:00
Paul Durivage ab6ee1a282 Enable su support in paramkio; disable su support in fireball, local, accelerate, chroot, jail, funcd connection plugins 2014-01-20 11:25:10 -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
Michael Scherer 5c5c8fd7ce Make synchronize module work better with local transport, fix #5668 2014-01-17 17:32:36 +01: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
jctanner 91c5c9da08 Merge pull request #5465 from deonbredenhann/false_mandatory_variable
Treat a False mandatory variable as defined.
2014-01-14 14:15:52 -08:00
jctanner 671b0454c6 Merge pull request #4987 from jpmens/lookup-csvfile
New lookup plugin csvreader
2014-01-14 07:17:52 -08: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
Luca Berruti ae543eecab Simplified p.poll handling 2014-01-10 11:34:21 +01:00
James Tanner c408bcea31 Update sshpass hostkey error message 2014-01-08 17:25:50 -05:00
James Tanner 0b64408f5a Fixes #5531 Give the user a better error message when sshpass does not know the remote hostkey 2014-01-08 16:50:40 -05:00
jeromew 69febcefde remove useless create/delete remote tmp dir roundtrip in copy module 2014-01-08 15:22:12 +00:00
Serge van Ginderachter 836fb4143c path_dwim: fix when basedir not set 2014-01-08 02:21:10 +01:00
jeromew c9b01febb3 Make sure 'tmp' is in the remote tmp dirname to ensure correct cleanup 2014-01-07 20:56:12 +00:00
smoothify 93a55e8dff Don't override sudo if transport is set to local.
https://github.com/ansible/ansible/pull/5251
2014-01-04 23:32:25 +00:00
Michael DeHaan 1c632af2c9 Merge pull request #5468 from jeromew/ansible_ssh_alt
fix issue #5372 on ssh_alt: accept -K option for a user with NOPASSWD
2014-01-04 10:55:58 -08: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
James Tanner cb2214d6f8 Fixes #4935 Synchronize module: set destination to an fqdn if connection is not local, and abide by ansible_remote_user 2014-01-02 14:58:12 -05:00
jctanner 99560e3902 Merge pull request #5047 from sergevanginderachter/synch_template_ansiblesshhost
synchronize: allow ansible_ssh_host to be templated
2014-01-02 09:05:14 -08:00
jeromew b2cd4a62de fix issue #5372 on ssh_alt: accept -K option even for a user with NOPASSWD 2013-12-31 14:29:46 -05:00
Deon Bredenhann c85aac8b17 Treat a False mandatory variable as defined. 2013-12-31 13:41:40 +02:00
Deon Bredenhann 4f1f13b100 Remove trailing space 2013-12-31 13:40:21 +02:00
Levi Gross dc6a26123b
Fixed syntax error and removed unused imports 2013-12-25 11:04:47 -05:00
Michael DeHaan 643690ffec Remove depedency of lookup plugin on setting in ansible.cfg 2013-12-21 08:49:08 -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
dparalen 6bf5d664dc allow per-host sudo operation 2013-12-20 15:49:25 +01:00
jeromew e4a3f49fa2 ssh_alt - only trigger 'fatal' when returncode == 255 (interpreted as 'could no connect') 2013-12-17 11:42:00 -05:00
jeromew 5c965a75f0 ssh_alt.py / decrease # of ssh roundtrips 2013-12-13 14:23:40 -05:00
Jesse Keating 8cef210aea Make sure ssh pipes are empty before moving on
Resolves issue #5082

Code as it was would hit a scenario where one of the FDs was not ready for
reading the first time through -- but p.poll() would show the process as
complete. This would cause ansible to continue on, while leaving some content
left in a pipe.

The other scenario -- the one that causes the unclosed quote, is if we go
through select.select() and we do get stdout in the ready for reading -- we
read from it (9000 bytes), but that's not all that is there. Again we'd get to
the p.poll() check and it would be indeed not none, but we would have left some
of stdout on the FD and thus the json blob would be malformed.

Tested with and without full ssh debugging.
Tested with and without ControlPersist
Tested with and without ControlPersist sockets already created
2013-12-11 21:32:37 -08:00
Michael DeHaan 929f8a5c93 Had to revert commits due to async. 2013-12-10 19:24:08 -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
jeromew db182ba498 copy ssh.py to ssh_alt.py 2013-12-09 14:11:29 -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
jctanner 7aa35d64c2 Merge pull request #5091 from EspadaV8/5089_assemble_fix
#5089 hack-fix assemble module
2013-12-04 10:13:16 -08:00
Paul Bonser 58acd8cce1 If there is no tmp_src, don't modify the args 2013-12-03 18:59:50 -06:00
Paul Bonser 4afcd50487 properly convert arg into boolean 2013-12-03 18:46:37 -06:00
Matt Martz 5f0f3566a6 Skipped only has 2 p's not 3 2013-12-03 15:42:34 -06:00
James Tanner d227614529 Fixes #5109 synchronize module ssh port
Added a parameter for dest_port and also check ansible_ssh_port inventory variable.
2013-12-03 14:48:20 -05:00
Paul Bonser 5626efba7e Optionally unarchive a file already on the remote machine 2013-12-02 19:51:10 -06:00
Andrew Smith eed32ea70c dest_contents isn’t always defined, so don’t pass it around
I think this is also a bit of a hack since it should probably be set
before being used, I’m just not sure what it should be set to.
2013-11-28 10:59:51 +10:00
Andrew Smith e2d03173d2 The file module doesn’t have it’s module_args reset
I believe that this should be reset in the same way that the copy module
does
2013-11-28 10:58:14 +10:00
Andrew Smith 7b01c83159 Passing in complex_args throws ‘unsupported parameter for module’ errors
When using assemble only params (e.g. remote_src) the copy (and I’m
guessing file) modules throw an error that the param isn’t supported.
Simply removing the complex_args param fixes it for me, but I’m not sure
that’s the correct thing to do
2013-11-28 10:55:35 +10:00
Andrew Smith da44a7f0cb I think that resultant is meant to be the contents of the combined file
It is used for the transfer and as a diff param but isn’t actually
defined anywhere before it’s used. This seemed like the least bad place
to set it.
2013-11-28 10:53:00 +10:00
Andrew Smith 4503413baa ReturnData is used throughout but not actually imported 2013-11-28 10:51:04 +10:00
Andrew Smith 7d007cac16 Correct the invocation of ‘_assemble_from_fragments’ 2013-11-28 09:44:14 +10:00
jctanner 920bc6e75b Merge pull request #5086 from j2sol/fix-accelerate_inventory
Avoid a traceback when using accelerate
2013-11-27 14:46:12 -08: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
Jesse Keating 5522d489e3 Avoid a traceback when using accelerate
This bit of code is attempting to access accelerate_inventory_host,
which may not have been set/created. This will cause a traceback.
Instead use getattr with a fallback to False.
2013-11-27 13:58:11 -08:00
James Tanner 12ed39ef7b Fixes #5056 Append new hosts to the groups cache 2013-11-27 13:04:31 -05:00
Brian Coca 65885feeeb fixed typo for assemble function 2013-11-26 08:30:28 -05:00
James Tanner b8146e3bc7 Fixes #4979 Check for the correct context when inside the inventory_hostnames plugin 2013-11-25 10:57:10 -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
Serge van Ginderachter 2f9470ec1d synchronize: allow ansible_ssh_host to be templated
This is already enabled in the runner also.
2013-11-25 15:33:04 +01:00
James Tanner bca2634d54 Fix missing eval for string search in ssh controlpersist 2013-11-22 12:22:53 -05:00
James Tanner a16fe923ed Addresses #5011 check for proper string in smartos ssh error output 2013-11-22 12:13:24 -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
Jan-Piet Mens 252a51be91 New lookup plugin csvreader 2013-11-21 09:39:52 +01:00
James Tanner b815a09529 Fix pep8 error in password lookup 2013-11-19 16:36:18 -05:00
James Tanner e81c976636 Fix pep8 errors in unarchive module 2013-11-19 16:35:06 -05:00
jctanner 68afd9da9f Merge pull request #4866 from sergevanginderachter/known_hosts_sudo
Check real user's known_hosts when sudo ansible...
2013-11-19 12:13:24 -08:00
Brian Coca 34c33f7ea1 now correctly spell symmetric
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-11-19 14:48:11 -05:00