-
Notifications
You must be signed in to change notification settings - Fork 897
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
Adding new rake config tasks #15184
Adding new rake config tasks #15184
Conversation
Rake tasks able to: - list available appliance roles - List appliance active roles - Set appliance roles - Get appliance small config summary - Create zone - Modify zone - List appliances - List zones
Some comments on commits https://github.com/rsevilla87/manageiq-1/compare/2a68e622437cd0c648d80bc50d0e008318051d85~...c00e86612f6ba33ad2e8350258c9eb607900918c lib/tasks/config.rake
|
Checked commits https://github.com/rsevilla87/manageiq-1/compare/2a68e622437cd0c648d80bc50d0e008318051d85~...c00e86612f6ba33ad2e8350258c9eb607900918c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 lib/tasks/config.rake
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix rubocop typos
end | ||
|
||
desc "List appliance active roles" | ||
task :list_active_roles => [:environment] do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you review #14107 and specifically rake evm:status_full
? There's some overlap specifically in the active roles. Maybe you can enhance it to list all roles in the output.
if ENV['APPLIANCE_ID'].blank? | ||
puts MiqServer.my_server.active_role_names.to_json | ||
else | ||
puts MiqServer.find(ENV['APPLIANCE_ID']).role.split(",").to_json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? rake evm:status_full
shows all server's active roles
end | ||
|
||
desc "Set appliance roles" | ||
task :set_roles => [:environment] do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case for using this rake task? Are you trying to automate something? Can you give more details?
puts "Region: #{MiqServer.my_server.region_description}" | ||
puts "Zone ID: #{MiqServer.my_server.zone_id}" | ||
puts "Zone: #{MiqServer.my_server.zone_description}" | ||
puts "Active roles: #{MiqServer.my_server.active_role}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of this overlaps with rake evm:status_full
and rake evm:status
... what's missing from those?
task :create_zone => [:environment] do | ||
begin | ||
raise "You must specify zone name and zone description" if ENV['NAME'].blank? || ENV['DESCRIPTION'].blank? | ||
zone = Zone.new({'name': ENV['NAME'], 'description': ENV['DESCRIPTION']}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case for this?
end | ||
|
||
desc "Modify appliance zone" | ||
task :modify_zone => [:environment] do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case for this? Also, it's unclear what modifications we're making... set_zone
probably makes more sense... but again, I'm not sure what the purpose is for. Are you automating something?
task :list_appliances=> [:environment] do | ||
arr = [] | ||
MiqServer.all.as_json.each do |s| | ||
arr << s.slice("id", "name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rake evm:status_full
? Maybe we can make that rake task limit what columns comes back?
Rake tasks able to: