Hi,
Depending what you're after, something like this to figure out the instance
type:
- name: determine if we're on a nitro hypervisor
set_fact:
on_nitro: "{{ ansible_ec2_instance_type.startswith('t3') or
ansible_ec2_instance_type.startswith('c5') or
ansible_ec2_instance_type.startswith('m5') or
ansible_ec2_instance_type.startswith('r5') }}"
and then use a condition like:
when: on_nitro
to do the nvme-specific initialisation.
If you want to extract the actual volume id the way to go is to use
something like this:
VOL=$(nvme id-ctrl {{ disk.path }} | grep sn | awk '{print $3}'); echo
"${VOL/vol/vol-}"
where disk path is something like /dev/nvme1n1, that gives you volume id.
If you want the original letters you might have to parse it out of:
nvme id-ctrl /dev/nvme1n1 -v
more details here:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html
kind regards
Pshem
On Tue, 26 Feb 2019 at 17:57, Frank Dias <[email protected]> wrote:
> I have an old playbook that will add an addition volume and it works fine
> on t2 instances. With the move to t3 instances we also now have nvme based
> ebs.
>
> The play book uses lvm to setup the second volume we add the volume as
> xvdf so /dev/xvdf.
> Now on t3 instances when we add the volume as xvdf the volume now shows up
> as /dev/nvme1n1.
>
> Has anyone figured out a playbook to handle both situations?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/92c7d8a0-ad32-4120-a9b5-3a3bf0f7c438%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAEaZiRUTSm6%3D1YOyVS1xw1z9tZs%3Dx%3Dojaf%3DXR4OvK6_rup0Nrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.