Comments (18)
Second try: #427
I think I fixed most of the request logic against non-CME sites and the diff looks consistent.
from ansible-collection-checkmk.general.
Note: CME support can affect the agent role too (See #121 for reference). We should keep an eye on that.
from ansible-collection-checkmk.general.
I assume CME refers to the CheckMK Enterprise edition? If yes, How is the agent deployment support going? I'd like to avoid having to install the agent on all my systems by hand.
from ansible-collection-checkmk.general.
Hi @edermi, no CME is the Checkmk Managed Service Edition. This issue focuses on modules, as they need to be able to handle an additional attribute. Regarding your question about the Agent rollout: If you are using the CEE (Enterprise Edition) you are good to go. If you are actually using the CME, I would need to check a thing or two.
from ansible-collection-checkmk.general.
Thanks, understood.
The agent README states that CheckMK Enterprise Edition is not supported, hence I was reluctant to try it. I'd like to avoid this issue going off-topic, is there any further documentation? I'm especially interested in how this plays with the bakery and auto-updates.
from ansible-collection-checkmk.general.
Let's continue in the referenced issue, so we don't clutter this issue. :)
from ansible-collection-checkmk.general.
#165 adds CME support for the agent role.
from ansible-collection-checkmk.general.
This issue has been stale for 60 days. It will close in 7 days.
from ansible-collection-checkmk.general.
This issue has been stale for 60 days. It will close in 7 days.
from ansible-collection-checkmk.general.
This issue has been stale for 60 days. It will close in 7 days.
from ansible-collection-checkmk.general.
This is still relevant, hence I marked it to never become stale.
from ansible-collection-checkmk.general.
I had to patch two modules host_group.py and user.py yesterday for my transition from multiple scripts and manual doings to ansible. Is it correct that Checkmk expects the customer always as lowercase string ("provider" despite the fact it's written "Provider" in my backend)?
Here are my changes (just in case I do a silly update of my local collection):
host_group.py
def create_single_host_group(module, base_url, headers):
name = module.params["name"]
api_endpoint = "/domain-types/host_group_config/collections/all"
params = {
"name": name,
"alias": module.params.get("title", name),
"customer": module.params.get("customer", 'provider'),
}
url = base_url + api_endpoint
response, info = fetch_url(
module, url, module.jsonify(params), headers=headers, method="POST"
)
if info["status"] != 200:
exit_failed(
module,
"Error calling API. HTTP code %d. Details: %s, "
% (info["status"], info["body"]),
)
def create_host_groups(module, base_url, groups, headers):
api_endpoint = "/domain-types/host_group_config/actions/bulk-create/invoke"
params = {
"entries": [
{
"name": el.get("name"),
"alias": el.get("title", el.get("name")),
"customer": el.get("customer", 'provider'),
}
for el in groups
],
}
url = base_url + api_endpoint
response, info = fetch_url(
module, url, module.jsonify(params), headers=headers, method="POST"
)
if info["status"] != 200:
exit_failed(
module,
"Error calling API (bulk-create). HTTP code %d. Details: %s, "
% (info["status"], info["body"]),
)
user.py
def run_module():
# define available arguments/parameters a user can pass to the module
module_args = dict(
server_url=dict(type="str", required=True),
site=dict(type="str", required=True),
validate_certs=dict(type="bool", required=False, default=True),
automation_user=dict(type="str", required=True),
automation_secret=dict(type="str", required=True, no_log=True),
name=dict(required=True, type="str"),
fullname=dict(type="str"),
customer=dict(type="str"),
password=dict(type="str", no_log=True),
enforce_password_change=dict(type="bool", no_log=False),
[...]
@classmethod
def from_module(cls, params):
attributes = cls.default_attributes
attributes["username"] = params["name"]
def _exists(key):
return key in params and params[key] is not None
if _exists("fullname"):
attributes["fullname"] = params["fullname"]
if _exists("customer"):
attributes["customer"] = params["customer"]
from ansible-collection-checkmk.general.
I had to patch two modules host_group.py and user.py yesterday for my transition from multiple scripts and manual doings to ansible. Is it correct that Checkmk expects the customer always as lowercase string ("provider" despite the fact it's written "Provider" in my backend)?
If you look closely, you will see, that the ID of the customer
attribute is actually lower case. Hence, the need for lower case.
Thanks for sharing your changes @muehlings! I am certain it helps people get started adapting modules, once they get to it. You might even create your own PRs for the modules you touched, to get a piece of the fame? 😉
from ansible-collection-checkmk.general.
Hello Robin,
Thanks for sharing your changes @muehlings! I am certain it helps people get started adapting modules, once they get to it. You might even create your own PRs for the modules you touched, to get a piece of the fame? 😉
I still need a workshop for git. ;) In my last PR I lost about 2 hours for linting. That feels inefficient.
from ansible-collection-checkmk.general.
I still need a workshop for git. ;) In my last PR I lost about 2 hours for linting. That feels inefficient.
We can do that together. :) You create the basic stuff and I figure out linting findings and so on. :)
from ansible-collection-checkmk.general.
I forked from the wrong branch (:main instead of :devel), but my changes should be noticable. I have done only two modules. There are some more to go and the POST/PUT requests should not submit the parameter "customer". I think they will fail then.
from ansible-collection-checkmk.general.
Hi, just a note to thank you guys to work on adding support for the CME, this will be very very useful to us ! As we are starting to deploy the CME.
from ansible-collection-checkmk.general.
This is implemented with #427 in release 3.4.0
.
If there are follow-up issues, please open a new ticket.
from ansible-collection-checkmk.general.
Related Issues (20)
- [FEED] How to set custom attributes / host labels? HOT 4
- [BUG] value_raw is translated wrongly while creating a rule with checkmk.general.rule: HOT 4
- [FEED] typo in host_group.py
- [BUG] activation module with redirect set to true fails if API returns a 302 (possibly only HTTPS) HOT 6
- [BUG] update_attributes on folder with network scan enabled (and a network scan result present) fails HOT 5
- [FEED]Agent download fails in distributed setup HOT 1
- [BUG] Inconsistent behaviour of Ansible modules (update vs remove + compared to API) HOT 10
- [BUG]: reset_password in user module recreates the user HOT 1
- host_tag_group Endpoint changed the parameters id/ident HOT 1
- [BUG] notification rules is not recognized by checkmk.general.rule HOT 3
- [FEED] HOT 2
- [BUG] idempotency of rule fails on datasource_programs ruleset HOT 8
- [BUG] Register Linux agent for TLS fails with CRE edition HOT 3
- [BUG] Agent role has unecessary changes, when the agent is already registered and added to CheckMK HOT 2
- [Feature Request] Create Host and Service Groups Rules via Ansible HOT 4
- [BUG] folder creation always lowers the foldername HOT 10
- [Feed] folder lookup plugin does not return the title of the folder HOT 3
- fixed downtime? HOT 4
- [BUG] "Register Agent for TLS" does not allow for "!" in checkmk_agent_auth on Linux HOT 1
- [FEED] Only register agent if host was created on the server or agent was installed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection-checkmk.general.