forked from ManageIQ/manageiq
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid seeding ansible content in production
Ansible content is already seeded at RPM build time, so to avoid the need to hit the filesystem again, we should skip this in production mode. Additionally, this adds the consolidation of ansible content to seed time, in addition to the fetching of galaxy roles.
- Loading branch information
Showing
4 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
namespace :evm do | ||
namespace :ansible_runner do | ||
desc "Seed galaxy roles for provider playbooks" | ||
desc "Seed plugin ansible content and galaxy roles" | ||
task :seed do | ||
require 'awesome_spawn' | ||
require "vmdb/plugins" | ||
require 'ansible/content' | ||
require "ansible/content" | ||
|
||
Vmdb::Plugins.ansible_runner_content.each do |plugin, content_dir| | ||
content = Ansible::Content.new(content_dir) | ||
puts "Fetching ansible galaxy roles for plugins..." | ||
Ansible::Content.fetch_plugin_galaxy_roles | ||
puts "Fetching ansible galaxy roles for plugins...Complete" | ||
|
||
puts "Seeding roles for #{plugin.name}..." | ||
begin | ||
content.fetch_galaxy_roles | ||
puts "Seeding roles for #{plugin.name}...Complete" | ||
rescue AwesomeSpawn::CommandResultError => err | ||
puts "Seeding roles for #{plugin.name}...Failed - #{err.result.error}" | ||
raise | ||
end | ||
end | ||
puts "Consolidating plugin ansible content..." | ||
Ansible::Content.consolidate_plugin_content | ||
puts "Consolidating plugin ansible content...Complete" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters