This is my playbook and while running I'm getting the error which is in subject line.
---
- hosts: localhost
connection: local
gather_facts: false
vars_prompt:
-
name: aws_access_key
prompt: "Enter AWS Access key:"
-
name: aws_secret_key
prompt: "Enter AWS Secreat key:"
-
name: instance_id
prompt: "Which instance you want to take AMI?"
-
name: instance_name
prompt: "Name of the new AMI?"
-
name: name_tag
prompt: "Name tag of the instance:"
-
name: environment_tag
prompt: "Environment tag of the instance:"
- ec2_ami:
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
instance_id: "{{ instance_id }}"
name: "{{ name }}"
no_reboot: false
tags:
Environment: "{{ environment_tag }}"
Name: "{{ name_tag }}"
wait: true
register: image