-
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
Alter ansible_playbook method so that some arguments are optional #18323
Alter ansible_playbook method so that some arguments are optional #18323
Conversation
@fdupont-redhat Please take a look. |
This comment has been minimized.
This comment has been minimized.
Totally make sense. 👍 |
This comment has been minimized.
This comment has been minimized.
@djberg96 @fdupont-redhat I don't see any of the callers using the local_connection option, is there a reason to keep it? I'm okay with this but would rather see us moving to our standard ansible-runner (https://github.com/ManageIQ/manageiq/blob/master/lib/ansible/runner.rb) instead of carrying this ansible_playbook method in |
@agrare Good question, I figured it was for debugging, but maybe that can happen with a local config file? @fdupont-redhat Is that the case? As for using Ansible::Runner, how would we run it remotely? |
We would have to add inventory (e.g. https://github.com/ansible/ansible-runner/blob/master/demo/inventory/hosts) since right now we've only run playbooks locally but it is an enhancement we've wanted to have so this would be a great time to add it. |
@agrare Ok, but let's just get it working for now, and I (or someone) will create a separate refactoring PR that uses our ansible runner lib. |
@djberg96 oh yeah I wasn't suggesting to do that in this PR, the extra local connection was the only comment re this PR |
@fdupont-redhat waiting on you to get back to us about if we can delete the local connection option |
I'm ok to remove local connection option. |
@fdupont-redhat @agrare Ok, I've removed that option and the related comments. |
Checked commits https://github.com/djberg96/manageiq/compare/31eeb2d67b3215cfdc65ac1b020dc161dcdd09b0~...64408d9cbfad3a80c7229de1bdf4c81b7fffeff6 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@miq-bot add_label hammer/yes |
Alter ansible_playbook method so that some arguments are optional (cherry picked from commit 6585812) https://bugzilla.redhat.com/show_bug.cgi?id=1694229
Hammer backport details:
|
…le_playbook" This reverts commit 135db80.
Reverted the backport:
|
Alter ansible_playbook method so that some arguments are optional (cherry picked from commit 6585812) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702020
Hammer backport details:
|
This PR modifies the
ansible_playbook
method of theConversionHost
model so that the 2nd and 3rd arguments are optional. Theextra_vars
will simply default to an empty hash, while thelocal_connection
argument (formerly justconnection
) is now a boolean argument that defaults to false.I also added some comments.
This is a nicer approach, since the 3rd argument currently isn't used at all unless it's set to 'local', so it made sense to me to make it a boolean with a default value. Giving the 2nd argument a default value means we don't have to explicitly pass an empty hash when no extra vars are needed.
This PR also solves bugs with several internal methods where the 3rd argument is missing, e.g.
check_conversion_host_role
.https://bugzilla.redhat.com/show_bug.cgi?id=1622728https://bugzilla.redhat.com/show_bug.cgi?id=1695767