It looks like a bug to me, but there's a pretty easy workaround: pull out the selector body as a hash of hashes, and select the desired value via ordinary hash indexing. The only trick is handling the 'default' case, but that's doable:
$panel_options = {
cpanel => {'admin_interface' => '2087', 'user_interface' => '2077,2078,2082,2083,2086,2095,2096'},
directadmin => {'admin_interface' => '2222', 'user_interface' => '2222'},
plesk => {'admin_interface' => '8443', 'user_interface'
=> '8443'}
}
if has_key($panel_options, $control_panel) {
$panel_tcp_in = $panel_options[$control_panel]
} else {
$panel_tcp_in = {'admin_interface' => '', 'user_interface' => ''}
}
Note that the 'has_key' function is not built-in; instead, it comes from Puppetlabs' "stdlib" add-in module. You can achieve the same thing without, but it's longer and uglier.
John