│ │ └── trackfile
In the apt-cacher role task main.yaml we have :
---
- name: update apt cache
sudo: yes
apt:
update_cache: yes
- name: Display all variables/facts known for a host
sudo: yes
debug: var=hostvars
- name: Configure APT to use cache server if available
sudo: yes
template: src=etc/apt/apt.conf.d/000apt-cacher-ng-proxy dest=/etc/apt/apt.conf.d/000apt-cacher-ng-proxy owner=root group=root mode=0644
- name: Install apt-cacher-ng on cache server
sudo: yes
apt: pkg=apt-cacher-ng state=latest install_recommends=no
In this scenario hostvars is printed ok, BUT if we try to call some value INSIDE hostvars, it fails with template failed expected "," got "CHAR"
For example - debug: msg="{{ hostvars['rabbithost'] }}" and the KEY is present and we see it OK on on the dict when we print hostvars
What its the way to call hostvars variables from a task in a role and access the whole hostvars tree just fine ?
Best