-
Notifications
You must be signed in to change notification settings - Fork 61
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
Host hide module + doc updates #399
Host hide module + doc updates #399
Conversation
plugins/modules/host_hide.py
Outdated
- To prevent unnecessary detections from an inactive or a duplicate host, | ||
you can opt to hide the host from the console. This action does not uninstall or | ||
deactivate the sensor. Detection reporting resumes after a host is unhidden. | ||
- The module will return a list of successfull and failed hosts IDs for the action performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I really don't like this "action module" approach. I'd expect something much more like this in Ansible:
- host:
ids:
- abcd1234
state: hidden # or active
In this case the host
module would probably grow pretty large over time and be one of the primary modules. E.g. control sensor update policies attached to a host with a sensor_update_policy
attribute. But that seems ok to me since hosts are a central part of the platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host module would imply being able to manage the full lifecycle of an object (ie host). But that is not how the API works, we can't create hosts, or delete them, so basically it makes more sense imo to break down the hosts api into actionable modules. Ie, host_hide, host_contain, host_info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something in the middle to make it a little more idempotent-y:
- host_hide:
hosts:
- abcd1234
# hidden: true is the default
- host_hide:
hosts:
- abcd1234
hidden: false
Same thing for host_contain
with a contained
boolean.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## devel #399 +/- ##
========================================
Coverage ? 44.30%
========================================
Files ? 14
Lines ? 544
Branches ? 100
========================================
Hits ? 241
Misses ? 302
Partials ? 1
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
User is responsible for managing failed states based on the failed_hosts dictionary we provide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring of hide_host.yml is beautiful.
This PR introduces the
host_hide
module. This is the final API call to complete the roles.This also updates all the README's to ensure they all follow the same formatting. A few minor fixes here and there as well.