Problems with a variable list in a loop

I have a odd problem iterating through a list, I’m trying to define a role that will install multiple SSH keys from GitHub.

I think the big difference to note is that you are using “with_items” in your playbook example, but not in your role. Is there a reason for that?

Your task in the role should look just like the play, however since you defined a variable you can just use “with_items: ssh_key_list”

Such as:

(tasks/main.yml)

  • name: Add SSH Keys to the common login user
    authorized_key: user={{ ubuntu_common_login_user }} key=“{{ item }}”

with_items: ssh_key_list