getMessage()); } return; } // If it doesn't start with #! or #cloud-config, try to parse as YAML // (some users might omit the #cloud-config header) try { Yaml::parse($script); } catch (ParseException $e) { $fail('The :attribute must be either a valid bash script (starting with #!) or valid cloud-config YAML. YAML parse error: '.$e->getMessage()); } } }