Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-checkmk committed Sep 23, 2024
1 parent e934882 commit e87b1e5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 38 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/tests/ @robin-checkmk
/roles/ @robin-checkmk
/playbooks/ @robin-checkmk
/plugins/inventory/ @Max-checkmk
/plugins/lookup/version.py @lgetwan
/plugins/modules/ @lgetwan
/plugins/module_utils/ @godspeed-you
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ For any form of support queries or requests refer to [SUPPORT.md](SUPPORT.md).
You can find playbooks, demonstrating the content of this collection in the folder [playbooks/demo/](playbooks/demo/).

<!--start collection content-->
<!-- ### Inventory plugins
Name | Description
--- | ---
[checkmk.general.ec2](https://github.com/Checkmk/ansible-collection-checkmk.general/tree/main/docs/checkmk.general.ec2_inventory.rst)|EC2 inventory source
-->
### Inventory plugins

Name | Description | Tests
--- | --- | ---
[checkmk.general.checkmk](https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/inventory/checkmk.py)|Dynamic Inventory Source for Checkmk | [![Ansible Unit Test for Inventory Module](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-unit-test-inventory.yaml/badge.svg)](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-unit-test-inventory.yaml)

### Lookup plugins
Click on the lookup plugin name below, to get detailed documentation about it.
Expand Down
2 changes: 1 addition & 1 deletion changelogs/fragments/checkmk.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
major_changes:
- Inventory module - Added module for creating an dynamic inventory with Checkmk as source.
- Inventory module - Add module for creating a dynamic inventory from Checkmk.
44 changes: 12 additions & 32 deletions plugins/inventory/checkmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,19 @@
DOCUMENTATION = """
name: checkmk
author: Max Sickora (@max-checkmk)
short_description: checkmk inventory source
short_description: Dynamic Inventory Source or Checkmk
description:
- Get hosts from any checkmk site.
- Get groups from hosttags and sites from checkmk.
options:
server_url:
description: URL of the Checkmk server
required: true
type: string
site:
description: Site name.
required: true
type: string
automation_user:
description: Automation user for the REST API access.
required: true
type: string
automation_secret:
description: Automation secret for the REST API access.
required: true
type: string
- Generate groups based on tag groups or sites in Checkmk.
validate_certs:
description: Whether or not to validate TLS certificates.
type: boolean
required: false
default: True
extends_documentation_fragment: [checkmk.general.common]
options:
plugin:
description: Name of the plugin. Should always be C(checkmk.general.checkmk)
description: Name of the plugin. Should always be C(checkmk.general.checkmk).
type: string
required: true
choices: ['checkmk.general.checkmk']
groupsources:
description:
- List of sources for grouping
Expand All @@ -56,12 +32,16 @@
"""

EXAMPLES = """
# Getting all hosts incl. hosttags and sites as groups
# To get started, you need to create a file called `checkmk.yml`, which contains
# one of the example blocks below and use it as your inventory source.
# E.g., with `ansible-inventory -i checkmk.yml --graph`.
# Group all hosts based on both tag groups and sites:
plugin: checkmk.general.checkmk
server_url: "http://hostname/"
site: "sitename"
user: "cmkadmin"
secret: "******"
automation_user: "cmkadmin"
automation_secret: "******"
validate_certs: False
groupsources: ["hosttags", "sites"]
"""
Expand Down

0 comments on commit e87b1e5

Please sign in to comment.