Replacing variable access is not the only solution, the much simpler one is setting the value explicitly in configuration. That is the main reason for this warning. Yes, moving to ansible_facts is preferable in the long run as ‘injection’ creates many issues for a very small convenience, why we also add that as an option in the warning.