Puppet Plan: powerstore::find_empty_volume_groups

Defined in:
plans/find_empty_volume_groups.pp

Overview

Find empty volume groups - Puppet language plan example

Parameters:

  • targets (TargetSpec)


2
3
4
5
6
7
8
9
10
11
12
# File 'plans/find_empty_volume_groups.pp', line 2

plan powerstore::find_empty_volume_groups(
  TargetSpec $targets,
){
  # Get volume groups with their names and assigned volumes
  # Use the query_string task parameter to override the query
  $volume_groups = run_task('powerstore::volume_group_collection_query', $targets,
    {query_string=>'select=name,volumes&type=neq.Snapshot'}).first.value

  # Filter volume_groups to only those without volumes and take their names
  return $volume_groups.filter |$k, $v| { $v['volumes'].empty }.map |$k, $v| { $v['name'] }
}