On 10. mai 2017 10:36, Leszek Niewiadomski wrote:
> Running it shows variable is not defined:
>
>
> ansible@ansible0:/usr/local/ansible$ ansible -i inventories/scale
> scale_webservers -m debug -a "var=hostvars['filebeat_gatherlogs']"
> sap0 | SUCCESS => {
> "hostvars['filebeat_logs']": "VARIABLE IS NOT DEFINED!"
> }
>
>
> Please help me solving it out. At least give me clues what have i did wrong.
You are using the hostvars wrong. The first parameter is the hostname
and the second is the variable.
hostvars[inventory_hostname].filebeat_logs
or
vars['filebeat_logs']
--
Kai Stian Olstad