Skip to content

Commit

Permalink
Fixes #29784 - Use InternalProxy selector for capsule upgrade (thefor…
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka committed Jun 2, 2020
1 parent 364ed0f commit c1ebb2c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/models/foreman_ansible/ansible_provider.rb
Expand Up @@ -62,6 +62,14 @@ def proxy_operation_name
'ansible-runner'
end

def required_proxy_selector_for(template)
if template.remote_execution_features.where(:label => 'ansible_run_capsule_upgrade').any?
::DefaultProxyProxySelector.new
else
super
end
end

private

def ansible_command?(template)
Expand Down
2 changes: 1 addition & 1 deletion foreman_ansible.gemspec
Expand Up @@ -22,6 +22,6 @@ Gem::Specification.new do |s|
# Kept as a dev dependency so tests can run together
s.add_development_dependency 'foreman_ansible_core', '~> 3.0'
s.add_dependency 'deface', '< 2.0'
s.add_dependency 'foreman_remote_execution', '>= 2.0.0'
s.add_dependency 'foreman_remote_execution', '>= 3.3.0'
s.add_dependency 'ipaddress', '>= 0.8.0', '< 1.0'
end
5 changes: 5 additions & 0 deletions lib/foreman_ansible/remote_execution.rb
Expand Up @@ -42,6 +42,11 @@ def self.register_rex_feature
:description => N_('Run an Ansible playbook to enable web console on given hosts'),
:host_action_button => true
)
RemoteExecutionFeature.register(
:ansible_run_capsule_upgrade,
N_('Upgrade Capsules on given hosts'),
:description => N_('Upgrade Capsules on given Capsule server hosts')
)
end
end
end

0 comments on commit c1ebb2c

Please sign in to comment.