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

ovirt dynamic plugin improvements #3

Merged
merged 4 commits into from
Mar 10, 2020

Conversation

bverschueren
Copy link
Contributor

SUMMARY

Improve oVirt dynamic inventory plugin based on comments in ansible/ansible#49085

ISSUE TYPE
  • Feature Pull Request

 - return None if stat.values is empty
 - allow insecure connection to the engine api
 - return from _get_hosts outside if-block
 - create connection while parse()'ing
 - change NAME according to collections convention
 - doc fixes
 - use shebang
ovirt_insecure:
description: A boolean flag that indicates if the server TLS certificate and host name should be checked.
required: False
default: False
Copy link
Member

Choose a reason for hiding this comment

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

Isn't default value None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Connection expects a boolean for insecure.
As discussed in the original PR (ansible/ansible#49085 (comment)), this differs in the way insecure is handled in the other modules (e.g. ovirt_auth.py) where the value toggles to True in case insecure is None (default) and no CA is provided. I'd prefer to default to False - and possibly fail in the sdk - in case no CA is given and system CA's cannot verify a server.

plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
# ansible_host: devices["eth0"][0]
# Sample content of ovirt.yml
plugin: ovirt
ovirt_url: http://localhost/ovirt-engine/api

Choose a reason for hiding this comment

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

Can we add here https:// and ca_file parameter(and maybe comment how to get the CA file(wget https://engine/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA)) so we provide the best practise in the examples?

Copy link
Member

@mnecas mnecas left a comment

Choose a reason for hiding this comment

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

Last few changes from my part.

plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
plugins/inventory/ovirt.py Outdated Show resolved Hide resolved
@ovirt-infra
Copy link

Hello contributor, thanks for submitting a PR for this project!

I am the bot who triggers "standard-CI" builds for this project.
As a security measure, I will not run automated tests on PRs that are not from white-listed contributors.

In order to allow automated tests to run, please ask one of the project maintainers to review the code and then do one of the following:

  1. Type ci test please on this PR to trigger automated tests for it.
  2. Type ci add to whitelist on this PR to trigger automated tests for it and also add you to the contributor white-list so that your future PRs will be tested automatically. ( keep in mind this list might be overwritten if the job XML is refreshed, for permanent whitelisting, please follow ovirt dynamic plugin improvements #3 option )
  3. If you are planning to contribute to more than one project, maybe it's better to ask them to add you to the project organization, so you'll be able to run tests for all the organization's projects.

Copy link
Member

@mnecas mnecas left a comment

Choose a reason for hiding this comment

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

+1

@ovirt-infra ovirt-infra mentioned this pull request Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants