`[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details`
BeginnerTroubleshootingVariables, Facts and Precedence Problems
Answer
Likely causes → Group names contain hyphens or dots (web-servers, eu-west-1). Group names must be valid Python identifiers to be safely usable in Jinja. This is common with dynamic inventory groups built from tags or regions.
Fix → Rename the groups to web_servers. In dynamic inventories, rely on the plugins' default sanitising (TRANSFORM_INVALID_GROUP_CHARS) or set keyed_groups with a separator: "_".
Prevent → Use snake_case group names. In templates, access groups as groups['web_servers'].
More on Variables, Facts and Precedence Problems
Variables in `group_vars/webservers.yml` are silently ignoredBeginnerYou set `nginx_port: 8443` in inventory `group_vars`, but the role still uses `80`Intermediate`set_fact: release_tag=v2` runs, but later tasks still see `v1`Intermediate`'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'` when templating `hostvars['db01']`Intermediate`'ansible_eth0' is undefined` on new cloud instancesBeginnerFacts like `ansible_hostname` became undefined after someone changed `ansible.cfg`Intermediate