fix: host_vars filenames, include_vars by ansible_hostname
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user