Updated changes but see an error, could you please let me know what is missing? Inserted code for your reference.
fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “argument instance_tags is of type <type ‘str’> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value”}
Your ec2_instance_tag ‘name:webserver’ is being evaluated as a string because there’s no space, it needs to be a YAML dictionary.
If you read the docs on the module (ansible-doc ec2), they state:
instance_tags a hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; ‘{“key”:“value”}’ and
‘{“key”:“value”,“key”:“value”}’
[Default: None]
version_added: 1.0