Commit Graph

22 Commits (e5cad0fd9a413f0dc936fc239e457e9213d7c2b7)

Author SHA1 Message Date
Desmond O. Chang 58c3539196 Add host key for ssh url only.
Rewrite function `get_fqdn`.  It returns fqdn for all kinds of urls now.

`add_git_host_key` determines whether a url is ssh and whether its host
key should be added.
10 years ago
Toshio Kuratomi 3b80f63e22 Have known_hosts function use the url parameter instead of getting a specific attribute out of the module dict.
This makes the function useful in more places
11 years ago
Matt Coddington 10113e6a67 python2.4 compatibility issue with urlparse 11 years ago
Casey Fitzpatrick 7115cb1f37 removed port from domain name qualification, fixes 7941 12 years ago
James Cammarata 360d8b0fc2 Don't try to scan SSH signatures for non-ssh urls
Fixes #7812
12 years ago
Matt Bray 578e881142 fix for urls like ssh://git@github.com/ansible/ansible.git 12 years ago
James Cammarata 3fb3e7e6dc Properly parse urls for ssh-keyscan use
Previously, the get_fqdn() function in known_hosts.py only worked
with urls that started with git@, and ignored any urls that started
with a normal schema type (ie. http:// or ssh://). This patch corrects
that by using urlparse to parse the hostname portion out of urls that
have a proper schema.

Fixes #7474
12 years ago
Michal Mach 60451c20ab Fix known_hosts.py to work on older versions of python 12 years ago
James Cammarata b698f7a44b Add option to create host_key directory if it doesn't exist
Fixes #6731
12 years ago
Cristian Ciupitu 1eaf85b89f 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.
12 years ago
James Cammarata bc93732b1d Catch permissions errors related to opening a known_hosts file in modules
Fixes #6644
12 years ago
Francisco José Marques Vieira e9d7476c28 Add missing sha1 import on known_hosts.py 12 years ago
patrickheeney a9aab23f11 Fix for hostkey directory 12 years ago
Michael DeHaan d37f0c6d12 Use same implementation as ssh.py for "is in host file" checks in module code, prevents git module from adding keys more than once. 12 years ago
Michael DeHaan cfabc2e28a module.run_command is intended to bypass the shell here, so can't do ">>" 12 years ago
James Cammarata 9730157525 Validate SSL certs accessed through urllib*
* Adds another module utility file which generalizes the
  access of urls via the urllib* libraries.
* Adds a new spec generator for common arguments.
* Makes the user-agent string configurable.

Fixes #6211
12 years ago
James Tanner 3ec043ec17 Fixes #5750 Fail on missing ~/.ssh and ignore accept_hostkey if stricthoskeychecking is off 12 years ago
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. 12 years ago
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.
12 years ago
James Tanner 3719f3f496 Do not fetch or add keys for http based git urls 12 years ago
James Tanner eeee1e1c5a Set accept_hostkey to False by default in the git module and fail
early if the key is unknown
12 years ago
James Tanner 8665b0638a Add an "accept_hostkey" parameter to the git module to help automatically
accept hostkeys for git repos and prevent task hangs when the key is unknown
12 years ago