ed8a21a627
Not all parts of the script has been switched from awscli to ansible yet, because the ansible aws modules do not support importing s3 object as snapshots. (https://github.com/ansible/ansible/issues/53453) Workaround using the image_location parameter of the ec2_ami ansible module would mean adding extra code for generating AMI manifest with pre-signed URLs.
15 lines
329 B
YAML
15 lines
329 B
YAML
- hosts: localhost
|
|
tasks:
|
|
- name: Make sure bucket exists
|
|
aws_s3:
|
|
bucket: "{{ aws_bucket }}"
|
|
mode: create
|
|
|
|
- name: Make sure vmimport role exists
|
|
iam_role_facts:
|
|
name: vmimport
|
|
register: role_facts
|
|
- fail:
|
|
msg: "Role vmimport doesn't exist"
|
|
when: role_facts.iam_roles | length < 1
|