{"record":{"id":"d6f909365ad45427","repo":"puppetlabs/puppet","slug":"only-yaml-or-pp-can-be-used-as-a-values-file","errorCode":null,"errorMessage":"Only .yaml or .pp can be used as a --values_file","messagePattern":"Only \\.yaml or \\.pp can be used as a --values_file","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/puppet/face/epp.rb","lineNumber":413,"sourceCode":"      end\n      Puppet.err(detail.message)\n      \"\"\n    end\n  end\n\n  def get_values(compiler, options)\n    template_values = nil\n    values_file = options[:values_file]\n    if values_file\n      begin\n        case values_file\n        when /\\.yaml$/\n          template_values = Puppet::Util::Yaml.safe_load_file(values_file, [Symbol])\n        when /\\.pp$/\n          evaluating_parser = Puppet::Pops::Parser::EvaluatingParser.new\n          template_values = evaluating_parser.evaluate_file(compiler.topscope, values_file)\n        else\n          Puppet.err(_(\"Only .yaml or .pp can be used as a --values_file\"))\n        end\n      rescue => e\n        Puppet.err(_(\"Could not load --values_file %{error}\") % { error: e.message })\n      end\n      unless template_values.nil? || template_values.is_a?(Hash)\n        Puppet.err(_(\"--values_file option must evaluate to a Hash or undef/nil, got: '%{template_class}'\") % { template_class: template_values.class })\n      end\n    end\n\n    values = options[:values]\n    if values\n      evaluating_parser = Puppet::Pops::Parser::EvaluatingParser.new\n      result = evaluating_parser.evaluate_string(compiler.topscope, values, 'values-hash')\n      case result\n      when nil\n        template_values\n      when Hash\n        template_values.nil? ? result : template_values.merge(result)","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/epp.rb#L395-L431","documentation":"Emitted by Puppet::Face[:epp]#get_values when --values_file does not end in .yaml or .pp. Only those two loaders exist, so the case statement falls through to else, Puppet.err logs this message, and the file is ignored: template_values stays nil and rendering continues without the supplied values.","triggerScenarios":"`puppet epp render template.epp --values_file values.json`, `--values_file vars.yml`, or any other extension; the case patterns /\\.yaml$/ and /\\.pp$/ both fail and the else branch fires.","commonSituations":"Values files named .yml (very common single-file convention) or .json; scripts ported from ERB tooling that accepted arbitrary formats.","solutions":["Rename the file to .yaml (or .pp if it holds Puppet code): `mv values.yml values.yaml`","If the data is JSON, convert it to YAML first","Rerun and confirm the values hash is applied to the rendered output"],"exampleFix":"# before\n$ puppet epp render tpl.epp --values_file vars.yml\nError: Only .yaml or .pp can be used as a --values_file\n\n# after\n$ mv vars.yml vars.yaml\n$ puppet epp render tpl.epp --values_file vars.yaml","handlingStrategy":"validation","validationCode":"raise ArgumentError, '--values_file must end in .yaml or .pp' unless values_file =~ /\\.(yaml|pp)\\z/","typeGuard":"def values_file?(path)\n  !path.to_s.match(/\\.(yaml|pp)\\z/).nil?\nend","tryCatchPattern":null,"preventionTips":["Standardize template values files on the .yaml extension in your repo conventions","Lint wrapper scripts so only allowed extensions reach the epp face"],"tags":["ruby","puppet","epp","cli","file-extension","values"],"backgroundTag":"invalid-file-extension","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}