Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #19294 - support templates from any context #46

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/tasks/foreman_templates_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace :templates do
#* filter => Import names matching this regex (case-insensitive; snippets are not filtered)
#* associate => Associate to OS's, Locations & Organizations. Options are: always, new or never [new]

User.current = User.anonymous_admin

results = ForemanTemplates::TemplateImporter.new({
verbose: ENV['verbose'],
repo: ENV['repo'],
Expand All @@ -31,6 +33,8 @@ namespace :templates do

desc 'Export templates according to settings'
task :export => :environment do
User.current = User.anonymous_admin

ForemanTemplates::TemplateExporter.new({
verbose: ENV['verbose'],
repo: ENV['repo'],
Expand All @@ -47,6 +51,8 @@ namespace :templates do

desc 'Purge unwanted templates from foreman'
task :purge => :environment do
User.current = User.anonymous_admin

ForemanTemplates::TemplateImporter.new({
#* negate => negate query [false]
#* prefix => The string all templates to purge should ( or not ) begin with [Community ]
Expand Down