basic variable/list question

Hi,

I'm trying to use the authorized_keys module with a list of keys per
group. Basically, servers in group A get one set of authorized keys,
while group B gets another set of authorized keys.

I clearly have some conceptual problems, however. Rather than ask what
I think I need to know, I'd like to know the best way to solve this.
I'm including the playbook and the list from my host file, in the hope
someone can point me in the right direction.

I can copy user keys if I list the users in the playbook, but when I
try to use a YAML list instead of the explicit name I get:

ERROR: variables assigned to group must be in key=value form

But I see examples of lists like this in the docs.

The playbook:

“I can copy user keys if I list the users in the playbook, but when I
try to use a YAML list instead of the explicit name I get:”

Can you share the playbook you were trying to pass in with the explicit list?

Would help me understand better what may be going wrongly there.

Thanks!

Absolutely!

OK, I have this worked out. Posted for the next guy who needs to learn
this:

I cannot put the list in the hosts file. A list in the group_vars file
works fine, though. So I have /etc/ansible/group_vars/freebsd-test
containing:

Yep, exactly.

You can define complex variables in group_vars/groupname, the INI file only accepts basic key=value stuff, which is where this error was coming up.