-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21089 from Fryguy/ansible_seeding
Avoid seeding ansible content in production
- 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