tests: Bypass interpreter discovery on non-existant connection delegation targets

By setting ansible_python_interpreter for these fictious hosts we avoid
Ansible trying and failing to connect to them in a attempt to populate
ansible_facts.discovered_interpreter_python. This speeds up these tests by
avoiding a timeout.

It is also a necessary pre-requisite for Ansible 10 (ansible-core 2.17). In
that release no hardcoded fallback is used, failure to determine a valid
Python interpreter is a fatal error.

refs #1074
pull/1095/head
Alex Willmer 4 months ago
parent 40695f413b
commit 863f923f14

@ -1,6 +1,9 @@
# code: language=ini
# vim: syntax=dosini
[become_same_user]
# become_same_user.yml
bsu-joe ansible_user=joe
[become_same_user:vars]
ansible_python_interpreter=python3000

@ -4,7 +4,7 @@
# Connection delegation scenarios. It's impossible to connect to them, but their would-be
# config can be inspected using "mitogen_get_stack" action.
[cd]
# Normal inventory host, no aliasing.
cd-normal ansible_connection=mitogen_doas ansible_user=normal-user
@ -23,6 +23,8 @@ cd-newuser-normal-normal mitogen_via=cd-normal ansible_user=newuser-normal-norma
# doas:newuser via host.
cd-newuser-doas-normal mitogen_via=cd-normal ansible_connection=mitogen_doas ansible_user=newuser-doas-normal-user
[cd:vars]
ansible_python_interpreter = python3000
[connection-delegation-test]
cd-bastion

@ -40,7 +40,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
'python_path': ["{{ ansible_facts.discovered_interpreter_python | default('/usr/bin/python') }}"],
'python_path': ['python3000'],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -68,7 +68,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
'python_path': ["{{ ansible_facts.discovered_interpreter_python | default('/usr/bin/python') }}"],
'python_path': ['python3000'],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,

@ -19,7 +19,7 @@
'kind': 'lxc',
'lxc_info_path': null,
'machinectl_path': null,
'python_path': ['/usr/bin/python'],
'python_path': ['python3000'],
'remote_name': null,
'username': null,
},

@ -23,7 +23,7 @@
'lxc_info_path': null,
'lxc_path': null,
'machinectl_path': null,
'python_path': ["/usr/bin/python"],
'python_path': ["python3000"],
'username': 'ansible-cfg-remote-user',
},
'method': 'setns',

@ -40,7 +40,7 @@
"connect_timeout": 30,
"doas_path": null,
"password": null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
"username": "normal-user",
},
@ -73,7 +73,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -115,7 +115,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -150,7 +150,7 @@
'connect_timeout': 30,
'doas_path': null,
'password': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'username': 'normal-user',
},
@ -168,7 +168,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -210,7 +210,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -238,7 +238,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -272,7 +272,7 @@
'connect_timeout': 30,
'doas_path': null,
'password': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'username': 'normal-user',
},
@ -290,7 +290,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -333,7 +333,7 @@
'keepalive_count': 10,
'password': null,
'port': null,
"python_path": ["/usr/bin/python"],
"python_path": ["python3000"],
'remote_name': null,
'ssh_args': [
-o, ControlMaster=auto,
@ -388,7 +388,7 @@
'connect_timeout': 30,
'doas_path': null,
'password': null,
'python_path': ["/usr/bin/python"],
'python_path': ["python3000"],
'remote_name': null,
'username': 'normal-user',
},
@ -399,7 +399,7 @@
'connect_timeout': 30,
'doas_path': null,
'password': null,
'python_path': ["/usr/bin/python"],
'python_path': ["python3000"],
'remote_name': null,
'username': 'newuser-doas-normal-user',
},

Loading…
Cancel
Save