Skip to content

Commit

Permalink
Fixes #36222 - drop unused puppet rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron-Lavi authored and ekohl committed Jul 13, 2023
1 parent c9b82a5 commit dbe4db8
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions lib/tasks/puppet.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,6 @@ namespace :puppet do
end
end

namespace :import do
desc "
Import your hosts classes and parameters classifications from another external node source.
define script=/dir/node as the script which provides the external nodes information.
This will only scan for hosts that already exists in our database, if you want to
import hosts, use one of the other importers.
YOU Must import your classes first!"

task :external_nodes => :environment do
User.as_anonymous_admin do
if Puppetclass.count == 0
$stdout.puts "You dont have any classes defined.. aborting!"
exit(1)
end

if (script = ENV['script']).nil?
$stdout.puts "You must define the old external nodes script to use. script=/path/node"
exit(1)
end

Host.find_each do |host|
$stdout.print "processing #{host.name} "
nodeinfo = YAML.safe_load `#{script} #{host.name}`
if nodeinfo.is_a?(Hash)
$stdout.puts "DONE" if host.importNode nodeinfo
else
$stdout.puts "ERROR: invalid output from external nodes"
end
$stdout.flush
end
end
end
end

namespace :migrate do
desc "
Migrate Puppet configuration from Host and Hostgroup attributes to parameters.
Expand Down

0 comments on commit dbe4db8

Please sign in to comment.