Hello Guys,

I am using a playbook to create ami and trying to fetch the newely created 
ami id. But the debug is getting 'msg": "AMI not updated"'' Please help


-----
- name: Create ami from the instance
  local_action:
    module: ec2_ami
    aws_access_key: "{{ xxxxxxxxxxxxxx }}"
    aws_secret_key: "{{ yyyyyyyyyyyyyyyyyyyy }}"
    instance_id: "{{new_instanceid[0]}}"
    region: 'us-east-1'
    wait: yes
    wait_timeout: 1200
    name: CCCC
    tags:
      Name: newtest
      Service: TestService
  register: image

- debug: var=image

- set_fact:
    us_image_id: "{{ image.image_id }}"

- debug: var=us_image_id



-------------------------------------------------
Playbook output

  },
    "launch_permissions": {},
    "msg": "AMI not updated"


-------------------------------------------

TASK [create-ami : debug] 
***********************************************************************************************************
task path: create-ami/tasks/create.yaml:16
ok: [127.0.0.1] => {
    "changed": false,
    "image": {
        "changed": false,
        "launch_permissions": {},
        "msg": "AMI not updated"
    }
}

TASK [create-ami : set_fact] 
********************************************************************************************************
task path: create.yaml:18
fatal: [127.0.0.1]: FAILED! => {
    "failed": true,
    "msg": "the field 'args' has an invalid value, which appears to include 
a variable that is undefined. The error was: 'dict object' has no attribute 
'image_id'\n\nThe error appears to have been in 
'create-ami/tasks/create.yaml': line 18, column 3, but may\nbe elsewhere in 
the file depending on the exact syntax problem.\n\nThe offending line 
appears to be:\n\n\n- set_fact:\n  ^ here\n"
}




Thanks
Sreenivas


-- 
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/36a6b0db-e463-48e5-b46b-749522899e22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to