The offending line appears to be:
roles:
- { role: lsssd, when: inventory_hostname not in (groups['edisonnodes']|union(groups['pugnodes_old'])) }
^ here
exception type: <class 'yaml.scanner.ScannerError'>
exception: while scanning for the next token
found character that cannot start any token
in "<unicode string>", line 4, column 76
I have tried various changes but nothing seems to work.