HI kai,,

Thanks for your information, 

sorry to ask this again, Here getting this below output, but not even a 
proper one , anything wrong I did?, /dev/sdi is free disk. is that right 
one, output will be in descending order?

bash -c 'comm -23 <(lsblk -snlo name) <(lsblk -l | grep part | cut -c1-3 | 
uniq)'
sr0
comm: file 1 is not in sorted order
sda1
sda
sdf1
sdf
sdh1
sdh
rootvg-lv_swap1 (dm-0)
sda2
sda
rootvg-lv_swap2 (dm-1)
sda2
sda
rootvg-lv_swap3 (dm-2)
sda2
sda
rootvg-lv_swap4 (dm-3)
sda2
sda
rootvg-lv_swap5 (dm-4)
sda2
sda
rootvg-lv_swap6 (dm-5)
sda2
sda
rootvg-lv_swap7 (dm-6)
sda2
sda
rootvg-lv_swap8 (dm-7)
sda2
sda
rootvg-lv_root (dm-8)
sda2
sda
u01vg-lv_u01 (dm-9)
sde1
sde
BKUPvg-lv_BKUP (dm-10)
sdd1
sdd
ARCHvg-lv_ARCH (dm-11)
sdc1
sdc
DATAvg-lv_DATA (dm-12)
sdb1
sdb
sdg1
sdg
rootvg-lv_tmp (dm-13)
sda2
sda
rootvg-lv_var (dm-14)
sda2
sda
rootvg-lv_ikea (dm-15)
sda2
sda
sdi

On Sunday, September 30, 2018 at 5:56:13 PM UTC+2, Kai Stian Olstad wrote:

> On Sunday, 30 September 2018 16.57.12 CEST [email protected] 
> <javascript:> 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/efe29322-954e-4f00-a33e-294cbf5fe267%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to