Method: PDK::Generate::PuppetObject#run
- Defined in:
- lib/pdk/generate/puppet_object.rb
#run ⇒ Object
Check that the templates can be rendered. Find an appropriate template and create the target files from the template. This is the main entry point for the class.
167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/pdk/generate/puppet_object.rb', line 167 def run check_preconditions with_templates do |template_path, config_hash| data = template_data.merge(configs: config_hash) render_file(target_object_path, template_path[:object], data) unless spec_only? render_file(target_type_path, template_path[:type], data) if template_path[:type] render_file(target_device_path, template_path[:device], data) if template_path[:device] render_file(target_spec_path, template_path[:spec], data) if template_path[:spec] render_file(target_type_spec_path, template_path[:type_spec], data) if template_path[:type_spec] end end |