mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 03:44:41 +00:00
Add support for running pytest tests with ssh password.
Currently, running pytest requires that ssh uses key exchange. These change allows the use of ssh with password to connect to the host.
This commit is contained in:
@@ -19,6 +19,10 @@ def is_docker_env():
|
||||
return True
|
||||
|
||||
|
||||
def get_ssh_password():
|
||||
return os.getenv("IPA_SSH_PASSWORD")
|
||||
|
||||
|
||||
def get_server_host():
|
||||
return os.getenv("IPA_SERVER_HOST")
|
||||
|
||||
@@ -33,6 +37,10 @@ def get_inventory_content():
|
||||
if is_docker_env():
|
||||
ipa_server_host += " ansible_connection=docker"
|
||||
|
||||
sshpass = get_ssh_password()
|
||||
if sshpass:
|
||||
ipa_server_host += " ansible_ssh_pass=%s" % sshpass
|
||||
|
||||
lines = [
|
||||
"[ipaserver]",
|
||||
ipa_server_host,
|
||||
|
||||
Reference in New Issue
Block a user