Skip to content

Commit

Permalink
Merge pull request #576 from Checkmk/devel
Browse files Browse the repository at this point in the history
Release 4.4.0
  • Loading branch information
robin-checkmk authored Apr 17, 2024
2 parents 300764e + 1b08e06 commit 09af4e5
Show file tree
Hide file tree
Showing 67 changed files with 1,416 additions and 443 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: 'CLA Assistant'
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.') || github.event_name == 'pull_request_target'
uses: contributor-assistant/[email protected].1
uses: contributor-assistant/[email protected].2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---

env:
NAMESPACE: checkmk
COLLECTION_NAME: general

name: Release Collection

on: # yamllint disable-line rule:truthy
workflow_dispatch:

env:
NAMESPACE: checkmk
COLLECTION_NAME: general
FILES: "ansible.cfg CHANGELOG.rst galaxy.yml LICENSE README.md"
DIRS: "changelogs docs meta playbooks plugins roles"

jobs:

#
Expand Down Expand Up @@ -83,8 +84,8 @@ jobs:
cp $files build/src
cp -rf $directories build/src
env:
files: "ansible.cfg CHANGELOG.rst galaxy.yml LICENSE README.md"
directories: "changelogs docs meta playbooks plugins roles"
files: ${{env.FILES}}
directories: ${{env.DIRS}}

- name: Build Ansible Collection
run: ansible-galaxy collection build build/src --force
Expand All @@ -103,7 +104,7 @@ jobs:
with:
commit-message: Update Docs and Changelogs upon Release
signoff: false
branch: changelogs-docs-update-devel
branch: changelogs-docs-update-${{ steps.current_version.outputs.version }}
base: devel
delete-branch: true
title: '[Auto] Update changelogs and docs upon release'
Expand All @@ -124,15 +125,15 @@ jobs:
cp -rf $directories build/src
rm -rf build/src/roles/*/molecule
env:
files: "CHANGELOG.rst LICENSE README.md ansible.cfg galaxy.yml"
directories: "changelogs docs meta playbooks plugins roles"
files: ${{env.FILES}}
directories: ${{env.DIRS}}

- name: Build Ansible Collection
run: ansible-galaxy collection build build/src --force

- name: Create Release and upload Assets
id: create-release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
Expand Down
1 change: 1 addition & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Collection Version | Checkmk Versions | Ansible Versions | Remarks
4.2.0 | 2.0.0p39, 2.1.0p38, 2.2.0p19 | 2.14, 2.15, 2.16 | None
4.3.0 | 2.0.0p39, 2.1.0p39, 2.2.0p22 | 2.14, 2.15, 2.16 | None
4.3.1 | 2.0.0p39, 2.1.0p39, 2.2.0p22 | 2.14, 2.15, 2.16 | None
4.4.0 | 2.0.0p39, 2.1.0p41, 2.2.0p24 | 2.14, 2.15, 2.16 | None
2 changes: 1 addition & 1 deletion changelogs/archive/4.3.0/lookups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ minor_changes:
known_issues:
- Lookup modules - When using inventory variables to configure e.g., the server_url,
it is not possible to assign other variables to these variables.
This is a limitation of Ansble itself.
This is a limitation of Ansible itself.
2 changes: 1 addition & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ releases:
known_issues:
- Lookup modules - When using inventory variables to configure e.g., the server_url,
it is not possible to assign other variables to these variables. This is a
limitation of Ansble itself.
limitation of Ansible itself.
minor_changes:
- Folder module - Extend attribute management. Please refer to the module documentation
for more details.
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/bakery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Bakery module - Fix failing integration test due to wrong key passphrase.
3 changes: 3 additions & 0 deletions changelogs/fragments/folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfixes:
- Folder module - Fix issues with uppercase and lowercase names.
- Folder module - Fix issue where the `name` (alias `title`) was entirely ignored.
7 changes: 7 additions & 0 deletions changelogs/fragments/host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
major_changes:
- Host module - Enable check mode.
- Host module - Add support for cluster hosts.
- Host module - Update attribute management behavior. Refer to the documentation for details.

minor_changes:
- Host module - Migrate module to the new collection API.
1 change: 1 addition & 0 deletions changelogs/fragments/release_summary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
release_summary: "Spring is here! With a rewritten host module including check mode and cluster support."
5 changes: 3 additions & 2 deletions docs/version_lookup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,14 @@ Examples

.. code-block:: yaml+jinja


- name: "Show Checkmk version"
debug:
msg: "Server version is {{ version }}"
vars:
version: "{{ lookup('checkmk.general.version',
server_url + '/' + site,
server_url=my_url,
site=my_site,
validate_certs=False,
automation_user=my_user,
automation_secret=my_secret
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: general

# The version of the collection. Must be compatible with semantic versioning

version: 4.3.1
version: 4.4.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
12 changes: 6 additions & 6 deletions plugins/lookup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This way, they do not need to be provided at task level.

### Method 1: Environment variables
```bash
export ANSIBLE_LOOKUP_CHECKMK_SERVER_URL="https://myserver"
export ANSIBLE_LOOKUP_CHECKMK_SITE=mysite
export ANSIBLE_LOOKUP_CHECKMK_SERVER_URL="https://my_server"
export ANSIBLE_LOOKUP_CHECKMK_SITE=my_site
export ANSIBLE_LOOKUP_AUTOMATION_USER=automation
export ANSIBLE_LOOKUP_AUTOMATION_SECRET=mysecret
export ANSIBLE_LOOKUP_VALIDATE_CERTS=False
Expand All @@ -16,8 +16,8 @@ export ANSIBLE_LOOKUP_VALIDATE_CERTS=False
### Method 2: In `ansible.cfg`
```ini
[checkmk_lookup]
server_url = https://myserver
site = mysite
server_url = https://my_server
site = my_site
automation_user = automation
automation_secret = mysecret
validate_certs = False
Expand All @@ -30,8 +30,8 @@ validate_certs = False
hosts: localhost
gather_facts: false
vars:
ansible_lookup_checkmk_server_url: "https://myserver"
ansible_lookup_checkmk_site: "mysite"
ansible_lookup_checkmk_server_url: "https://my_server"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_automation_user: "automation"
ansible_lookup_automation_secret: "mysecret"
ansible_lookup_validate_certs: false
Expand Down
12 changes: 6 additions & 6 deletions plugins/lookup/bakery.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
msg: "Bakery status is {{ bakery }}"
vars:
bakery: "{{ lookup('checkmk.general.bakery',
server_url=http://myserver,
site=mysite,
server_url=http://my_server,
site=my_site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret
Expand All @@ -100,10 +100,10 @@
ansible.builtin.debug:
msg: "Bakery status is {{ bakery }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
bakery: "{{ lookup('checkmk.general.bakery') }}"
"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
ansible.builtin.debug:
msg: "Attributes of folder /network: {{ attributes }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
attributes: "{{ lookup('checkmk.general.folder', '~tests') }}"
"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@
ansible.builtin.debug:
msg: "Folder tree: {{ item.id }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
loop: "{{
lookup('checkmk.general.folders',
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@
ansible.builtin.debug:
msg: "Attributes of host example: {{ attributes }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
attributes: "{{ lookup('checkmk.general.host', 'example.com', effective_attributes=True) }}"
"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
ansible.builtin.debug:
msg: "Host: {{ item.id }} in folder {{ item.extensions.folder }}, IP: {{ item.extensions.effective_attributes.ipaddress }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
loop: "{{
lookup('checkmk.general.hosts', effective_attributes=True) }}"
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
ansible.builtin.debug:
msg: "Rule: {{ extensions }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
attributes: "{{ lookup('checkmk.general.rule', rule_id='a9285bc1-dcaf-45e0-a3ba-ad398ef06a49') }}"
"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@
ansible.builtin.debug:
msg: "Rule: {{ item.extensions }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
loop: "{{
lookup('checkmk.general.rules', ruleset='host_groups') }}"
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
ansible.builtin.debug:
msg: "Ruleset: {{ extensions }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
extensions: "{{ lookup('checkmk.general.ruleset', ruleset='host_groups') }}"
"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/lookup/rulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
ansible.builtin.debug:
msg: "Ruleset {{ item.extension.name }} is deprecated."
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
loop: "{{
lookup('checkmk.general.rulesets', regex='', rulesets_deprecated=True, rulesets_used=True) }}"
Expand Down
11 changes: 6 additions & 5 deletions plugins/lookup/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
msg: "Server version is {{ version }}"
vars:
version: "{{ lookup('checkmk.general.version',
server_url + '/' + site,
server_url=my_url,
site=my_site,
validate_certs=False,
automation_user=my_user,
automation_secret=my_secret
Expand All @@ -99,10 +100,10 @@
ansible.builtin.debug:
msg: "Server version is {{ version }}"
vars:
ansible_lookup_checkmk_server_url: "{{ checkmk_var_server_url }}"
ansible_lookup_checkmk_site: "{{ outer_item.site }}"
ansible_lookup_checkmk_automation_user: "{{ checkmk_var_automation_user }}"
ansible_lookup_checkmk_automation_secret: "{{ checkmk_var_automation_secret }}"
ansible_lookup_checkmk_server_url: "http://my_server/"
ansible_lookup_checkmk_site: "my_site"
ansible_lookup_checkmk_automation_user: "my_user"
ansible_lookup_checkmk_automation_secret: "my_secret"
ansible_lookup_checkmk_validate_certs: false
attributes: "{{ lookup('checkmk.general.version') }}"
"""
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/bakery.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
automation_user: "my_user"
automation_secret: "my_secret"
signature_key_id: 1
signature_key_passphrase: "secretkey"
signature_key_passphrase: "my_key"
state: "signed"
# Bake and sign all agents.
- name: "Bake and sign all agents."
Expand All @@ -70,7 +70,7 @@
automation_user: "my_user"
automation_secret: "my_secret"
signature_key_id: 1
signature_key_passphrase: "secretkey"
signature_key_passphrase: "my_key"
state: "baked_signed"
"""

Expand Down
10 changes: 7 additions & 3 deletions plugins/modules/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
required: true
type: str
name:
description: The name of your folder. If omitted defaults to the folder name.
description: The name (title) of your folder. If omitted defaults to the string after the last C(/) in I(path).
type: str
aliases: [title]
attributes:
Expand Down Expand Up @@ -220,7 +220,11 @@ def __init__(self, module):
(self.desired["parent"], self.desired["name"]) = self._normalize_path(
self.params.get("path")
)
self.desired["title"] = self.params.get("title", self.desired["name"])

if self.params.get("name"):
self.desired["title"] = self.params.get("name")
else:
self.desired["title"] = self.desired.get("name")

for key in FOLDER:
if self.params.get(key):
Expand Down Expand Up @@ -399,7 +403,7 @@ def _check_output(self, mode):
content="",
etag="",
failed=False,
changed=False,
changed=True,
)

def needs_update(self):
Expand Down
Loading

0 comments on commit 09af4e5

Please sign in to comment.