-
Notifications
You must be signed in to change notification settings - Fork 896
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
Use ansible-runner
in EmbeddedAnsible
#18687
Merged
carbonin
merged 11 commits into
ManageIQ:master
from
NickLaMuro:ansible_runner_integration
Jun 11, 2019
Merged
Use ansible-runner
in EmbeddedAnsible
#18687
carbonin
merged 11 commits into
ManageIQ:master
from
NickLaMuro:ansible_runner_integration
Jun 11, 2019
Commits on Jun 11, 2019
-
Configuration menu - View commit details
-
Copy full SHA for e574cf6 - Browse repository at this point
Copy the full SHA e574cf6View commit details -
Remove dependency of EmbeddedAnsible on AnsibleTower::Shared
NickL Note: Commenting out specs here that will fail, and re-implementing them as the logic is added in future commits. Most pull in specs from the ansible_tower provider repo, so they are no longer valid anyway, but can't be tested at this stage since the new model code doesn't exist yet. Also, removed the shared specs for credential.rb for the moment. This will be revisited in the future, but for now doesn't have enough merit to be included with the current implementation. Worth noting, however, is the mthods `notify_on_provider_interaction?` and `.native_ref` have been added to the credential model, since that is currently the functionality of the AnsibleTower provider (and EmbeddedAnsible by virtue of the shared code between the two), so I mirrored that here. This also fixes some test cases that were relying on the type casting of `native_ref` to work properly. The credential logic will be re-implemented and used in the future.
Configuration menu - View commit details
-
Copy full SHA for 63be848 - Browse repository at this point
Copy the full SHA 63be848View commit details -
NickL Note: Added the specs for fixing the embedded_ansible/provider.rb since it seems to be first edited an used here. Most of the specs provided via `'ansible provider'` were not relevant for this current model, since most were surrounding the url parsing and normalizing that is done for the `default_endpoint.url`, which isn't valid for `ansible_runner` since it is run locally. Also, the factory needed to be changed to allow the provider_spec.rb to pass, which will possibly cause issues else where, but will be addressed in subsequent commits.
Configuration menu - View commit details
-
Copy full SHA for 31a2f32 - Browse repository at this point
Copy the full SHA 31a2f32View commit details -
Add EmbeddedAnsible repository CRUD
NickL Note: Used HIGH_PRIORITY here since that was what was used previously in the ansible_tower provider. Arguably the wrong priority, but for now this allows the specs to work as they did. Also, with this one we trade what used to check for proper refresh logic and do some light confirming of `git` logic being done properly under the hood. This is far from exhaustive tests on the subject, but I think it is a nice start without getting too into the weeds with the guts for the git logic that will most likely be removed before too long.
Configuration menu - View commit details
-
Copy full SHA for 78c9290 - Browse repository at this point
Copy the full SHA 78c9290View commit details -
Configuration menu - View commit details
-
Copy full SHA for edadbed - Browse repository at this point
Copy the full SHA edadbedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5856659 - Browse repository at this point
Copy the full SHA 5856659View commit details -
Add EmbeddedAnsible ServiceTemplate (ConfigurationScript) CRUD
NickL Note: The specs mostly represent the previous spec definitions pulled in from `it_behaves_like 'ansible configuration_script'`, but updates those to properly handle the code that doesn't inherit from the ansible_tower provider code any more. That said, some behaviour has been dropped since it no longer makes sense. One change specifically that couldn't be supported as part of this change is the validations, since we would need to add those on the model side in ManageIQ (previously handled via tower), and am unsure if that is functionality we want to keep or not. The test is left there as a note (commented out).
Configuration menu - View commit details
-
Copy full SHA for 4a26163 - Browse repository at this point
Copy the full SHA 4a26163View commit details -
Add end to end lauching of Embedded Ansible via ansible-runner
NickL Note: Pulls in specs from the manageiq-providers-ansible_tower repo for the job/status.rb, but makes them relevant for the new ansible_runner code. The job/status.rb model also is a bit odd in it's implementation. Mostly trying to keep things as close to how they worked previously, though as mentioned in the comments, `OrchestrationStack::Status` and `MiqTask` don't have a 1-to-1 status comparison, so some "fudging" was necessary to keep things as DRY as possible and be able to use some of the inherited methods from `OrchestrationStack::Status`. Also worth noting is the change of #merge_extra_vars compared to what is done in manageiq-providers-ansible_tower. Here, we don't return a hash of `{:extra_vars => my_merged_vars}` since we would end up just accessing the `:extra_vars` key directly anyway and only that in the only caller `#run`. Also also: The specs added to this commit are from yours truely (NickL), and there is a decent amount here that we still need to implement, but some that my stupid head can't figure out how to test properly currently so I think this is "good enough for government work" for the time being. Left a lot of notes in this one since there are clearly some spots that need to be implemented if we are going to try and keep a parity with the existing functionality.
Configuration menu - View commit details
-
Copy full SHA for ce8a76f - Browse repository at this point
Copy the full SHA ce8a76fView commit details -
s/tower/runner/ in service_ansible_playbook_spec
Using the "Tower" nomenclature is no longer valid when referring to EmbeddedAnsible. ... and yes, "nomenclature" is in my vernacular thanks to "The Big Lebowski" deal with it
Configuration menu - View commit details
-
Copy full SHA for 9feb3a5 - Browse repository at this point
Copy the full SHA 9feb3a5View commit details -
Use proper class method notation
This was pedantic and just was bugging me... move along...
Configuration menu - View commit details
-
Copy full SHA for 9dac412 - Browse repository at this point
Copy the full SHA 9dac412View commit details -
Allow playbooks to run using ansible-runner from automate
We need the parent playbook id in order to find the filesystem path for the playbook later on.
Configuration menu - View commit details
-
Copy full SHA for 93eb27a - Browse repository at this point
Copy the full SHA 93eb27aView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.