In the playbook below, I dynamically add_host and attempt to set ansible_network_os for the newly added host. The variable gets set if I use a vars file, but I can’t get it set from within the playbook. Not sure why this is not working …
remove vars:
and just put ansible_network_os
at the same level as groups
Hi Matt,
Thanks for the response.
I did as you suggested, and got different results, but it’s still not working. It’s now complaining about failure to authenticate, which I assume means it’s now happy with the variable assignment, but it broke the authentication.
Full disclosure, without getting into details, I am intentionally using the deprecated authentication method below. The thing is, the authentication works (with deprecation warnings), but not after making the change below. My google searches show tons of examples that I’ve tried to replicate, but I’ll be damned if I can understand what I’m doing wrong.
Thanks,
Matt
I did get this working Matt. Your suggestion worked.
Thanks!