Commit graph

2303 commits

Author SHA1 Message Date
Matt Martz
aa709012ba Make sure to also include the region when using keyring_auth 2014-01-28 13:58:41 -06:00
Matt Martz
021b926235 Only specify to USE_KEYRING as the api_key/password when we actually got a keyring_username from ~/.pyrax.cfg 2014-01-28 13:58:41 -06:00
Matt Martz
1ac7dffd55 Support using ~/.pyrax.cfg and multi environments 2014-01-28 13:58:41 -06:00
Matt Martz
139e905e98 identity_type is set dynamically above 2014-01-28 13:58:41 -06:00
Matt Martz
bc473c5be3 Support additional attributes that would allow the rax modules to work with other OpenStack clouds 2014-01-28 13:58:41 -06:00
Matt Martz
d7597414b8 Support keyring for the api_key 2014-01-28 13:58:40 -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 Tanner
3ec043ec17 Fixes #5750 Fail on missing ~/.ssh and ignore accept_hostkey if stricthoskeychecking is off 2014-01-28 11:49:35 -05: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
jctanner
b2d594d24e Merge pull request #5724 from angstwad/su-tasks-fix
Fix bug where playbook tasks do not escalate privs with 'su'
2014-01-23 14:05:14 -08:00
jctanner
19e8742005 Merge pull request #5713 from angstwad/su-fix
Disallow su and sudo params in same play/task
2014-01-23 13:55:43 -08:00
Paul Durivage
e875089eba Fix bug where self.su was being set by the sudo param in play tasks 2014-01-22 11:04:19 -06:00
Paul Durivage
01d1bd61e7 Disallow su and sudo params in same play/task 2014-01-22 10:55:45 -06:00
James Cammarata
ff8eb5f454 Merge pull request #5722 from jeromew/pipelining_default
Bug in constants.py, ANSIBLE_SSH_PIPELINING should be coerced to boolean
2014-01-22 07:34:02 -08: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
jeromew
3f23483022 Bug in constants.py, ANSIBLE_SSH_PIPELINING should be coerced to boolean 2014-01-22 13:54:28 +00:00
James Tanner
61d283e2ad Fix merge conflicts from #5519 2014-01-21 13:35:06 -05:00
jctanner
da136dbe7c Merge pull request #5694 from angstwad/add-su-support-revert
Add su support
2014-01-21 09:57:00 -08:00
Rob Smith
761fe8cc04 Fix an issue where git-pull fails with AttributeError
As part of 94f3b9bfab the code was changed to support dynamically adding localhost to the inventory. This change introduced an crash when run via ansible-pull

```
Starting ansible-pull at 2014-01-20 23:09:57
Traceback (most recent call last):
  File "/tmp/ansible/bin/ansible", line 157, in <module>
    (runner, results) = cli.run(options, args)
  File "/tmp/ansible/bin/ansible", line 82, in run
    hosts = inventory_manager.list_hosts(pattern)
  File "/tmp/ansible/lib/ansible/inventory/__init__.py", line 372, in list_hosts
    result = [ h.name for h in self.get_hosts(pattern) ]
  File "/tmp/ansible/lib/ansible/inventory/__init__.py", line 136, in get_hosts
    subset = self._get_hosts(self._subset)
  File "/tmp/ansible/lib/ansible/inventory/__init__.py", line 177, in _get_hosts
    that = self.__get_hosts(p)
  File "/tmp/ansible/lib/ansible/inventory/__init__.py", line 198, in __get_hosts
    hpat = self._hosts_in_unenumerated_pattern(name)
  File "/tmp/ansible/lib/ansible/inventory/__init__.py", line 275, in _hosts_in_unenumerated_pattern
    ungrouped.add_host(new_host)
AttributeError: 'NoneType' object has no attribute 'add_host'
```

The root cause is there is no group for the host to be added to. I fixed this case by creating the ungrouped group when it doesn't exist and then adding the host to the newly added group. This fixes the regression for me.
2014-01-20 20:10:47 -08:00
Rob Smith
953dc6b345 When not finding a host in ~/.ssh/known_hosts, the return value is 0 if the host just is not found. We then never check the system host file in /etc. This fixes the code to check /etc on any failure, not just a bad return code. 2014-01-20 18:56:39 -08: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
Jesse Keating
e8ad36c8d4 Store hosts for a play as a play attribute
Operate on that play attribute to make things faster for larger
inventories. Instead of making a round trip through inventory.list_hosts
and working through some lengthy list comprehensions over and over
again, calculate the potenital hosts for a play once, then reduce from
it the unavailable hosts when necessary.

Also moves how the %fail is done. The host count is a play level count
of available hosts, which then is compared after each task to the
current number of available hosts for the play. This used to get a new
count every task which was also time expensive.
2014-01-20 16:22:28 -08:00
James Tanner
94f3b9bfab Fixes #3129 Do not require localhost to be in inventory 2014-01-20 18:26:14 -05: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
dec9131735 Ensure playbook support for su params 2014-01-20 11:46:56 -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 Tanner
559e89036b Fixes #5631 Return a unique list of hosts when joining groups 2014-01-16 14:24:11 -05: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
Matt Martz
d46037d64c Do not log the rax api_key argument in module invocation 2014-01-15 16:38:03 -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
59d99c17b3 Merge pull request #5337 from bob-smith/bugfixFQDNParsing
Fix inventory parsing so that FQDN can be parsed without throwing ssh port error
2014-01-14 08:28:38 -08:00
jctanner
a6bc63512e Merge pull request #5308 from zecrazytux/fix/hash_merge_dynamic_inventory
Let merge hash_bahaviour work with dynamic inventory
2014-01-14 07:58:25 -08:00
jctanner
671b0454c6 Merge pull request #4987 from jpmens/lookup-csvfile
New lookup plugin csvreader
2014-01-14 07:17:52 -08:00
willthames
31f5ecea60 Allow float as an argument type in AnsibleModule 2014-01-13 14:15:23 +10:00
Rob Smith
c15cffabdd This fixes bugs added as a part of 8665b0638a
1. if accept_hostkey is false, no matter if the host key is known or not, it will fail.

2. We don't check for the host key in /etc/ssh/ssh_known_hosts

This fixes both of those issues.
2014-01-12 02:12:44 -08:00
James Tanner
3719f3f496 Do not fetch or add keys for http based git urls 2014-01-11 15:15:23 -05:00
James Tanner
eeee1e1c5a Set accept_hostkey to False by default in the git module and fail
early if the key is unknown
2014-01-11 11:02:01 -05:00