Krikri::Host
Represents a target host for automation
Constructors
Create from JSON (for plugin communication). Uses the ? variants
(as_s?/as_i?) rather than .try(&.as_s): try only guards against a
missing key (Crystal nil), not a key present with a JSON null
value - {"user": null}.try(&.as_s) still raises, since the JSON::Any
itself is non-nil even though it wraps null. A host declared without
an explicit user (e.g. localhost ansible_connection=local, with no
ansible_user=) serializes exactly that way.
Instance methods
The address the SSH/transport layer actually connects to — either
ansible_host (if set in the inventory) or the inventory hostname.
Used for display and connection routing throughout the codebase.
True when the host entry came from an add_host: action (or was
merged into one) rather than the static inventory. TaskExecutor's
hostvars builder enriches such hosts' entries with the play magic
variables Ansible exposes on every hostvars entry.
True when the host entry came from an add_host: action (or was
merged into one) rather than the static inventory. TaskExecutor's
hostvars builder enriches such hosts' entries with the play magic
variables Ansible exposes on every hostvars entry.
nil means "the user never specified a port" - not the same thing as
port 22. Only an explicit ansible_port (inventory/CLI) sets this;
when nil, SSHManager omits -p entirely so ssh's own resolution
(~/.ssh/config Port directives, /etc/ssh/ssh_config) takes over,
matching Ansible's ssh connection plugin. An explicit port
still overrides ssh's config exactly as -p always has.
nil means "the user never specified a port" - not the same thing as
port 22. Only an explicit ansible_port (inventory/CLI) sets this;
when nil, SSHManager omits -p entirely so ssh's own resolution
(~/.ssh/config Port directives, /etc/ssh/ssh_config) takes over,
matching Ansible's ssh connection plugin. An explicit port
still overrides ssh's config exactly as -p always has.
Where each of this host's inventory vars was defined - real ansible-core labels a name-template error inside an inventory value with the DEFINING INVENTORY LINE (no column; the excerpt's caret is a full-line run). Only inventory-sourced vars carry an entry; vars a host picks up elsewhere never consult this.
Where each of this host's inventory vars was defined - real ansible-core labels a name-template error inside an inventory value with the DEFINING INVENTORY LINE (no column; the excerpt's caret is a full-line run). Only inventory-sourced vars carry an entry; vars a host picks up elsewhere never consult this.