On Sunday, 30 September 2018 16.57.12 CEST [email protected] wrote:
> HI all,
> 
>  I am trying to get the disk information of target machine.
> 
> 1. I want to check the newly added disk which is fully free, means there is 
> no partition created.
> 2. running a loop like /dev/sda to /dev/sdz and that should fail if 
> patition is not created and print the me last failed disk. can someone help 
> me ?

Ansible isn't design for this so it's somewhat cumbersome to make it work like 
that.
Ansible is more about, create a partition on all drives that doesn't have one.

You could use this with the shell module, it will output all disk that doesn't 
have a partition.

bash -c 'comm -23 <(lsblk -Snlo name) <(lsblk -l | grep part | cut -c1-3 | 
uniq)'


-- 
Kai Stian Olstad


-- 
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/6638684.lE3Jo0NBsU%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to