Skip to content
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

Cleanup after Ansible runner. #19383

Merged
merged 1 commit into from
Oct 24, 2019
Merged

Conversation

lfu
Copy link
Member

@lfu lfu commented Oct 9, 2019

Ansible runner support has been added in Ivanchuk.
This pull request is to clean up the Ansible playbook service to get rid of the temporary Ansible template implementation.

Blocks ManageIQ/manageiq-automation_engine#378
Requires #19432
Includes ManageIQ/manageiq-content#594
Includes ManageIQ/manageiq-automation_engine#383
Includes #19466

https://bugzilla.redhat.com/show_bug.cgi?id=1765682

@miq-bot assign @tinaafitz
@miq-bot add_label services, changelog/yes, ivanchuk/yes, hammer/no

@Fryguy
Copy link
Member

Fryguy commented Oct 11, 2019

cc @NickLaMuro Please review

$log.log_hashes(jt_options)
job_template_klass.raw_create_in_provider(manager, jt_options)
end
DEFAULT_EXECUTION_TTL = 100.minutes # automate state machine aborts after 100 retries at a minite interval
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor typo minite -> minute

hash[k] = match_data ? ManageIQ::Password.decrypt(v.gsub(/password::/, '')) : v
end

extra_vars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to set a temporary variable and return it because it would be returned anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, this was a copy-paste from what was done in EmbeddedAnsible::AutomationManager::ConfigurationScript previously.

Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still wrapping my head around a lot of this, but my initial reaction to this change is I don't think this should be something that we should be pushing into the ivanchuk branch. I am fine with it conceptually (I think), but making such a massive code delete like this should be saved for a later release so the QA effort that has already been done on the existing code isn't wasted.

</my_2cents>

Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I did take the resulting patch of this PR and apply it to fresh appliance to try it out. Everything works as far as I can tell, so I am good with merging this into master.

I still haven't heard as response regarding my "2 cents" to not have this as part of ivanchuk, but in addition, I found a unused method as part of my more thorough review. But other than that, I am cool with these changes, and it also proves I am still pretty unfamiliar to the architecture surrounding all of this code.

@lfu
Copy link
Member Author

lfu commented Oct 15, 2019

@NickLaMuro Thanks for reviewing and testing.
@gmcculloug and @tinaafitz would decide if this PR would be back ported to ivanchuk.

Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @lfu 's comment:

#19383 (comment)

this decision will be made separately, so I don't think my review should be keeping this from going into master. Approving.

@tinaafitz
Copy link
Member

@mkanoor Please review.

@@ -96,7 +98,7 @@ def retireable?
# If extra_vars are passed through automate, all keys are considered as attributes and
# converted to lower case. Need to convert them back to original definitions in the
# job template through survey_spec or variables
def self.reconcile_extra_vars_keys(_template, options)
def self.reconcile_extra_vars_keys(_playbook, options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lfu is this just returning back the options that were passed in

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that is the case here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lfu can we get rid of it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is ok with @gmcculloug. I promised him this is a refactor PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lfu Since this is a private method it seems like a straight-forward change that would be fine for this PR.

@miq-bot
Copy link
Member

miq-bot commented Oct 24, 2019

Checked commit lfu@3b3184c with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
9 files checked, 0 offenses detected
Everything looks fine. 🏆

@gmcculloug gmcculloug merged commit 1e1ef97 into ManageIQ:master Oct 24, 2019
@gmcculloug gmcculloug added this to the Sprint 123 Ending Oct 28, 2019 milestone Oct 24, 2019
@mzazrivec
Copy link
Contributor

With this change in place, the server application no longer works. #19432 seems to be fixing it.

@martinpovolny
Copy link
Member

I am wondering why is this ivanchuk/yes. Making #19432 the same though.

@gmcculloug
Copy link
Member

@martinpovolny Thanks for pointing out the release flag. I have discussed the viability of back-porting this with @dmetzger57 as it would be nice to keep Ivanchuk in-sync with master this early on but will come down to when we can get it properly tested. Without a BZ this will not get back-ported so leaving it currently set to ivanchuk/yes until a decision is made, which might be today.

@simaishi
Copy link
Contributor

Ivanchuk backport details:

$ git log -1
commit d1148e84ef28f16d97be0e8f1d59b59bc060b0a5
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Thu Oct 24 17:44:30 2019 -0400

    Merge pull request #19383 from lfu/ansible_runner_cleanup

    Cleanup after Ansible runner.

    (cherry picked from commit 1e1ef97add1d60ab52347b882c562684e0a64fad)

    https://bugzilla.redhat.com/show_bug.cgi?id=1784103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants