Bug #19277

Cannot import job templates with foreman_templates

Added by Ondřej Pražák 2 months ago. Updated 23 days ago.

Status:Closed
Priority:Normal
Assigned To:Adam Ruzicka
Category:-
Target version:Foreman - Team Ivan Iteration 14
Difficulty: Pull request:https://github.com/theforeman/foreman_remote_execution/pull/244
Bugzilla link:
Story points-
Velocity based estimate-
Releaseforeman_remote_execution 1.3.1Release relationshipAuto

Description

1) clone community-templates to /somepath/community-tamplates
2) run rake foreman_templates:sync repo="/somepath/community-templates", you will get the following:

Deprecation warning: JobTemplate support is moving to the Remote Execution plugin
- please add 'model: JobTemplate' to the metadata in '[Community] Package Action - SSH Default' to call the right method
rake aborted!
Psych::SyntaxError: (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.2.2/app/models/job_template.rb:204:in `parse_metadata'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.2.2/app/models/job_template.rb:69:in `block in import'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.2.2/app/models/job_template.rb:68:in `import'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/app/services/foreman_templates/template_importer.rb:143:in `update_job_template'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/app/services/foreman_templates/template_importer.rb:86:in `block in parse_files!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/app/services/foreman_templates/template_importer.rb:57:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/app/services/foreman_templates/template_importer.rb:57:in `parse_files!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/app/services/foreman_templates/template_importer.rb:35:in `import_from_files'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/app/services/foreman_templates/template_importer.rb:28:in `import!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-4.0.1/lib/tasks/foreman_templates_tasks.rake:25:in `block (2 levels) in <top (required)>'
Tasks: TOP => templates:sync => templates:import

3) modify 'Package Action - SSH Default' template by adding 'model: JobTemplate' to the metadata as suggested.
4) run the sync rake task again, it fails again


Related issues

Related to OpenSCAP - Bug #19621: foreman_openscap fails seeding because of rex template Closed 05/22/2017
Related to Katello - Bug #19739: foreman-rake db:seed ERROR foreman_remote_execution-1.3.1 Closed 06/01/2017

Associated revisions

Revision 2d5072a5
Added by adamruzicka about 1 month ago

Fixes #19277 - Allow importing using foreman_templates (#244)

  • Fixes #19277 - Allow importing using foreman_templates

History

#1 Updated by Ivan Necas 2 months ago

  • Target version set to Team Ivan Iteration 13

#2 Updated by The Foreman Bot about 1 month ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Adam Ruzicka
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/244 added

#3 Updated by Ivan Necas about 1 month ago

  • Status changed from Ready For Testing to Closed
  • Target version changed from Team Ivan Iteration 13 to Team Ivan Iteration 14
  • Pull request https://github.com/theforeman/foreman-packaging/pull/1646 added

#4 Updated by Ivan Necas about 1 month ago

  • Status changed from Closed to Ready For Testing
  • Pull request deleted (https://github.com/theforeman/foreman-packaging/pull/1646)

#5 Updated by Anonymous about 1 month ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Marek Hulán about 1 month ago

  • Related to Bug #19621: foreman_openscap fails seeding because of rex template added

#7 Updated by Ivan Necas 23 days ago

  • Release set to foreman_remote_execution 1.3.1

#8 Updated by Marek Hulán 21 days ago

  • Related to Bug #19739: foreman-rake db:seed ERROR foreman_remote_execution-1.3.1 added

Also available in: Atom PDF