fix(ansible): group names Ansible accepts, and interpreter discovery without the warning (#5334)
Every run warned twice because of Steward's own inventory: - 'Invalid characters were found in group names': the group 'Docker Swarm' went into the inventory as typed. ansible_group_name() cleans it to docker_swarm (lower case, [a-z0-9_], never a leading digit); two names that clean alike get _2, _3 so neither folds into the other. The group page says what plays call it. The display name is unchanged. - Python interpreter discovery: ansible_env sets ANSIBLE_PYTHON_INTERPRETER=auto_silent unless the environment already sets one; a target or group's ansible_python_interpreter still wins. Runs are scoped by target set (steward:group:<id>), not by group name, and --limit is free text, so neither path depends on the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,10 @@ def test_ansible_env_host_key_checking_toggle():
|
||||
assert ansible_env({"host_key_checking": True}, {})["ANSIBLE_HOST_KEY_CHECKING"] == "True"
|
||||
assert ansible_env({"host_key_checking": False}, {})["ANSIBLE_HOST_KEY_CHECKING"] == "False"
|
||||
assert ansible_env({}, {})["ANSIBLE_HOST_KEY_CHECKING"] == "False"
|
||||
# Interpreter discovery stays, without its warning on every run (#5334);
|
||||
# an interpreter set in the environment is left as it is.
|
||||
assert ansible_env({}, {})["ANSIBLE_PYTHON_INTERPRETER"] == "auto_silent"
|
||||
assert ansible_env({}, {"ANSIBLE_PYTHON_INTERPRETER": "/usr/bin/python3"})["ANSIBLE_PYTHON_INTERPRETER"] == "/usr/bin/python3"
|
||||
assert ansible_env(None, {})["ANSIBLE_HOST_KEY_CHECKING"] == "False"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user