Commit Graph

970 Commits (1f4e082c9d3671bd21d73668e71b16cb6228f12d)

Author SHA1 Message Date
James Tanner 88462729aa Addresses #6708 fill in missing keywords for ssh.py _communicate 2014-03-26 15:55:54 -04:00
jctanner 7dc3dc5279 Merge pull request #6708 from sivel/put-file-control-master
Share p.communicate alternative logic between exec_command and put_file
2014-03-26 15:02:14 -04:00
James Cammarata e09313120c Make async jid's unique per host
The jid will now also contain the PID of the async_wrapper process,
and can each unique jid from each host is tracked rather than just
relying on one global jid per task.

Fixes #5582
2014-03-26 13:48:47 -05:00
Matt Martz b8cb23d309 Share p.communicate alternative logic between exec_command and put_file 2014-03-26 13:41:33 -05:00
James Cammarata 7a3fa63db5 Fix for unicode environment variable handling
Fixes #5395
2014-03-25 20:45:04 -05:00
James Cammarata c9bf7eb9bb Don't run {failed|changed}_when checks until async_status is done
Fixes #5117
2014-03-25 14:18:47 -05:00
Michael DeHaan a062912a1f Merge pull request #6658 from pilou-/fix_fix
'changed' key is not defined when task fails
2014-03-25 11:49:18 -04:00
James Cammarata dc658eaa1c Check to make sure the host is in the inventory vars cache before clearing it
Fixes #6660
2014-03-24 15:59:43 -05:00
Pierre-Louis Bonicoli c76501b8a3 'changed' key is not defined when task fails
fix KeyError introduced by fix of #6591.
2014-03-24 19:31:52 +01:00
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
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