tribe29.checkmk.host_group (0.23.0) — module

Manage host groups in Checkmk (bulk version).

| "added in version" 0.11.0 of tribe29.checkmk"

Authors: Michael Sekania (@msekania)

Install collection

Install with ansible-galaxy collection install tribe29.checkmk:==0.23.0


Add to requirements.yml

  collections:
    - name: tribe29.checkmk
      version: 0.23.0

Description

Manage host groups in Checkmk.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a single host group.
- name: "Create a single host group."
  tribe29.checkmk.host_group:
    server_url: "http://localhost/"
    site: "my_site"
    automation_user: "automation"
    automation_secret: "$SECRET"
    name: "my_host_group"
    title: "My Host Group"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create several host groups.
- name: "Create several host groups."
  tribe29.checkmk.host_group:
    server_url: "http://localhost/"
    site: "my_site"
    automation_user: "automation"
    automation_secret: "$SECRET"
    groups:
      - name: "my_host_group_one"
        title: "My Host Group One"
      - name: "my_host_group_two"
        title: "My Host Group Two"
      - name: "my_host_group_test"
        title: "My Test"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create several host groups.
- name: "Create several host groups."
  tribe29.checkmk.host_group:
    server_url: "http://localhost/"
    site: "my_site"
    automation_user: "automation"
    automation_secret: "$SECRET"
    groups:
      - name: "my_host_group_one"
        title: "My Host Group One"
      - name: "my_host_group_two"
      - name: "my_host_group_test"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete a single host group.
- name: "Create a single host group."
  tribe29.checkmk.host_group:
    server_url: "http://localhost/"
    site: "my_site"
    automation_user: "automation"
    automation_secret: "$SECRET"
    name: "my_host_group"
    state: "absent"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete several host groups.
- name: "Delete several host groups."
  tribe29.checkmk.host_group:
    server_url: "http://localhost/"
    site: "my_site"
    automation_user: "automation"
    automation_secret: "$SECRET"
    groups:
      - name: "my_host_group_one"
      - name: "my_host_group_two"
    state: "absent"

Inputs

    
name:
    aliases:
    - host_group_name
    description: The name of the host group to be created/modified/deleted.
    type: str

site:
    description: The site you want to connect to.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description: The state of your host group.
    type: str

title:
    description: The title (alias) of your host group. If omitted defaults to the name.
    type: str

groups:
    aliases:
    - host_groups
    default: []
    description:
    - instead of 'name', 'title' a list of dicts with elements of host group name and
      title (alias) to be created/modified/deleted. If title is omitted in entry, it defaults
      to the host group name.
    type: raw

server_url:
    description: The base url of your Checkmk server.
    required: true
    type: str

validate_certs:
    default: true
    description: Whether to validate the SSL certificate of the Checkmk server.
    type: bool

automation_user:
    description: The automation user you want to use. It has to be an 'Automation' user,
      not a normal one.
    required: true
    type: str

automation_secret:
    description: The secret to authenticate your automation user.
    required: true
    type: str

Outputs

message:
  description: The output message that the module generates.
  returned: always
  sample: Host group created.
  type: str