Hi Fred,
Thank you very much, your suggestion to use complex arguments style was spot on. However, for some reason I couldn't get the parser to accept local_action and my rule took on yet a different form. Here it is, in case it helps somebody!
- name: Make {{ hostname }}
ec2:
image: "{{ ami }}"
id: "{{ hostname }}"
instance_tags: '{"Name":"{{ hostname }}", "type":"{{ group }}"}'
instance_type: "{{ type }}"
count: "{{ count }}"
aws_access_key: "{{ ec2_access_key }}"
aws_secret_key: "{{ ec2_secret_key }}"
region: "{{ region }}"
keypair: "{{ keypair }}"
group_id: "{{ group_id }}"
vpc_subnet_id: "{{ vpc_subnet_id }}"
volumes:
- device_name: "{{ root_dev_name }}"
volume_size: "{{ root_dev_size }}"
state: present
wait: true
register: machine_info
delegate_to: 127.0.0.1