-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Ovirt Cluster through Ansible
Add method to upgrade cluster using ovirt-ansible-cluster-upgrade role.
- Loading branch information
Boris Odnopozov
committed
Nov 3, 2018
1 parent
db724df
commit 81a6b20
Showing
2 changed files
with
41 additions
and
9 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
29 changes: 29 additions & 0 deletions
29
app/models/manageiq/providers/redhat/infra_manager/ems_cluster.rb
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class ManageIQ::Providers::Redhat::InfraManager::EmsCluster < ManageIQ::Providers::InfraManager::EmsCluster | ||
def upgrade(options = {}) | ||
role_options = {:role_name => "oVirt.cluster-upgrade"} | ||
job = ManageIQ::Providers::AnsibleRoleWorkflow.create_job({}, extra_vars_for_upgrade(options), role_options) | ||
job.signal(:start) | ||
job.miq_task | ||
end | ||
|
||
private | ||
|
||
def extra_vars_for_upgrade(options = {}) | ||
connect_options = ext_management_system.apply_connection_options_defaults(options) | ||
|
||
url = URI::Generic.build( | ||
:scheme => connect_options[:scheme], | ||
:host => connect_options[:server], | ||
:port => connect_options[:port], | ||
:path => connect_options[:path] | ||
).to_s | ||
|
||
{ | ||
:engine_url => url, | ||
:engine_user => connect_options[:username], | ||
:engine_password => connect_options[:password], | ||
:cluster_name => name, | ||
:hostname => "localhost" | ||
} | ||
end | ||
end |