# i am unable to run ec2 palybook

**URL:** <https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440>\
**Category:** Ansible Project\
**Created:** [March 15, 2022, 11:14am UTC](https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440 "2022-03-15T11:14:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasanna\_kumar1](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@prasanna\_kumar1](https://forum.ansible.com/u/prasanna_kumar1)\
**Post date:** [March 15, 2022, 11:14am UTC](https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440/1 "2022-03-15T11:14:43Z")

</div>

Dear Dick,

Kindly help me with this issue I am getting errors.

 ![image.png](https://us1.discourse-cdn.com/ansible/original/2X/f/faeed718a8aa2f24827cf923e30832ab580b89b9.png)

---

<div class="post-metadata">

**Author:** ![rilindo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rilindo/32/357_2.png) [@rilindo](https://forum.ansible.com/u/rilindo)\
**Post date:** [March 15, 2022, 2:34pm UTC](https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440/2 "2022-03-15T14:34:01Z")

</div>

Hi Prasanna!

Can you copy and paste the relevant code that the error is coming from?

---

<div class="post-metadata">

**Author:** ![prasanna\_kumar1](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@prasanna\_kumar1](https://forum.ansible.com/u/prasanna_kumar1)\
**Post date:** [March 15, 2022, 2:38pm UTC](https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440/3 "2022-03-15T14:38:03Z")

</div>

Dear Rilindo foster,

This is the error code please find attached screenshot.

 ![](https://us1.discourse-cdn.com/ansible/original/2X/f/f8b311c1c523d6bcd990a7a2185914a3266af733.jpeg)

---

<div class="post-metadata">

**Author:** ![rilindo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rilindo/32/357_2.png) [@rilindo](https://forum.ansible.com/u/rilindo)\
**Post date:** [March 15, 2022, 2:50pm UTC](https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440/4 "2022-03-15T14:50:59Z")

</div>

Prasanna,

That is not useful, so I am going to make a guess.

Based on this, you are probably using this sensible module:

[https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2\_instance\_module.html#ansible-collections-amazon-aws-ec2-instance-module](https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_instance_module.html#ansible-collections-amazon-aws-ec2-instance-module)

Based on the error, it is likely you are using **image** , which requires the value be passed as a dictionary. So either the value is passed as a dictionary or you simply use **image\_id** - like this from the example:

```auto
- name: start an instance with a public IP address
  amazon.aws.ec2_instance:
    name: "public-compute-instance"
    key_name: "prod-ssh-key"
    vpc_subnet_id: subnet-5ca1ab1e
    instance_type: c5.large
    security_group: default
    network:
      assign_public_ip: true
    **image_id: ami-123456**
    tags:
      Environment: Testing

```

---

<div class="post-metadata">

**Author:** ![prasanna\_kumar1](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@prasanna\_kumar1](https://forum.ansible.com/u/prasanna_kumar1)\
**Post date:** [March 15, 2022, 3:27pm UTC](https://forum.ansible.com/t/i-am-unable-to-run-ec2-palybook/36440/5 "2022-03-15T15:27:22Z")

</div>

Dear Rilindo foster,

This is the script, this is error code, kindly help me, tomorrow we are going implement client demo purpose

fatal: [local]: FAILED! =\> {“changed”: false, “msg”: “argument ‘image’ is of type \<class ‘str’\> and we were unable to convert to dict:arse JSON or key=value”}

 ![image.png](https://us1.discourse-cdn.com/ansible/original/2X/5/5ae07f0896310e2ae8ed31c2e1dd65ae2d1eb5fe.png)’
