-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add end to end lauching of Embedded Ansible via ansible-runner
- Loading branch information
1 parent
db2c372
commit 68170a6
Showing
8 changed files
with
156 additions
and
2 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
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
9 changes: 9 additions & 0 deletions
9
app/models/manageiq/providers/embedded_ansible/automation_manager/job/status.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 |
---|---|---|
@@ -1,2 +1,11 @@ | ||
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job::Status < ::OrchestrationStack::Status | ||
alias miq_task status | ||
|
||
def succeeded? | ||
miq_task.state == MiqTask::STATE_FINISHED && miq_task.status == MiqTask::STATUS_OK | ||
end | ||
|
||
def failed? | ||
miq_task.state == MiqTask::STATE_FINISHED && miq_task.status != MiqTask::STATUS_OK | ||
end | ||
end |
4 changes: 4 additions & 0 deletions
4
app/models/manageiq/providers/embedded_ansible/automation_manager/playbook.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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class TerminalToHtml | ||
def self.render(raw) | ||
wrap_html_container(raw_render(raw)) | ||
end | ||
|
||
def self.raw_render(raw) | ||
require "terminal" | ||
Terminal.render(raw) | ||
end | ||
|
||
def self.wrap_html_container(rendered) | ||
stylesheet = File.read(File.join(Gem.latest_spec_for("terminal").full_gem_path, "/app/assets/stylesheets/terminal.css")) | ||
<<~EOHTML | ||
<div> | ||
<style scoped> | ||
#{stylesheet.chomp} | ||
</style> | ||
<div class='term-container'> | ||
#{rendered} | ||
</div> | ||
</div> | ||
EOHTML | ||
end | ||
end |