Puppet Function: get_partition_devices_autoinstall
- Defined in:
- lib/puppet/functions/get_partition_devices_autoinstall.rb
- Function type:
- Ruby 4.x API
Overview
get_partition_devices_autoinstall.rb Examin partitioning information of Debian/Ubuntu hosts and get all used disk devices
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/puppet/functions/get_partition_devices_autoinstall.rb', line 6 Puppet::Functions.create_function(:get_partition_devices_autoinstall) do dispatch :get_partition_devices_autoinstall do required_param 'Array', :partitioning return_type 'Array' end def get_partition_devices_autoinstall(partitioning) return 'fail' if partitioning.empty? return 'nil' if partitioning.nil? device_list = [] partitioning.each do |part_data| if part_data.key?('path') && part_data['path'].match(%r{^\/dev}) device_list.push(part_data['path']) end end return 'failed' if device_list.empty? device_list.uniq unless device_list.empty? end end |