-
Notifications
You must be signed in to change notification settings - Fork 898
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
Migrate AnsibleTower ConfigurationManager to AutomationManager #13630
Conversation
@miq-bot add_labels wip, providers/anisble_tower |
@jameswnl Cannot apply the following label because they are not recognized: providers/anisble_tower |
@miq-bot add_label providers/ansible_tower |
describe ManageIQ::Providers::AutomationManager do | ||
let(:provider) { FactoryGirl.build(:provider) } | ||
let(:automation_manager) { FactoryGirl.build(:automation_manager, :provider => provider) } | ||
end |
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.
????
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.
@chrisarcand Thanks, but this 🍖 is still very raw, not ready for consumption yet 😄. Way too many broken cases. Actively updated...
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.
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.
☠️ Don't look further.... dangerous to your eyes...
3779e60
to
5bc38aa
Compare
AnsibleTower::AutomationManager https://www.pivotaltracker.com/story/show/138063313
Some comments on commits jameswnl/manageiq@2f0ef1a~...af2c269 spec/models/manageiq/providers/ansible_tower/automation_manager/configuration_script_spec.rb
spec/models/manageiq/providers/ansible_tower/automation_manager/job_spec.rb
spec/models/manageiq/providers/ansible_tower/automation_manager/refresh_parser_spec.rb
spec/models/service_ansible_tower_spec.rb
spec/vcr_cassettes/manageiq/providers/ansible_tower/automation_manager/refresher.yml
|
Checked commits jameswnl/manageiq@2f0ef1a~...af2c269 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/manageiq/providers/ansible_tower/automation_manager/job.rb
app/models/manageiq/providers/ansible_tower/automation_manager/refresh_parser.rb
app/models/manageiq/providers/ansible_tower/automation_manager/refresher.rb
spec/factories/ext_management_system.rb
spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-playbook_spec.rb
spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_script_spec.rb
spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configured_system_spec.rb
spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager_spec.rb
spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-provider_spec.rb
spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-automation_manager-inventory_group_spec.rb
spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-automation_manager-inventory_root_group_spec.rb
spec/models/manageiq/providers/ansible_tower/automation_manager/refresh_parser_spec.rb
spec/models/manageiq/providers/ansible_tower/automation_manager/refresher_spec.rb
|
end | ||
|
||
def self.settings_name | ||
:ems_refresh_worker_ansible_tower_automation |
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.
This implies a Settings migration is needed, as well as a change to settings.yml
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.
Follow up PR?
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.
Yeah, just to unblock others, but it must be the next PR so we don't forget. (Normally I'd say "heck no" 😉 )
has_many :configured_systems, :dependent => :destroy, :foreign_key => "manager_id" | ||
has_many :configuration_profiles, :dependent => :destroy, :foreign_key => "manager_id" | ||
has_many :configuration_scripts, :dependent => :destroy, :foreign_key => "manager_id" | ||
has_many :inventory_groups, :dependent => :destroy, :foreign_key => "ems_id", :inverse_of => :manager |
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.
@bdunne Should this stay in ConfigurationManager? That is, would any config manager need it, and if not, why was it here in the base to begin with?
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.
Let's put back in a follow up PR if necessary.
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.
It was introduced for Ansible Tower with the thought that it would be reused in Foreman (but that hasn't been done yet).
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.
OK
@@ -1448,13 +1448,13 @@ | |||
_("Provider") | |||
# TRANSLATORS: en.yml key: dictionary.model.ManageIQ::Providers::BaseManager (plural form) | |||
_("Providers") | |||
# TRANSLATORS: en.yml key: dictionary.model.ManageIQ::Providers::AnsibleTower::ConfigurationManager |
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.
dictionary strings and .po/.pot files should not be in this PR. @mzazrivec will rebuild them for zanata afterwards.
@@ -14,13 +14,14 @@ | |||
- :sto | |||
- :svc | |||
- :vi | |||
- ems-type:ansible_tower_configuration | |||
- ems-type:ansible_tower_automation |
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.
Note to @simaishi for downstream.
@@ -110,7 +110,7 @@ | |||
:purge_window_size: 1000 | |||
:ems_refresh: | |||
:capture_vm_created_on_date: false | |||
:ansible_tower_configuration: | |||
:ansible_tower_automation: |
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.
yeah, data migration is necessary for both of these changes to settings.yml
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.
Follow up PR as above.
@@ -0,0 +1,5 @@ | |||
module MiqAeMethodService | |||
class MiqAeServiceManageIQ_Providers_AnsibleTower_AutomationManager_Playbook < | |||
MiqAeServiceConfigurationScriptPayload |
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'm not a fan of breaking the line...just keep it one line (We turned off the 120 char rule :P )
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.
Also can be a separate PR.
ManageIQ::Providers::AnsibleTower::ConfigurationManager: Configuration Manager (Ansible Tower) | ||
ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript: Job Template (Ansible Tower) | ||
ManageIQ::Providers::AnsibleTower::AutomationManager: Automation Manager (Ansible Tower) | ||
ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript: Job Template (Ansible Tower) |
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.
@mzazrivec Should these kinds of changes stay in this PR, or would you prefer they were generated by you separately?
@@ -15,7 +15,7 @@ title: Ansible Tower Providers | |||
name: ConfigurationManagerForeman |
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.
o_O WAT @bdunne ??
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.
o_O WAT is that??
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.
Not letting it block this PR as this PR is blocking a bunch, but that looks like a bug.
"azure" => "Azure", | ||
"azure_network" => "Azure Network", | ||
"ec2" => "Amazon EC2", | ||
"ec2_network" => "Amazon EC2 Network", | ||
"ec2_ebs_storage" => "Amazon EBS", | ||
"embedded_ansible_automation" => "Embedded Ansible Automation", |
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 really don't like the name having Automation at the end. @blomquisg Thoughts? I understand it's because of the multiple manager thing, but it feels gross. Even so, it should not hold up this PR.
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.
Ansible Inside?
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 really don't like that name, but that's could just be me 😄
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.
Who would be the consumer of this 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.
I guess technically no one on the end, but it might show up as a "provider type" in a summary screen or something.
It's not in this PR, but at some point, we will have to exclude it from the supported_emses list so they don't appear in the "create provider" screens. Perhaps we do that with permissions.yml...haven't quite decided yet.
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.
embedded_ansible
seems fine to me. We should change it to that in a follow up PR.
It's a bit like ec2
, where we have newer managers that were added later for network and ebs (which really should be "storage"). We could start with a baseline embedded_ansible
, then tack on new managers if they ever pop up.
I unWIPed this PR, because I think it's ready, but I am not comfortable merging until at least these changes are made to the UI: https://github.com/ManageIQ/manageiq-ui-classic/search?utf8=%E2%9C%93&q=AnsibleTower%3A%3AConfigurationManager Otherwise we insta-break the UI, which is unfair to them as they are busted across the board. I am not sure this will affect the service UI at all, but I don't think it will. |
Where are the associated data migrations? I don't see anything in this PR updating the |
@bdunne yes, there're 2 migrations pending, 1 for the STI records and 1 for the settings. |
@jameswnl Is there a PR for them? I can't use my master database at the moment. |
Update wait_for_completion method. See ManageIQ/manageiq#13630
search and replace, plus some new AutomationManagers.