Skip to content

run ci_complete#74103

Closed
s-hertel wants to merge 10 commits intoansible:develfrom
s-hertel:ci_complete
Closed

run ci_complete#74103
s-hertel wants to merge 10 commits intoansible:develfrom
s-hertel:ci_complete

Conversation

@s-hertel
Copy link
Contributor

@s-hertel s-hertel commented Apr 1, 2021

SUMMARY
ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
  • Feature Pull Request
  • Test Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.11 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 1, 2021
@s-hertel s-hertel closed this Apr 1, 2021
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Apr 6, 2021
@s-hertel s-hertel reopened this Apr 21, 2021
@s-hertel s-hertel force-pushed the ci_complete branch 2 times, most recently from e4dd210 to 89f4d09 Compare April 21, 2021 20:19
@ansibot ansibot added docs This issue/PR relates to or includes documentation. docsite This issue/PR relates to the documentation website. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. new_plugin This PR includes a new plugin. runtime ansible_builtin_runtime.yml support:community This issue/PR relates to code supported by the Ansible community. and removed small_patch labels Apr 21, 2021
@s-hertel s-hertel closed this Apr 21, 2021
@s-hertel s-hertel reopened this Apr 21, 2021
@ansibot ansibot removed the needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. label Apr 21, 2021
@ansibot

This comment has been minimized.

@s-hertel s-hertel closed this Apr 21, 2021
@s-hertel s-hertel reopened this Apr 26, 2021
@ansibot ansibot added test This PR relates to tests. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 26, 2021
@s-hertel s-hertel closed this Apr 26, 2021
@s-hertel s-hertel reopened this May 7, 2021
s-hertel added 2 commits June 27, 2025 18:07
Add changelog fragment for variables literally named "delegated_vars['ansible_ssh_host']" and "delegated_vars['ansible_host']"
@s-hertel s-hertel reopened this Jun 30, 2025
@s-hertel s-hertel changed the base branch from stable-2.14 to devel June 30, 2025 13:12

# TODO: consider deprecating or adding a better mechanism to pass
# variables to the results side. The comment above isn't really
# true since cvars is not templated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to pass them w/o templating, so they can examine the sources 'as they were', what we should also do is pass the 'resolved' options with the connection itself

also we should look to deprecate callbacks that rely on variables directly, but we should ensure that the interface for getting the resolved information from the connection object is working.

in any case, the current fix seems to be fine, specially for backporting, but we want to get defined objects/interfaces for callbacks going forward.

Copy link
Contributor Author

@s-hertel s-hertel Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there's a need. I overlooked that these are filtered out here https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/task_result.py#L202, and after looking through the ansible-collections org, I don't see any callback plugins using anything other than "ansible_host" in the delegated variables.

How does #85397 look for backporting? I removed the PlayContext changes.

- The host name potentially displayed by callback plugins or debug messages.
vars:
- name: inventory_hostname
- name: ansible_host
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this something shared? it seems something people would want to customize for most plugins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a remote_addr option could be convenient? I thought the option name host_label would be better for local specifically though. This new option was solely to fix the local connection output with -vvv which can display a template string (since pc remote_addr may be one).

def user(self) -> str:
if not (remote_user := self.get_option("remote_user")):
raise NotImplementedError
return remote_user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something to move to base class? probalby with play_context fallback?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, since the base methods do not use pc port or user, only the remote_addr. The ssh plugin sets these properties internally, and I was just trying to figure out if the ssh plugin doesn't have set_options reliably set (but I believe it does).

@s-hertel s-hertel force-pushed the ci_complete branch 8 times, most recently from a739718 to 5ea0e88 Compare August 13, 2025 20:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects_2.13 bug This issue/PR relates to a bug. ci_verified Changes made in this PR are causing tests to fail. collection Related to Ansible Collections work docs This issue/PR relates to or includes documentation. docsite This issue/PR relates to the documentation website. inventory Inventory category networking Network category new_plugin This PR includes a new plugin. runtime ansible_builtin_runtime.yml support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. unimportant_ci This PR does not need to have healthy CI status and should be ignored by the CI infra maintainers. windows Windows community WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants