How to mount all ephemeral drive using ansible
<p>I wan to spin up ec2 instance using ansible and then mount all available ephemeral drive to mount point.</p>
<p>I checked <a href="http://docs.ansible.com/ansible/ec2_module.html" rel="noreferrer">ec2 module</a> but there isn't a way to activate all available ephemeral drive and then mount these drive.</p>
<p>If i want to do this then I need to write task specific to instance type like following.</p>
<pre><code>- ec2:
key_name: mykey
group: webserver
instance_type: c3.xlarge
image: ami-123456
wait: yes
wait_timeout: 500
volumes:
  - device_name: /dev/xvda
    volume_type: standard
    volume_size: 100
  - device_name: /dev/xvdb
    volume_type: ephemeral
    volume_size: 40
  - device_name: /dev/xvd
    volume_type: ephemeral
    volume_size: 40
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
exact_count: 1
</code></pre>
<p>Is there any way to parameterize following part</p>
<pre><code>volumes:
  - device_name: /dev/xvda
    volume_type: standard
    volume_size: 100
  - device_name: /dev/xvdb
    volume_type: ephemeral
    volume_size: 40
  - device_name: /dev/xvd
    volume_type: ephemeral
    volume_size: 40
</code></pre>
<p>any one know how to do this ?</p>
<p>Thanks</p>