ansible / ansible.builtin / v2.5.12 / module / _ec2_ami_search
Removed in 2.2
Reason:Various AWS modules have been combined and replaced with M(ec2_ami_facts). | Alternative:Use M(ec2_ami_find) instead.
Retrieve AWS AMI information for a given operating system.
| "added in version" 1.6 of ansible.builtin"
Authors: Ansible Core Team (deprecated)
deprecated | supported by community
pip
Install with pip install ansible==2.5.12
Look up the most recent AMI on AWS for a given operating system.
Returns C(ami), C(aki), C(ari), C(serial), C(tag)
If there is no AKI or ARI associated with an image, these will be C(null).
Only supports images from cloud-images.ubuntu.com
Example output: C({"ami": "ami-69f5a900", "changed": false, "aki": "aki-88aa75e1", "tag": "release", "ari": null, "serial": "20131024"})
- name: Launch an Ubuntu 12.04 (Precise Pangolin) EC2 instance hosts: 127.0.0.1 connection: local tasks: - name: Get the Ubuntu precise AMI ec2_ami_search: distro: ubuntu release: precise region: us-west-1 store: instance-store register: ubuntu_image - name: Start the EC2 instance ec2: image: "{{ ubuntu_image.ami }}" instance_type: m1.small key_name: mykey
arch: choices: - i386 - amd64 default: amd64 description: CPU architecture required: false virt: choices: - paravirtual - hvm default: paravirtual description: virutalization type required: false store: choices: - ebs - ebs-io1 - ebs-ssd - instance-store default: ebs description: Back-end store for instance required: false distro: choices: - ubuntu description: Linux distribution (e.g., C(ubuntu)) required: true region: choices: - ap-northeast-1 - ap-southeast-1 - ap-northeast-2 - ap-southeast-2 - ca-central-1 - eu-central-1 - eu-west-1 - eu-west-2 - sa-east-1 - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 default: us-east-1 description: EC2 region required: false stream: choices: - server - desktop default: server description: Type of release. required: false release: description: short name of the release (e.g., C(precise)) required: true