During installation of the foreman_salt plugin, on some occasions, the foreman_salt JobTemplates are missing. Manually executing
foreman-rake db:seed results in a stack trace (see attachment).
I’m not an expert in this, but what is interesting that there seems to be a dependency between the job templates and if they are imported in the wrong order, the stack trace occurs. E.g. the Salt Run state.highstate - SSH default points to Salt Run function - SSH default as “foreign_input_set”.
Furthermore the seed code in 76-job_templates.rb to import these templates just seem to iterate over the files, without taking this dependency into account.
In fact mimicking the logic seem in the latter file seems to list the files in the reversed order on one host:
$ ruby -e "puts Dir[File.join('app/views/foreman_salt/job_templates/**/*.erb')]" app/views/foreman_salt/job_templates/salt_run_state_highstate_-_ssh_default.erb app/views/foreman_salt/job_templates/salt_run_function_-_ssh_default.erb
While it lists them in the working order on another host (where installation works just fine):
$ ruby -e "puts Dir[File.join('app/views/foreman_salt/job_templates/**/*.erb')]" app/views/foreman_salt/job_templates/salt_run_function_-_ssh_default.erb app/views/foreman_salt/job_templates/salt_run_state_highstate_-_ssh_default.erb
How is this supposed to work? Is it correct that there is not logic in place to account for the dependencies?
The job templates to be imported successfully
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Distribution and version:
Other relevant data:
seed.log (5.0 KB)