got it :)

 instance_id: "{{ new_instanceid[0] }}"

On Tuesday, 18 April 2017 15:25:13 UTC+5:30, sreenivas narayan wrote:
>
> Hi Guys,
>
> I am using ec2 ami to create image of instance and getting error as above. 
> Please help.
>
> ansible version:* 2.2.1.0*
>
>
> - name: Create ami from the image
>   local_action:
>     module: ec2_ami
>     aws_access_key: "{{ xxxxxxxxxxxxxxxxxxxxx}}"
>     aws_secret_key: "{{ yyyyyyyyyyyyyyyyyyyyyy}}"
>     instance_id: "{{ new_instanceid }}"
>     region: 'us-east-1'
>     wait: yes
>     name: xxxxxxx
>       Name: newtest
>       Service: TestService
>   register: image
>
> ----------------
> fatal: [127.0.0.1 -> localhost]: FAILED! => {
>     "changed": false,
>     "failed": true,
>     "invocation": {
>         "module_args": {
>             "aws_access_key": "xxxxxxxxxxxxxxxxxxxxxx",
>             "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
>             "delete_snapshot": false,
>             "description": "",
>             "device_mapping": null,
>             "ec2_url": null,
>             "image_id": null,
>             "instance_id": "['i-xxxxxxxxxxxxxxxxxxx']",
>             "launch_permissions": null,
>             "name": "xxx-AMI",
>             "no_reboot": false,
>             "profile": null,
>             "region": "us-east-1",
>             "security_token": null,
>             "state": "present",
>             "tags": {
>                 "Name": "newtest",
>                 "Service": "TestService"
>             },
>             "validate_certs": true,
>             "wait": true,
>             "wait_timeout": "900"
>         },
>         "module_name": "ec2_ami"
>     },
>     "msg": "InvalidParameterValue: Value (['i-xxxxxxxxxxxxxxxx']) for 
> parameter instance is invalid. Expected: 'i-...'."
>
>
>
>
>
>
>
> --------------------
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/13f92177-6052-4a5a-8685-d426feddaf76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to