-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Open
Labels
featureThis issue/PR relates to a feature request.This issue/PR relates to a feature request.has_prThis issue has an associated PR.This issue has an associated PR.
Description
Summary
The special variable inventory_hostname is set to the original host when using delegate_to. It would be nice if there was a counterpart for the delegated host. A suggestion I have seen is delegated_hostname. Currently inventory_hostname_shortname is set to the delegated host, but the issue is that if you are using the a FQDN, this will not reflect the name in the inventory. Perhaps it could default to inventory_hostname if there was no delegation underway.
Issue Type
Feature Idea
Component Name
ansible
Additional Information
- hosts: all
tasks:
- command: echo {{ delegated_hostname }}
delegate_to: groups.controllers.0 With group_vars/all:
ansible_host: "{{ delegated_hostname }}.{{ dns_domain }}"
See: #71198 (comment)
Code of Conduct
- I agree to follow the Ansible Code of Conduct
Metadata
Metadata
Assignees
Labels
featureThis issue/PR relates to a feature request.This issue/PR relates to a feature request.has_prThis issue has an associated PR.This issue has an associated PR.