DavidWittman/ansible-redis

Issue with redis_master 'ansible.vars.hostvars.HostVarsVars object'

vguilleaume opened this issue · 0 comments

Thanks for this great project, i'm using it from several time now, and today i'm faced to this error.

I'm not clear about what happened, and what can be the root cause of this:


TASK [davidwittman.redis : create redis config file] **************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: }}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'redis_master'
fatal: [srv01]: FAILED! => changed=false
  msg: |-
    AnsibleUndefinedVariable: {{ _redis_master_host + ' ' + _redis_master_port
        if not redis_master
    }}: {{ _redis_master.iface_details.address }}: {{ hostvars.values() |
        selectattr('redis_master') |
        first
    }}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'redis_master'

Could you help me to determine what happened with the attribute 'redis_master' ?

When i execute the following command : ansible -m debug -a var=hostvars[inventory_hostname] all , i can see in the output that i have this line: "redis_master": true in the output

Could you help me to understand where is the problem with the attribute 'redis_master' ? knowing that i have been able to use the role couple of weeks ago with issue.

Best Regards
Valery