fix: host_vars filenames, include_vars by ansible_hostname

This commit is contained in:
Artemis
2026-05-21 13:32:27 -04:00
parent b93461f932
commit a26f56116e
5 changed files with 8 additions and 36 deletions

View File

@@ -3,6 +3,13 @@
connection: local
become: true
tasks:
# Load host-specific vars by actual system hostname
- name: Load host-specific variables
include_vars:
file: "host_vars/{{ ansible_hostname | lower }}.yml"
ignore_errors: true
tags: [vars, always]
- name: Print start message
debug:
msg: "Ansible Pull running on {{ ansible_hostname }} ({{ inventory_hostname }}) — role: {{ node_type | default('unspecified') }}"
@@ -78,7 +85,7 @@
- cockpit-pcp
state: present
when:
- inventory_hostname == "artemis.ai.home"
- inventory_hostname == "artemis.ai.home" or ansible_hostname == "artemis"
- ansible_os_family == "Debian"
tags: [artemis]