Updating Tags in EC2 using module ec2_tags is not working

Trying to update tags where the tags are missing on AWS ec2 instances

My Playbook looks like this:

  • name: Add a Tag
    hosts: foo
    tasks:
    register: ec2
    local_action: ec2_tag resource={{ item.id }} region=us-east-1 state=present
    with_items: ec2.instances
    args:
    tags:
    Test: foobar

Running the playbook gives back these results:

ansible-playbook test.tag.yml -vv
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to a
void timing attack vulnerability.
_warn(“Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.”, PowmInsecureWarning)

PLAY [Add a Tag] **************************************************************

GATHERING FACTS ***************************************************************
<ec2-xxxxxxxx.compute-1.amazonaws.com> REMOTE_MODULE setup
ok: [ec2-54-225-16-163.compute-1.amazonaws.com]

PLAY RECAP ********************************************************************
ec2-xxxxxx.compute-1.amazonaws.com : ok=1 changed=0 unreachable=0 failed=0

I’ve tried different options but it doesn’t update the tag even thought the tag is not present.

Some instructions don’t have the “register: ec2”. I’m not sure what that does in this context. What values get populated, where does it take it from?
Sometimes “with_items” has either “item”, or “ec2_instances” instead of “ec2.instances”. Which should I use? What is it referring to. Sometimes my error is that the “id not found in item”.
Sometimes the ec2.instances shows as $(ec2.instances)

Anyway, a clarification of what choices to make, what the steps actually do and a suggestion as to why it isn’t working.

Thanks,

Bob