Need help on Resource: Ifconfig?

Hi Team, Need help on updating subnet mask using chef for specific set of servers

ifconfig ‘20.20…’ do // i need to change subnet for these servers which are in 20.20.X.X range. Will it work//

mask x.x.x.x

end

now my question is how to validate those node are specific range??? Or else do we need to write any condition inside loop. Note: I have gone through the chef doc…but help less

Thanks in Advance