Skip to content

Commit

Permalink
Merge pull request #276 from tribe29/devel
Browse files Browse the repository at this point in the history
Release 0.18.0
  • Loading branch information
robin-checkmk authored Mar 14, 2023
2 parents 42395b8 + 877eb56 commit 14d5a00
Show file tree
Hide file tree
Showing 60 changed files with 1,687 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-activation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-contact_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-discovery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-downtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-folder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-host_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-service_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-test-tag_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/ans-int-test-user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml

name: Ansible Integration Tests for User Module
on:
workflow_dispatch:
pull_request:
branches:
- main
- devel
paths:
- 'plugins/modules/user.py'

env:
NAMESPACE: tribe29
COLLECTION_NAME: checkmk

jobs:

###
# Integration tests (RECOMMENDED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html

integration:
runs-on: ubuntu-latest
name: Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}
strategy:
fail-fast: false
matrix:
ansible:
- stable-2.12
- stable-2.13
- devel
python:
- '2.7'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
exclude:
# Exclude unsupported sets.
- ansible: stable-2.12
python: '3.11'
- ansible: stable-2.13
python: '3.11'

steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Run integration test
run: ansible-test integration user -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --docker
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
2 changes: 1 addition & 1 deletion .github/workflows/ans-int-tests-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
with:
# it is just required to run that once as "ansible-test integration" in the docker image
# will run on all python versions it supports.
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ansible-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ jobs:
with:
# it is just required to run that once as "ansible-test integration" in the docker image
# will run on all python versions it supports.
python-version: 3.9
python-version: '3.10'

- name: Install prerequisites
run: pip install ansible-lint yamllint
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

- name: Install Checkmk collection
run: ansible-galaxy collection install --timeout 120 tribe29.checkmk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-sanity-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: 3.9
python-version: '3.10'

# Install the head of the given branch (devel, stable-2.10)
- name: Install ansible-base (${{ matrix.ansible }})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
# it is just required to run that once as "ansible-test units" in the docker image
# will run on all python versions it supports.
python-version: 3.9
python-version: '3.10'

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'
cache: pip
cache-dependency-path: requirements-qa.txt
- name: Install linters
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install Dependencies
run: |
Expand Down Expand Up @@ -82,6 +82,7 @@ jobs:
mkdir -p build/src
cp $files build/src
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"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ tribe29.checkmk Release Notes
v0.17.1
=======

Minor Changes
-------------

- Agent role - Add cloud edition support.

v0.17.0
=======

Expand Down
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,28 @@ We strive to provide the best possible quality with this collection, hence we ha
We urge you to run the following tests locally as applicable, so the turnaround on your pull request ist as low as possible.

### Sanity
[Ansible Sanity Tests](https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html) enforce Ansible coding standards and requirements facilitating static code analysis. The `ansible-test` tool comes along with your Ansible installation (e.g. if you use the `requirements.txt` of this project).
We recommend using the `--docker` option, so you get the best results, as that uses a Docker image crafted and maintained by the Ansible project.
[Ansible Sanity Tests](https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html) enforce Ansible coding standards and requirements facilitating static code analysis. The `ansible-test` tool typically comes along with your Ansible installation (e.g. if you use the `requirements.txt` of this project).
We recommend using the `--docker` option, so you get the best results, as that uses a Docker image crafted and maintained by the Ansible project.
**Caution**: By default, Docker containers cannot be run as an unprivileged user! Depending on your setup you need to allow your user to run containers, or run `ansible-test` with `sudo`. Keep in mind, that with the latter you are running in another environment and might need to take care of installing the Python requirements for Ansible.

To run the tests locally, use the following command in the project root:

ansible-test sanity --docker

You can also run a subset by mentioning them as follows. See `tests/integration/targets` for potential test targets).
You can also run a subset by mentioning them as follows. See `ansible-test sanity --list-tests` for available tests). We strongly recommend to run all tests though.

ansible-test sanity $TEST_CASE --docker

### Integration
[Ansible Integration Tests](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html) run test cases created by the maintainers of this project, to ensure the collection actually does what is intended. The `ansible-test` tool comes along with your Ansible installation (e.g. if you use the `requirements.txt` of this project).
We strongly recommend using the `--docker` option, so you do not modify your local system with the tests.
[Ansible Integration Tests](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html) run test cases created by the maintainers of this project, to ensure the collection actually does what is intended. The `ansible-test` tool typically comes along with your Ansible installation (e.g. if you use the `requirements.txt` of this project).
We strongly recommend using the `--docker` option, so you do not modify your local system with these tests.
**Caution**: By default, Docker containers cannot be run as an unprivileged user! Depending on your setup you need to allow your user to run containers, or run `ansible-test` with `sudo`. Keep in mind, that with the latter you are running in another environment and might need to take care of installing the Python requirements for Ansible.

To run all tests locally, use the following command in the project root:

ansible-test integration --docker

You can also run a subset by mentioning them as follows. See `ansible-test sanity --list-tests` for available tests). We strongly recommend to run all tests though.
You can also run a subset by mentioning them as follows. See `tests/integration/targets` for potential test targets).

ansible-test integration $TEST_CASE --docker

Expand Down
36 changes: 5 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Although the Ansible project notes, that collections should have no or very litt
## Getting help

For documentation on the [included modules](#modules), run the following
command substituting the $MODULE_NAME:
command substituting the `$MODULE_NAME`:

ansible-doc tribe29.checkmk.$MODULE_NAME

Expand All @@ -44,6 +44,8 @@ For any form of support queries or requests refer to [SUPPORT.md](SUPPORT.md).
For information about the structure and organization of this repository
have a look at [STRUCTURE.md](docs/STRUCTURE.md).

You can find playbooks, demonstrating several aspects of this collection in the folder [playbooks/demo/](playbooks/demo/).

## Included content

<!--start collection content-->
Expand Down Expand Up @@ -71,7 +73,7 @@ Name | Description | Tests
[tribe29.checkmk.rule](https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/main/plugins/modules/rule.py)|Manage rules.|[![Integration Tests for Rule Module](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-rule.yaml/badge.svg)](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-rule.yaml)
[tribe29.checkmk.service_group](https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/main/plugins/modules/service_group.py)|Manage service groups.|[![Integration Tests for Service Group Module](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-service_group.yaml/badge.svg)](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-service_group.yaml)
[tribe29.checkmk.tag_group](https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/main/plugins/modules/tag_group.py)|Manage tag groups.|[![Integration Tests for Tag Group Module](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-tag_group.yaml/badge.svg)](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-tag_group.yaml)

[tribe29.checkmk.user](https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/main/plugins/modules/user.py)|Manage tag groups.|[![Integration Tests for User Module](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-user.yaml/badge.svg)](https://github.com/tribe29/ansible-collection-tribe29.checkmk/actions/workflows/ans-int-test-user.yaml)
### Roles
Name | Description | Tests
--- | --- | ---
Expand All @@ -80,38 +82,10 @@ Name | Description | Tests
<!--end collection content-->

## Installing this collection

### Locally

You can install the Checkmk collection locally, if you acquired a tarball from the [releases page](https://github.com/tribe29/ansible-collection-tribe29.checkmk/releases) as follows:

ansible-galaxy collection install /path/to/tribe29-checkmk-X.Y.Z.tar.gz

You can also include it in a `requirements.yml` file and install it with
`ansible-galaxy collection install -r requirements.yml`, using the format:
```yaml
---
collections:
- source: /path/to/tribe29-checkmk-X.Y.Z.tar.gz
type: file
```
### From the Galaxy
You can install the Checkmk collection with the Ansible Galaxy CLI:
Please refer to the [official Ansible documentation](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html) on how to install this collection. The most basic way is this:

ansible-galaxy collection install tribe29.checkmk

You can also include it in a `requirements.yml` file and install it with
`ansible-galaxy collection install -r requirements.yml`, using the format:

```yaml
---
collections:
- name: tribe29.checkmk
version: X.Y.Z
```

## Using this collection

You can either call modules by their Fully Qualified Collection Namespace (FQCN),
Expand Down
5 changes: 4 additions & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ Collection Version | Checkmk Versions | Remarks
0.15.0 | 2.1.0p18, 2.0.0p32 | None
0.16.0 | 2.1.0p19, 2.0.0p32 | None
0.16.1 | 2.1.0p19, 2.0.0p32 | None
0.16.2 | 2.1.0p20, 2.0.0p33 | None
0.16.2 | 2.1.0p20, 2.0.0p33 | None
0.17.0 | 2.1.0p20, 2.0.0p33 | None
0.17.1 | 2.1.0p21, 2.0.0p33 | None
0.18.0 | 2.1.0p24, 2.0.0p34 | None
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Vagrant.configure("2") do |config|
end
$script = <<-SCRIPT
apt-get update
apt-get install -y python3-pip ca-certificates curl gnupg lsb-release
apt-get install -y python3.9 python3-pip ca-certificates curl gnupg lsb-release
wget "https://download.checkmk.com/checkmk/2.1.0p21/check-mk-raw-2.1.0p21_0.focal_amd64.deb" -O /tmp/checkmk-stable.deb
wget "https://download.checkmk.com/checkmk/2.1.0p21/check-mk-raw-2.1.0p21_0.focal_amd64.deb" -O /tmp/checkmk-beta.deb
apt-get install -y /tmp/checkmk-stable.deb
Expand Down
4 changes: 4 additions & 0 deletions changelogs/archive/0.17.1/agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to

minor_changes:
- "Agent role - Add cloud edition support."
5 changes: 5 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ releases:
- rule.yml
release_date: '2023-02-10'
0.17.1:
changes:
minor_changes:
- Agent role - Add cloud edition support.
fragments:
- agent.yml
release_date: '2023-02-17'
0.2.0:
changes:
Expand Down
10 changes: 10 additions & 0 deletions changelogs/fragments/agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
###########################################################
# #
# Please use this template when writing changelogs. #
# Remove all comment lines, once you added your changes. #
# Refer to the archive, if you need examples. #
# #
###########################################################

bugfixes:
- Agent role - Fix support for CCE.
Loading

0 comments on commit 14d5a00

Please sign in to comment.