Hi Michael,
Thanks for your help.
… I am not sure to understand though …
I tried to copy the example given on doc.ansible.com:
local_action:
module: ec2
keypair: mykey
group: webserver
instance_type: m1.large
image: ami-6e649707
wait: yes
wait_timeout: 500
volumes:
- device_name: /dev/sdb
snapshot: snap-abcdef12
device_type: io1
iops: 1000
volume_size: 100
and I get the following error:
ERROR: parse error: playbooks must be formatted as a YAML list, got <type 'dict’>
Then I tried with
volumes: [{ device_name: ‘/dev/sda1’, volume_size: ‘10’ }, { device_name: ‘/dev/xvdf’, ephemeral: ‘ephemeral0’ }, { device_name: ‘/dev/xvdg’, volume_size: ‘25’}]
and
volumes:
- { device_name: ‘/dev/sda1’, volume_size: ‘10’ },
- { device_name: ‘/dev/xvdf’, ephemeral: 'ephemeral0’ }
- { device_name: ‘/dev/xvdg’, volume_size: '25’}
And with both, I get:
msg: this module requires key=value arguments ([‘key_name=GenericLinux’, ‘image=ami-75342c01’, ‘instance_type=m1.small’, ‘vpc_subnet_id=subnet-81407bf5’, ‘user_data={shortname:test4, hostname:test4.aws.onlotaris.com}’, ‘wait_timeout=500’, ‘private_ip=172.16.4.100’, ‘wait=yes’, ‘group=default’, ‘count=1’, ‘state=present’, ‘instance_tags={“Name”:“test4”}’, ‘volumes=[{volume_size:’, ‘10,’, ‘device_name:’, ‘/dev/sda1},’, ‘{ephemeral:’, ‘ephemeral0,’, ‘device_name:’, ‘/dev/xvdf},’, ‘{volume_size:’, ‘25,’, ‘device_name:’, ‘/dev/xvdg}]’])
Thanks in advance.
Fred