diff --git a/.github/labels-issues.yml b/.github/labels-issues.yml index 52eb4a8b6..354cadc3f 100644 --- a/.github/labels-issues.yml +++ b/.github/labels-issues.yml @@ -49,3 +49,12 @@ module:tag_group: module:user: - 'Component Name: user' + +lookup:version: + - 'Component Name: lookup_version' + +lookup:folder: + - 'Component Name: lookup_folder' + +lookup:folders: + - 'Component Name: lookup_folders' diff --git a/.github/labels-prs.yml b/.github/labels-prs.yml index 47fc9ddca..67984e9b5 100644 --- a/.github/labels-prs.yml +++ b/.github/labels-prs.yml @@ -49,3 +49,9 @@ module:user: lookup:version: - 'plugins/modules/lookup/version.py' + +lookup:folder: + - 'Component Name: lookup_folder' + +lookup:folders: + - 'Component Name: lookup_folders' diff --git a/.github/workflows/ans-int-test-activation.yaml b/.github/workflows/ans-int-test-activation.yaml index 1d33acf32..870767dbc 100644 --- a/.github/workflows/ans-int-test-activation.yaml +++ b/.github/workflows/ans-int-test-activation.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Activation Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-bakery.yaml b/.github/workflows/ans-int-test-bakery.yaml index 1f0b53fe5..4eb958fc5 100644 --- a/.github/workflows/ans-int-test-bakery.yaml +++ b/.github/workflows/ans-int-test-bakery.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Bakery Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-contact_group.yaml b/.github/workflows/ans-int-test-contact_group.yaml index 210a71d1e..2d62d9f27 100644 --- a/.github/workflows/ans-int-test-contact_group.yaml +++ b/.github/workflows/ans-int-test-contact_group.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Contact Group Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-discovery.yaml b/.github/workflows/ans-int-test-discovery.yaml index c3c43ec55..dc20e6b72 100644 --- a/.github/workflows/ans-int-test-discovery.yaml +++ b/.github/workflows/ans-int-test-discovery.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Discovery Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-downtime.yaml b/.github/workflows/ans-int-test-downtime.yaml index b8772ccb9..029afd046 100644 --- a/.github/workflows/ans-int-test-downtime.yaml +++ b/.github/workflows/ans-int-test-downtime.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Downtime Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-folder.yaml b/.github/workflows/ans-int-test-folder.yaml index 1846bbfcf..4d8624e3b 100644 --- a/.github/workflows/ans-int-test-folder.yaml +++ b/.github/workflows/ans-int-test-folder.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Folder Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-host.yaml b/.github/workflows/ans-int-test-host.yaml index 08f785430..1fc268643 100644 --- a/.github/workflows/ans-int-test-host.yaml +++ b/.github/workflows/ans-int-test-host.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Host Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-host_group.yaml b/.github/workflows/ans-int-test-host_group.yaml index 769a22a7c..f8b06db04 100644 --- a/.github/workflows/ans-int-test-host_group.yaml +++ b/.github/workflows/ans-int-test-host_group.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Host Group Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-tests-full.yaml b/.github/workflows/ans-int-test-lkp-version.yaml similarity index 77% rename from .github/workflows/ans-int-tests-full.yaml rename to .github/workflows/ans-int-test-lkp-version.yaml index 84633d978..52be7382d 100644 --- a/.github/workflows/ans-int-tests-full.yaml +++ b/.github/workflows/ans-int-test-lkp-version.yaml @@ -8,18 +8,25 @@ env: NAMESPACE: checkmk COLLECTION_NAME: general + MODULE_NAME: lookup_version -name: Ansible Integration Tests for all Modules +name: Ansible Integration Tests for Version Lookup Module on: workflow_dispatch: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * 0' + pull_request: + branches: + - main + - devel + paths: + - 'plugins/lookup/version.py' jobs: integration: runs-on: ubuntu-latest - name: ${{ matrix.module }} (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) + name: Ⓐ${{ matrix.ansible }}+py${{ matrix.python }} strategy: fail-fast: false matrix: @@ -33,20 +40,6 @@ jobs: - '3.9' - '3.10' - '3.11' - module: - - activation - - bakery - - contact_group - - discovery - - downtime - - folder - - host_group - - host - - password - - rule - - service_group - - tag_group - - user exclude: # Exclude unsupported sets. - ansible: stable-2.13 @@ -73,5 +66,5 @@ jobs: CHECKMK_DOWNLOAD_PW: ${{ secrets.CHECKMK_DOWNLOAD_PW }} - name: Run integration test - run: ansible-test integration ${{ matrix.module }} -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --docker --coverage + run: ansible-test integration ${{env.MODULE_NAME}} -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --docker working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} diff --git a/.github/workflows/ans-int-test-password.yaml b/.github/workflows/ans-int-test-password.yaml index 0590b47ad..af10021b0 100644 --- a/.github/workflows/ans-int-test-password.yaml +++ b/.github/workflows/ans-int-test-password.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Password Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-rule.yaml b/.github/workflows/ans-int-test-rule.yaml index 76122a6b9..bedcd47c5 100644 --- a/.github/workflows/ans-int-test-rule.yaml +++ b/.github/workflows/ans-int-test-rule.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Rule Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-service_group.yaml b/.github/workflows/ans-int-test-service_group.yaml index 68b7f1d69..20a7fddb2 100644 --- a/.github/workflows/ans-int-test-service_group.yaml +++ b/.github/workflows/ans-int-test-service_group.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Service Group Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-tag_group.yaml b/.github/workflows/ans-int-test-tag_group.yaml index 612eb084b..77303cc20 100644 --- a/.github/workflows/ans-int-test-tag_group.yaml +++ b/.github/workflows/ans-int-test-tag_group.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for Tag Group Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/ans-int-test-user.yaml b/.github/workflows/ans-int-test-user.yaml index 651a20b04..b8e1f7237 100644 --- a/.github/workflows/ans-int-test-user.yaml +++ b/.github/workflows/ans-int-test-user.yaml @@ -13,6 +13,8 @@ env: name: Ansible Integration Tests for User Module on: workflow_dispatch: + schedule: + - cron: '0 0 * * 0' pull_request: branches: - main diff --git a/.github/workflows/molecule-role-agent.yaml b/.github/workflows/molecule-role-agent.yaml index cdbc517ae..970bde40c 100644 --- a/.github/workflows/molecule-role-agent.yaml +++ b/.github/workflows/molecule-role-agent.yaml @@ -75,6 +75,5 @@ jobs: - name: "Run Molecule." run: | cd roles/agent/ - # ln -s ../../requirements.yml requirements.yml molecule test -s ${{ matrix.checkmk }} working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} diff --git a/.github/workflows/molecule-role-server.yaml b/.github/workflows/molecule-role-server.yaml index a49472cea..e88cf82e4 100644 --- a/.github/workflows/molecule-role-server.yaml +++ b/.github/workflows/molecule-role-server.yaml @@ -75,6 +75,5 @@ jobs: - name: "Run Molecule." run: | cd roles/server/ - # ln -s ../../requirements.yml requirements.yml molecule test -s ${{ matrix.checkmk }} working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c814dfb0f..a71362da4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,7 +5,44 @@ on: # yamllint disable-line rule:truthy workflow_dispatch: jobs: + + # + # Run sanity checks prior to release. + # + + sanity: + runs-on: ubuntu-latest + name: Sanity (Ⓐ${{ matrix.ansible }}) + strategy: + fail-fast: false + matrix: + ansible: + - stable-2.13 + - stable-2.14 + - stable-2.15 + - devel + + 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' # Ansible 2.13 does not support Python 3.11. + + - 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 sanity tests + run: ansible-test sanity --docker -v --color --coverage + working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} + release: + needs: sanity runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 59919f461..2a3d5d411 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ See [CONTRIBUTING](CONTRIBUTING.md). See [CHANGELOG.rst](CHANGELOG.rst). ## Roadmap - + This is merely a collection of possible additions to the role. Please do **not** consider a concrete planning document! diff --git a/SUPPORT.md b/SUPPORT.md index 8491d0770..7549ee571 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -37,3 +37,4 @@ Collection Version | Checkmk Versions | Ansible Versions | Remarks 2.4.1 | 2.0.0p37, 2.1.0p31, 2.2.0p7 | 2.13, 2.14, 2.15 | None 3.0.0 | 2.0.0p38, 2.1.0p32, 2.2.0p7 | 2.13, 2.14, 2.15 | Breaking changes to the following modules: `folder`, `host`, `host_group`, `rule`. 3.1.0 | 2.0.0p38, 2.1.0p32, 2.2.0p7 | 2.13, 2.14, 2.15 | None +3.2.0 | 2.0.0p38, 2.1.0p32, 2.2.0p8 | 2.13, 2.14, 2.15 | None diff --git a/changelogs/fragments/agent.yml b/changelogs/fragments/agent.yml new file mode 100644 index 000000000..2e87a3727 --- /dev/null +++ b/changelogs/fragments/agent.yml @@ -0,0 +1,6 @@ +minor_changes: + - Agent role - Allow the role to download folder-specific agents. + - Agent role - Add preflight check for correct Checkmk edition. +bugfixes: + - Agent role - Fix agent and update registration on remote sites. + - Agent role - Fix activation handler URL. diff --git a/changelogs/fragments/server.yml b/changelogs/fragments/server.yml new file mode 100644 index 000000000..241df2cd8 --- /dev/null +++ b/changelogs/fragments/server.yml @@ -0,0 +1,2 @@ +minor_changes: + - Server role - Add preflight check for correct Checkmk edition. diff --git a/galaxy.yml b/galaxy.yml index 36827f9a5..f16f60614 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -10,7 +10,7 @@ name: general # The version of the collection. Must be compatible with semantic versioning -version: 3.1.0 +version: 3.2.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md @@ -21,6 +21,7 @@ authors: - "Marcel Arentz (https://github.com/godspeed-you)" - "Robin Gierse (https://github.com/robin-checkmk)" - "Lars Getwan (https://github.com/lgetwan)" + - "Max Sickora (https://github.com/Max-checkmk)" ### OPTIONAL but strongly recommended diff --git a/plugins/lookup/version.py b/plugins/lookup/version.py index 6defdb10b..1811c7cbe 100644 --- a/plugins/lookup/version.py +++ b/plugins/lookup/version.py @@ -23,7 +23,7 @@ description: automation secret for the REST API access required: True validate_certs: - description: Wether or not to validate TLS cerificates + description: Wether or not to validate TLS certificates type: boolean required: False default: True diff --git a/plugins/modules/activation.py b/plugins/modules/activation.py index 33090ca9c..c0a7a2271 100644 --- a/plugins/modules/activation.py +++ b/plugins/modules/activation.py @@ -29,7 +29,7 @@ default: [] type: raw force_foreign_changes: - description: Wheather to active foreign changes. + description: Whether to active foreign changes. default: false type: bool diff --git a/roles/agent/README.md b/roles/agent/README.md index bdaf8d890..11b8469ad 100644 --- a/roles/agent/README.md +++ b/roles/agent/README.md @@ -17,7 +17,7 @@ It can be installed as easy as running: - checkmk_agent_version: "2.2.0p7" + checkmk_agent_version: "2.2.0p8" The Checkmk version of your site. diff --git a/roles/agent/defaults/main.yml b/roles/agent/defaults/main.yml index 48b17d816..e5a990470 100644 --- a/roles/agent/defaults/main.yml +++ b/roles/agent/defaults/main.yml @@ -1,5 +1,5 @@ --- -checkmk_agent_version: "2.2.0p7" +checkmk_agent_version: "2.2.0p8" checkmk_agent_edition: cre checkmk_agent_protocol: http checkmk_agent_server: localhost diff --git a/roles/agent/handlers/main.yml b/roles/agent/handlers/main.yml index d115b4fb6..0cd1f3246 100644 --- a/roles/agent/handlers/main.yml +++ b/roles/agent/handlers/main.yml @@ -2,7 +2,7 @@ - name: "Activate Changes." listen: activate changes checkmk.general.activation: - server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_agent_server }}" + server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_agent_server }}:{{ checkmk_agent_port }}/" site: "{{ checkmk_agent_site }}" automation_user: "{{ checkmk_agent_user }}" automation_secret: "{{ checkmk_agent_auth }}" diff --git a/roles/agent/molecule/2.2.0/group_vars/all.yml b/roles/agent/molecule/2.2.0/group_vars/all.yml index d7d4e9258..0a723fdca 100644 --- a/roles/agent/molecule/2.2.0/group_vars/all.yml +++ b/roles/agent/molecule/2.2.0/group_vars/all.yml @@ -1,6 +1,6 @@ --- # General -checkmk_version: "2.2.0p7" +checkmk_version: "2.2.0p8" checkmk_edition: "cre" checkmk_site: "my_site" automation_user: "cmkadmin" diff --git a/roles/agent/tasks/Debian.yml b/roles/agent/tasks/Debian.yml index e10458bdf..ca07e2135 100644 --- a/roles/agent/tasks/Debian.yml +++ b/roles/agent/tasks/Debian.yml @@ -1,5 +1,5 @@ --- -- name: "{{ ansible_os_family }} Derivatives: Download host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.uri: url: "{{ checkmk_agent_agent.url.cee }}?host_name={{ checkmk_agent_host_name }}&os_type=linux_deb&agent_type=host_name" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -9,50 +9,73 @@ Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" Accept: "application/octet-stream" when: | - checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme" + checkmk_agent_edition | lower != "cre" become: false - register: checkmk_agent_download_state + register: checkmk_agent_host_download_state # This task may fail, as we fall back to the generic agent in that case failed_when: 'false' - changed_when: 'false' + changed_when: checkmk_agent_host_download_state.status is defined and checkmk_agent_host_download_state.status == 200 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Transfer host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "Set Fact: Agent State: host-specific." + ansible.builtin.set_fact: + checkmk_agent_host_specific: >- + {{ (checkmk_agent_host_download_state.status is defined and checkmk_agent_host_download_state.status == 200) | bool }} + +- name: "{{ ansible_os_family }} Derivatives: Transfer host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.copy: src: "{{ checkmk_agent_agent.file.host }}" dest: "{{ checkmk_agent_agent.file.host }}" mode: "0644" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool and checkmk_agent_delegate_download != inventory_hostname tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Install host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Install host-specific {{ checkmk_agent_edition | upper }} Agent." become: true ansible.builtin.apt: deb: "{{ checkmk_agent_agent.file.host }}" force: "{{ checkmk_agent_force_install | bool }}" state: present when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }} Derivatives: Download GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download folder-specific {{ checkmk_agent_edition | upper }} Agent." + ansible.builtin.uri: + url: "{{ checkmk_agent_agent.url.cee }}?os_type=linux_deb&agent_type=generic&folder_name={{ checkmk_agent_folder }}" + validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" + dest: "{{ checkmk_agent_agent.file.cee }}" + method: GET + headers: + Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" + Accept: "application/octet-stream" + become: false + register: checkmk_agent_folder_download_state + when: | + checkmk_agent_edition | lower != "cre" + and checkmk_agent_folder is defined + and not checkmk_agent_host_specific | bool + retries: 3 + failed_when: 'false' + changed_when: checkmk_agent_folder_download_state.status is defined and checkmk_agent_folder_download_state.status == 200 + delegate_to: "{{ checkmk_agent_delegate_download }}" + tags: + - download-package + +- name: "Set Fact: Agent State: folder-specific." + ansible.builtin.set_fact: + checkmk_agent_folder_specific: >- + {{ (checkmk_agent_folder_download_state.status is defined and checkmk_agent_folder_download_state.status == 200) | bool }} + +- name: "{{ ansible_os_family }} Derivatives: Download GENERIC {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.uri: url: "{{ checkmk_agent_agent.url.cee }}?os_type=linux_deb&agent_type=generic" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -63,52 +86,54 @@ Accept: "application/octet-stream" become: false when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not (checkmk_agent_host_specific | bool or checkmk_agent_folder_specific | bool) retries: 3 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Transfer GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Transfer GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.copy: src: "{{ checkmk_agent_agent.file.cee }}" dest: "{{ checkmk_agent_agent.file.cee }}" mode: "0644" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool and checkmk_agent_delegate_download != inventory_hostname tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Install GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Install GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." become: true ansible.builtin.apt: deb: "{{ checkmk_agent_agent.file.cee }}" force: "{{ checkmk_agent_force_install | bool }}" state: present when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }} Derivatives: Install Checkmk CRE Agent." +- name: "{{ ansible_os_family }} Derivatives: Transfer Vanilla agent." + ansible.builtin.copy: + src: "{{ checkmk_agent_agent.file.cre }}" + dest: "{{ checkmk_agent_agent.file.cre }}" + mode: "0644" + when: | + checkmk_agent_edition | lower == "cre" + and checkmk_agent_delegate_download != inventory_hostname + tags: + - download-package + +- name: "{{ ansible_os_family }} Derivatives: Install Vanilla agent." become: true ansible.builtin.apt: deb: "{{ checkmk_agent_agent.file.cre }}" force: "{{ checkmk_agent_force_install | bool }}" state: present - when: checkmk_agent_edition == "cre" + when: checkmk_agent_edition | lower == "cre" tags: - install-package diff --git a/roles/agent/tasks/Linux.yml b/roles/agent/tasks/Linux.yml index 6e4eb5d8c..344a8a0e4 100644 --- a/roles/agent/tasks/Linux.yml +++ b/roles/agent/tasks/Linux.yml @@ -14,17 +14,18 @@ checkmk_agent_prep_legacy | bool and ansible_facts.packages['systemd'][0]['version'] | regex_search('\d{1,}') | int < 220 -- name: "{{ ansible_system }}: Download Checkmk CRE agent." +- name: "{{ ansible_system }}: Download Vanilla agent." ansible.builtin.get_url: url: "{{ checkmk_agent_agent.url.cre }}" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" dest: "{{ checkmk_agent_agent.file.cre }}" mode: '0640' - when: checkmk_agent_edition == "cre" + when: checkmk_agent_edition | lower == "cre" register: result retries: 3 delay: 10 - until: "result.changed | bool" + until: "not result.failed | bool" + delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package @@ -67,13 +68,11 @@ become: true ansible.builtin.shell: | cmk-update-agent register -H {{ checkmk_agent_host_name }} \ - -s {{ checkmk_agent_server }} -i {{ checkmk_agent_site }} -p {{ checkmk_agent_protocol }} \ + -s {{ checkmk_agent_registration_server }} -i {{ checkmk_agent_registration_site }} -p {{ checkmk_agent_protocol }} \ -U {{ checkmk_agent_user }} -P {{ checkmk_agent_auth }} register: checkmk_agent_update_state when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") + checkmk_agent_edition | lower != "cre" and checkmk_agent_updater_binary.stat.exists | bool and checkmk_agent_update | bool and (checkmk_agent_pass is defined and checkmk_agent_pass | length) @@ -83,13 +82,11 @@ become: true ansible.builtin.shell: | cmk-update-agent register -H {{ checkmk_agent_host_name }} \ - -s {{ checkmk_agent_server }} -i {{ checkmk_agent_site }} -p {{ checkmk_agent_protocol }} \ + -s {{ checkmk_agent_registration_server }} -i {{ checkmk_agent_registration_site }} -p {{ checkmk_agent_protocol }} \ -U {{ checkmk_agent_user }} -S {{ checkmk_agent_auth }} register: checkmk_agent_update_state when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") + checkmk_agent_edition | lower != "cre" and checkmk_agent_updater_binary.stat.exists | bool and checkmk_agent_update | bool and (checkmk_agent_secret is defined and checkmk_agent_secret | length) @@ -98,7 +95,7 @@ become: true ansible.builtin.shell: | cmk-agent-ctl register -H {{ checkmk_agent_host_name }} \ - -s {{ checkmk_agent_server }} -i {{ checkmk_agent_site }} \ + -s {{ checkmk_agent_registration_server }} -i {{ checkmk_agent_registration_site }} \ -U {{ checkmk_agent_user }} -P {{ checkmk_agent_auth }} --trust-cert register: checkmk_agent_tls_state when: | diff --git a/roles/agent/tasks/RedHat.yml b/roles/agent/tasks/RedHat.yml index 83e48a906..2d10f88fd 100644 --- a/roles/agent/tasks/RedHat.yml +++ b/roles/agent/tasks/RedHat.yml @@ -1,5 +1,5 @@ --- -- name: "{{ ansible_os_family }} Derivatives: Download host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.uri: url: "{{ checkmk_agent_agent.url.cee }}?host_name={{ checkmk_agent_host_name }}&os_type=linux_rpm&agent_type=host_name" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -9,50 +9,73 @@ Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" Accept: "application/octet-stream" when: | - checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme" + checkmk_agent_edition | lower != "cre" become: false - register: checkmk_agent_download_state + register: checkmk_agent_host_download_state # This task may fail, as we fall back to the generic agent in that case failed_when: 'false' - changed_when: 'false' + changed_when: checkmk_agent_host_download_state.status is defined and checkmk_agent_host_download_state.status == 200 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Transfer host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "Set Fact: Agent State: host-specific." + ansible.builtin.set_fact: + checkmk_agent_host_specific: >- + {{ (checkmk_agent_host_download_state.status is defined and checkmk_agent_host_download_state.status == 200) | bool }} + +- name: "{{ ansible_os_family }} Derivatives: Transfer host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.copy: src: "{{ checkmk_agent_agent.file.host }}" dest: "{{ checkmk_agent_agent.file.host }}" mode: "0644" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool and checkmk_agent_delegate_download != inventory_hostname tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Install host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Install host-specific {{ checkmk_agent_edition | upper }} Agent." become: true ansible.builtin.yum: name: "{{ checkmk_agent_agent.file.host }}" state: present disable_gpg_check: true when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }} Derivatives: Download GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download folder-specific {{ checkmk_agent_edition | upper }} Agent." + ansible.builtin.uri: + url: "{{ checkmk_agent_agent.url.cee }}?os_type=linux_rpm&agent_type=generic&folder_name={{ checkmk_agent_folder }}" + validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" + dest: "{{ checkmk_agent_agent.file.cee }}" + method: GET + headers: + Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" + Accept: "application/octet-stream" + become: false + register: checkmk_agent_folder_download_state + when: | + checkmk_agent_edition | lower != "cre" + and checkmk_agent_folder is defined + and not checkmk_agent_host_specific | bool + retries: 3 + failed_when: 'false' + changed_when: checkmk_agent_folder_download_state.status is defined and checkmk_agent_folder_download_state.status == 200 + delegate_to: "{{ checkmk_agent_delegate_download }}" + tags: + - download-package + +- name: "Set Fact: Agent State: folder-specific." + ansible.builtin.set_fact: + checkmk_agent_folder_specific: >- + {{ (checkmk_agent_folder_download_state.status is defined and checkmk_agent_folder_download_state.status == 200) | bool }} + +- name: "{{ ansible_os_family }} Derivatives: Download GENERIC {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.uri: url: "{{ checkmk_agent_agent.url.cee }}?os_type=linux_rpm&agent_type=generic" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -63,53 +86,55 @@ Accept: "application/octet-stream" become: false when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not (checkmk_agent_host_specific | bool or checkmk_agent_folder_specific | bool) retries: 3 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Transfer GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Transfer GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.copy: src: "{{ checkmk_agent_agent.file.cee }}" dest: "{{ checkmk_agent_agent.file.cee }}" mode: "0644" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool and checkmk_agent_delegate_download != inventory_hostname tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Install GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Install GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." become: true ansible.builtin.yum: name: "{{ checkmk_agent_agent.file.cee }}" state: present disable_gpg_check: true when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }} Derivatives: Install Checkmk CRE Agent." +- name: "{{ ansible_os_family }} Derivatives: Transfer Vanilla agent." + ansible.builtin.copy: + src: "{{ checkmk_agent_agent.file.cre }}" + dest: "{{ checkmk_agent_agent.file.cre }}" + mode: "0644" + when: | + checkmk_agent_edition | lower == "cre" + and checkmk_agent_delegate_download != inventory_hostname + tags: + - download-package + +- name: "{{ ansible_os_family }} Derivatives: Install Vanilla agent." become: true ansible.builtin.yum: name: "{{ checkmk_agent_agent.file.cre }}" state: present disable_gpg_check: true - when: checkmk_agent_edition == "cre" + when: checkmk_agent_edition | lower == "cre" tags: - install-package diff --git a/roles/agent/tasks/Suse.yml b/roles/agent/tasks/Suse.yml index 35204a235..87de4863b 100644 --- a/roles/agent/tasks/Suse.yml +++ b/roles/agent/tasks/Suse.yml @@ -1,5 +1,5 @@ --- -- name: "{{ ansible_os_family }} Derivatives: Download host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.uri: url: "{{ checkmk_agent_agent.url.cee }}?host_name={{ checkmk_agent_host_name }}&os_type=linux_rpm&agent_type=host_name" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -9,35 +9,34 @@ Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" Accept: "application/octet-stream" when: | - checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme" + checkmk_agent_edition | lower != "cre" become: false - register: checkmk_agent_download_state + register: checkmk_agent_host_download_state # This task may fail, as we fall back to the generic agent in that case failed_when: 'false' - changed_when: 'false' + changed_when: checkmk_agent_host_download_state.status is defined and checkmk_agent_host_download_state.status == 200 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Transfer host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "Set Fact: Agent State: host-specific." + ansible.builtin.set_fact: + checkmk_agent_host_specific: >- + {{ (checkmk_agent_host_download_state.status is defined and checkmk_agent_host_download_state.status == 200) | bool }} + +- name: "{{ ansible_os_family }} Derivatives: Transfer host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.copy: src: "{{ checkmk_agent_agent.file.host }}" dest: "{{ checkmk_agent_agent.file.host }}" mode: "0644" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool and checkmk_agent_delegate_download != inventory_hostname tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Install host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Install host-specific {{ checkmk_agent_edition | upper }} Agent." become: true community.general.zypper: name: "{{ checkmk_agent_agent.file.host }}" @@ -45,15 +44,39 @@ state: present disable_gpg_check: true when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }} Derivatives: Download GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download folder-specific {{ checkmk_agent_edition | upper }} Agent." + ansible.builtin.uri: + url: "{{ checkmk_agent_agent.url.cee }}?os_type=linux_rpm&agent_type=generic&folder_name={{ checkmk_agent_folder }}" + validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" + dest: "{{ checkmk_agent_agent.file.cee }}" + method: GET + headers: + Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" + Accept: "application/octet-stream" + become: false + register: checkmk_agent_folder_download_state + when: | + checkmk_agent_edition | lower != "cre" + and checkmk_agent_folder is defined + and not checkmk_agent_host_specific | bool + retries: 3 + failed_when: 'false' + changed_when: checkmk_agent_folder_download_state.status is defined and checkmk_agent_folder_download_state.status == 200 + delegate_to: "{{ checkmk_agent_delegate_download }}" + tags: + - download-package + +- name: "Set Fact: Agent State: folder-specific." + ansible.builtin.set_fact: + checkmk_agent_folder_specific: >- + {{ (checkmk_agent_folder_download_state.status is defined and checkmk_agent_folder_download_state.status == 200) | bool }} + +- name: "{{ ansible_os_family }} Derivatives: Download GENERIC {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.uri: url: "{{ checkmk_agent_agent.url.cee }}?os_type=linux_rpm&agent_type=generic" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -64,32 +87,26 @@ Accept: "application/octet-stream" become: false when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not (checkmk_agent_host_specific | bool or checkmk_agent_folder_specific | bool) retries: 3 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Transfer GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Transfer GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." ansible.builtin.copy: src: "{{ checkmk_agent_agent.file.cee }}" dest: "{{ checkmk_agent_agent.file.cee }}" mode: "0644" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool and checkmk_agent_delegate_download != inventory_hostname tags: - download-package -- name: "{{ ansible_os_family }} Derivatives: Install GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Install GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." become: true community.general.zypper: name: "{{ checkmk_agent_agent.file.cee }}" @@ -97,21 +114,29 @@ state: present disable_gpg_check: true when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }} Derivatives: Install Checkmk CRE Agent." +- name: "{{ ansible_os_family }} Derivatives: Transfer Vanilla agent." + ansible.builtin.copy: + src: "{{ checkmk_agent_agent.file.cre }}" + dest: "{{ checkmk_agent_agent.file.cre }}" + mode: "0644" + when: | + checkmk_agent_edition | lower == "cre" + and checkmk_agent_delegate_download != inventory_hostname + tags: + - download-package + +- name: "{{ ansible_os_family }} Derivatives: Install Vanilla agent." become: true community.general.zypper: name: "{{ checkmk_agent_agent.file.cre }}" force: "{{ checkmk_agent_force_install | bool }}" state: present disable_gpg_check: true - when: checkmk_agent_edition == "cre" + when: checkmk_agent_edition | lower == "cre" tags: - install-package diff --git a/roles/agent/tasks/Win32NT.yml b/roles/agent/tasks/Win32NT.yml index 4560a0d2c..876b21f78 100644 --- a/roles/agent/tasks/Win32NT.yml +++ b/roles/agent/tasks/Win32NT.yml @@ -43,10 +43,7 @@ args: chdir: "C:\\Program Files (x86)\\checkmk\\service\\" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") + checkmk_agent_edition | lower != "cre" and checkmk_agent_binary.stat.exists | bool and checkmk_agent_update | bool and (checkmk_agent_pass is defined and checkmk_agent_pass | length) @@ -61,10 +58,7 @@ args: chdir: "C:\\Program Files (x86)\\checkmk\\service\\" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") + checkmk_agent_edition | lower != "cre" and checkmk_agent_binary.stat.exists | bool and checkmk_agent_update | bool and (checkmk_agent_secret is defined and checkmk_agent_secret | length) diff --git a/roles/agent/tasks/Windows.yml b/roles/agent/tasks/Windows.yml index 0ef34edb1..23f1c03d2 100644 --- a/roles/agent/tasks/Windows.yml +++ b/roles/agent/tasks/Windows.yml @@ -1,18 +1,18 @@ --- -- name: "{{ ansible_os_family }}: Download Checkmk CRE Agent." +- name: "{{ ansible_os_family }}: Download Vanilla agent." ansible.windows.win_get_url: url: "{{ checkmk_agent_agent.url.cre }}" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" dest: "{{ checkmk_agent_agent.file.cre }}" - when: checkmk_agent_edition == "cre" + when: checkmk_agent_edition | lower == "cre" register: result retries: 3 delay: 10 - until: "result.changed | bool" + until: "not result.failed | bool" tags: - download-package -- name: "{{ ansible_os_family }}: Download host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }}: Download host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.windows.win_get_url: url: "{{ checkmk_agent_agent.url.cee }}?host_name={{ checkmk_agent_host_name }}&os_type=windows_msi&agent_type=host_name" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -22,32 +22,57 @@ Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" Accept: "application/octet-stream" when: | - checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme" - register: checkmk_agent_download_state + checkmk_agent_edition | lower != "cre" + register: checkmk_agent_host_download_state # This task may fail, as we fall back to the generic agent in that case failed_when: 'false' - changed_when: 'false' + changed_when: checkmk_agent_host_download_state.status_code is defined and checkmk_agent_host_download_state.status_code == 200 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }}: Install host-specific Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "Set Fact: Agent State: host-specific." + ansible.builtin.set_fact: + checkmk_agent_host_specific: >- + {{ (checkmk_agent_host_download_state.status_code is defined and checkmk_agent_host_download_state.status_code == 200) | bool }} + +- name: "{{ ansible_os_family }}: Install host-specific {{ checkmk_agent_edition | upper }} Agent." ansible.windows.win_package: path: "{{ checkmk_agent_agent.file.host }}" state: present when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status_code == 200 + checkmk_agent_edition | lower != "cre" + and checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }}: Download GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }} Derivatives: Download folder-specific {{ checkmk_agent_edition | upper }} Agent." + ansible.windows.win_get_url: + url: "{{ checkmk_agent_agent.url.cee }}?os_type=windows_msi&agent_type=generic&folder_name={{ checkmk_agent_folder }}" + validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" + dest: "{{ checkmk_agent_agent.file.cee }}" + method: GET + headers: + Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" + Accept: "application/octet-stream" + register: checkmk_agent_folder_download_state + when: | + checkmk_agent_edition | lower != "cre" + and checkmk_agent_folder is defined + and not checkmk_agent_host_specific | bool + retries: 3 + failed_when: 'false' + changed_when: checkmk_agent_folder_download_state.status_code is defined and checkmk_agent_folder_download_state.status_code == 200 + delegate_to: "{{ checkmk_agent_delegate_download }}" + tags: + - download-package + +- name: "Set Fact: Agent State: folder-specific." + ansible.builtin.set_fact: + checkmk_agent_folder_specific: >- + {{ (checkmk_agent_folder_download_state.status_code is defined and checkmk_agent_folder_download_state.status_code == 200) | bool }} + +- name: "{{ ansible_os_family }}: Download GENERIC {{ checkmk_agent_edition | upper }} Agent." ansible.windows.win_get_url: url: "{{ checkmk_agent_agent.url.cee }}?os_type=windows_msi&agent_type=generic" validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" @@ -57,33 +82,27 @@ Authorization: "Bearer {{ checkmk_agent_user }} {{ checkmk_agent_auth }}" Accept: "application/octet-stream" when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status_code != 200 + checkmk_agent_edition | lower != "cre" + and not (checkmk_agent_host_specific | bool or checkmk_agent_folder_specific | bool) retries: 3 delegate_to: "{{ checkmk_agent_delegate_download }}" tags: - download-package -- name: "{{ ansible_os_family }}: Install GENERIC Checkmk {{ checkmk_agent_edition | upper }} Agent." +- name: "{{ ansible_os_family }}: Install GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent." ansible.windows.win_package: path: "{{ checkmk_agent_agent.file.cee }}" state: present when: | - (checkmk_agent_edition == "cee" or - checkmk_agent_edition == "cce" or - checkmk_agent_edition == "cfe" or - checkmk_agent_edition == "cme") - and checkmk_agent_download_state.status_code != 200 + checkmk_agent_edition | lower != "cre" + and not checkmk_agent_host_specific | bool tags: - install-package -- name: "{{ ansible_os_family }}: Install Checkmk CRE Agent." +- name: "{{ ansible_os_family }}: Install Vanilla agent." ansible.windows.win_package: path: "{{ checkmk_agent_agent.file.cre }}" state: present - when: checkmk_agent_edition == "cre" + when: checkmk_agent_edition | lower == "cre" tags: - install-package diff --git a/roles/agent/tasks/main.yml b/roles/agent/tasks/main.yml index 57ae2ce1a..bd414bc8f 100644 --- a/roles/agent/tasks/main.yml +++ b/roles/agent/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: "Preflight - Fail if Checkmk Edition is incorrect." + ansible.builtin.fail: + msg: "The provided Checkmk Edition '{{ checkmk_agent_edition }}' does not exist or is not supported by this role." + when: checkmk_agent_edition | lower not in checkmk_agent_edition_mapping + - name: "Include OS family specific variables." ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" tags: diff --git a/roles/agent/vars/main.yml b/roles/agent/vars/main.yml index f6a712bf6..6211fb2a7 100644 --- a/roles/agent/vars/main.yml +++ b/roles/agent/vars/main.yml @@ -2,3 +2,11 @@ checkmk_agent_site_url: "{{ checkmk_agent_protocol }}://{{ checkmk_agent_server }}:{{ checkmk_agent_port }}/{{ checkmk_agent_site }}" checkmk_agent_auth: "{% if checkmk_agent_secret is defined and checkmk_agent_secret | length %}{{ checkmk_agent_secret }}{% else %}{{ checkmk_agent_pass }}{% endif %}" # noqa yaml[line-length] + +# Due to inconsistent naming of editions, we normalize them here for convenience +checkmk_agent_edition_mapping: + cre: raw + cfe: free + cee: enterprise + cce: cloud + cme: managed diff --git a/roles/server/README.md b/roles/server/README.md index f7faac221..d1f8372bf 100644 --- a/roles/server/README.md +++ b/roles/server/README.md @@ -23,7 +23,7 @@ To learn about the distributions used in automated tests, inspect the correspond - checkmk_server_version: "2.2.0p7" + checkmk_server_version: "2.2.0p8" The Checkmk version of your site. diff --git a/roles/server/defaults/main.yml b/roles/server/defaults/main.yml index 0a39c3ca9..fe1d3bdbf 100644 --- a/roles/server/defaults/main.yml +++ b/roles/server/defaults/main.yml @@ -24,7 +24,7 @@ checkmk_server_server_stable_os: - Ubuntu-20 - Ubuntu-22 -checkmk_server_version: "2.2.0p7" +checkmk_server_version: "2.2.0p8" checkmk_server_edition: cre checkmk_server_verify_setup: 'true' diff --git a/roles/server/molecule/2.2.0/group_vars/all.yml b/roles/server/molecule/2.2.0/group_vars/all.yml index 5c665de2a..6b5d2a834 100644 --- a/roles/server/molecule/2.2.0/group_vars/all.yml +++ b/roles/server/molecule/2.2.0/group_vars/all.yml @@ -1,6 +1,6 @@ --- # General -checkmk_version: "2.2.0p7" +checkmk_version: "2.2.0p8" checkmk_edition: "cre" checkmk_site: "my_site" server_url: "http://127.0.0.1/" diff --git a/roles/server/tasks/main.yml b/roles/server/tasks/main.yml index adb48187f..551d5b8fa 100644 --- a/roles/server/tasks/main.yml +++ b/roles/server/tasks/main.yml @@ -6,6 +6,11 @@ (ansible_distribution_version is not defined) or (ansible_distribution + "-" + ansible_distribution_major_version not in checkmk_server_server_stable_os) +- name: "Preflight - Fail if Checkmk Edition is incorrect." + ansible.builtin.fail: + msg: "The provided Checkmk Edition '{{ checkmk_server_edition | lower }}' does not exist or is not supported by this role." + when: checkmk_server_edition | lower not in checkmk_server_edition_mapping + - name: "Include OS Family specific Variables." ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" tags: diff --git a/roles/server/tasks/sites.yml b/roles/server/tasks/sites.yml index 3962acd68..c19b57c5c 100644 --- a/roles/server/tasks/sites.yml +++ b/roles/server/tasks/sites.yml @@ -3,7 +3,7 @@ become: true ansible.builtin.shell: | set -o pipefail - omd -V {{ item.version }}.{{ checkmk_server_edition }} create {{ item.name }} + omd -V {{ item.version }}.{{ checkmk_server_edition | lower }} create {{ item.name }} args: executable: /bin/bash creates: "/omd/sites/{{ item.name }}" @@ -23,7 +23,7 @@ executable: /bin/bash no_log: true loop: "{{ checkmk_server_sites }}" - changed_when: "checkmk_server_sites_versions.stdout != item.version + '.' + checkmk_server_edition" + changed_when: "checkmk_server_sites_versions.stdout != item.version + '.' + checkmk_server_edition | lower" when: item.state != "absent" register: checkmk_server_sites_versions tags: diff --git a/roles/server/tasks/update-site.yml b/roles/server/tasks/update-site.yml index 55696fbd5..6e5fd93b4 100644 --- a/roles/server/tasks/update-site.yml +++ b/roles/server/tasks/update-site.yml @@ -8,7 +8,7 @@ - name: "Check if desired version is installed." ansible.builtin.shell: | set -o pipefail - omd versions | egrep -o '{{ item.item.version }}.{{ checkmk_server_edition }}' + omd versions | egrep -o '{{ item.item.version }}.{{ checkmk_server_edition | lower }}' args: executable: /bin/bash register: checkmk_server_sites_versions @@ -27,7 +27,7 @@ ansible.builtin.pause: seconds: 5 prompt: | - Proceeding with updating site {{ item.item.name }} from version {{ item.stdout }} to version {{ item.item.version }}.{{ checkmk_server_edition }}. + Proceeding with updating site {{ item.item.name }} from version {{ item.stdout }} to version {{ item.item.version }}.{{ checkmk_server_edition | lower }}. This is a minor patch update.{% if checkmk_server_backup_on_update %} A backup will be created in {{ checkmk_server_backup_dir }}. {% endif %} This can take a while! The site will be down during the update when: | @@ -39,7 +39,8 @@ ansible.builtin.pause: seconds: 60 prompt: > - Proceeding with updating site {{ item.item.name }} from version {{ item.stdout }} to version {{ item.item.version }}.{{ checkmk_server_edition }}.\n + Proceeding with updating site {{ item.item.name }} + from version {{ item.stdout }} to version {{ item.item.version }}.{{ checkmk_server_edition | lower }}.\n This is a major update. This can carry risks. {% if checkmk_server_backup_on_update %} A backup will be created in {{ checkmk_server_backup_dir }}. {% endif %}\n This can take a while! The site will be down during the update @@ -60,7 +61,7 @@ become: true ansible.builtin.shell: | omd stop {{ item.item.name }} - omd -f -V {{ item.item.version }}.{{ checkmk_server_edition }} update --conflict {{ item.item.update_conflict_resolution }} {{ item.item.name }} + omd -f -V {{ item.item.version }}.{{ checkmk_server_edition | lower }} update --conflict {{ item.item.update_conflict_resolution }} {{ item.item.name }} args: executable: /bin/bash register: checkmk_server_sites_updated diff --git a/roles/server/vars/Debian.yml b/roles/server/vars/Debian.yml index ca2f93f44..569f1094b 100644 --- a/roles/server/vars/Debian.yml +++ b/roles/server/vars/Debian.yml @@ -1,5 +1,5 @@ --- -checkmk_server_setup_file: "check-mk-{{ checkmk_server_edition_mapping[checkmk_server_edition] }}-{{ checkmk_server_version }}_0.{{ ansible_distribution_release }}_amd64.deb" # noqa yaml[line-length] +checkmk_server_setup_file: "check-mk-{{ checkmk_server_edition_mapping[checkmk_server_edition | lower] }}-{{ checkmk_server_version }}_0.{{ ansible_distribution_release }}_amd64.deb" # noqa yaml[line-length] checkmk_server_prerequisites: - freeipmi diff --git a/roles/server/vars/RedHat.yml b/roles/server/vars/RedHat.yml index 763b9060f..8494d13a6 100644 --- a/roles/server/vars/RedHat.yml +++ b/roles/server/vars/RedHat.yml @@ -1,6 +1,6 @@ --- -checkmk_server_setup_file: "check-mk-{{ checkmk_server_edition_mapping[checkmk_server_edition] }}-{{ checkmk_server_version }}-el{{ ansible_distribution_major_version }}-38.x86_64.rpm" # noqa yaml[line-length] +checkmk_server_setup_file: "check-mk-{{ checkmk_server_edition_mapping[checkmk_server_edition | lower] }}-{{ checkmk_server_version }}-el{{ ansible_distribution_major_version }}-38.x86_64.rpm" # noqa yaml[line-length] checkmk_server_ports: - 80/tcp diff --git a/scripts/release.sh b/scripts/release.sh index 99527bc41..79e251a82 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -17,7 +17,7 @@ collection_dir="${script_dir%/*}" # Update these as necessary: checkmk_ancient="2.0.0p38" checkmk_oldstable="2.1.0p32" -checkmk_stable="2.2.0p7" +checkmk_stable="2.2.0p8" while getopts 's:t:' OPTION; do case "$OPTION" in diff --git a/tests/integration/targets/activation/vars/main.yml b/tests/integration/targets/activation/vars/main.yml index 07a8e82f5..a552bdaa6 100644 --- a/tests/integration/targets/activation/vars/main.yml +++ b/tests/integration/targets/activation/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/bakery/vars/main.yml b/tests/integration/targets/bakery/vars/main.yml index cad589e93..d06c63b13 100644 --- a/tests/integration/targets/bakery/vars/main.yml +++ b/tests/integration/targets/bakery/vars/main.yml @@ -3,7 +3,7 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/contact_group/vars/main.yml b/tests/integration/targets/contact_group/vars/main.yml index ea9ded16f..8a2186b2c 100644 --- a/tests/integration/targets/contact_group/vars/main.yml +++ b/tests/integration/targets/contact_group/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/discovery/vars/main.yml b/tests/integration/targets/discovery/vars/main.yml index a141225e6..89ca29cbf 100644 --- a/tests/integration/targets/discovery/vars/main.yml +++ b/tests/integration/targets/discovery/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/downtime/vars/main.yml b/tests/integration/targets/downtime/vars/main.yml index 07a8e82f5..a552bdaa6 100644 --- a/tests/integration/targets/downtime/vars/main.yml +++ b/tests/integration/targets/downtime/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/folder/vars/main.yml b/tests/integration/targets/folder/vars/main.yml index 45db8384a..0f8956039 100644 --- a/tests/integration/targets/folder/vars/main.yml +++ b/tests/integration/targets/folder/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/host/vars/main.yml b/tests/integration/targets/host/vars/main.yml index d0c3ec9ef..769511d32 100644 --- a/tests/integration/targets/host/vars/main.yml +++ b/tests/integration/targets/host/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/host_group/vars/main.yml b/tests/integration/targets/host_group/vars/main.yml index eaeabb8f9..49c1187c7 100644 --- a/tests/integration/targets/host_group/vars/main.yml +++ b/tests/integration/targets/host_group/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/lookup_version/tasks/main.yml b/tests/integration/targets/lookup_version/tasks/main.yml new file mode 100644 index 000000000..d2a7115a7 --- /dev/null +++ b/tests/integration/targets/lookup_version/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: "Run preparations." + ansible.builtin.include_tasks: prep.yml + +- name: "Wait for site to be ready." + ansible.builtin.pause: + seconds: 5 + when: | + ((download_pass is defined and download_pass | length) or item.item.edition == 'cre') + and (item.stdout_lines is defined and 'OVERALL 1' in item.stdout_lines) + loop: "{{ site_status.results }}" + +- name: "Testing." + ansible.builtin.include_tasks: test.yml + loop: "{{ test_sites }}" + loop_control: + loop_var: outer_item + when: (download_pass is defined and download_pass | length) or outer_item.edition == "cre" diff --git a/tests/integration/targets/lookup_version/tasks/prep.yml b/tests/integration/targets/lookup_version/tasks/prep.yml new file mode 100644 index 000000000..7f81d9051 --- /dev/null +++ b/tests/integration/targets/lookup_version/tasks/prep.yml @@ -0,0 +1,31 @@ +--- +- name: "Download Checkmk Versions." + ansible.builtin.get_url: + url: "{{ download_url }}" + dest: /tmp/checkmk-server-{{ item.site }}.deb + mode: "0640" + url_username: "{{ download_user | default(omit) }}" + url_password: "{{ download_pass | default(omit) }}" + loop: "{{ test_sites }}" + when: (download_pass is defined and download_pass | length) or item.edition == "cre" + +- name: "Install Checkmk Versions." + ansible.builtin.apt: + deb: /tmp/checkmk-server-{{ item.site }}.deb + state: present + loop: "{{ test_sites }}" + when: (download_pass is defined and download_pass | length) or item.edition == "cre" + +- name: "Create Sites." + ansible.builtin.command: "omd -V {{ item.version }}.{{ item.edition }} create --no-tmpfs --admin-password {{ automation_secret }} {{ item.site }}" + args: + creates: "/omd/sites/{{ item.site }}" + loop: "{{ test_sites }}" + when: (download_pass is defined and download_pass | length) or item.edition == "cre" + +- name: "Start Sites." + ansible.builtin.shell: "omd status -b {{ item.site }} || omd start {{ item.site }}" + register: site_status + changed_when: site_status.rc == "0" + loop: "{{ test_sites }}" + when: (download_pass is defined and download_pass | length) or item.edition == "cre" diff --git a/tests/integration/targets/lookup_version/tasks/test.yml b/tests/integration/targets/lookup_version/tasks/test.yml new file mode 100644 index 000000000..31a6e8c01 --- /dev/null +++ b/tests/integration/targets/lookup_version/tasks/test.yml @@ -0,0 +1,17 @@ +--- +- name: "{{ outer_item.version }} - Get Checkmk version." + ansible.builtin.debug: + msg: "Version is {{ version }}" + vars: + version: "{{ lookup('checkmk.general.version', + server_url + '/' + outer_item.site, + validate_certs=False, + automation_user=automation_user, + automation_secret=automation_secret) + }}" + delegate_to: localhost + register: looked_up_version + +- name: "{{ outer_item.version }} - Verify Checkmk version." + ansible.builtin.assert: + that: "outer_item.version in looked_up_version.msg" diff --git a/tests/integration/targets/lookup_version/vars/main.yml b/tests/integration/targets/lookup_version/vars/main.yml new file mode 100644 index 000000000..623c0404a --- /dev/null +++ b/tests/integration/targets/lookup_version/vars/main.yml @@ -0,0 +1,33 @@ +--- +# In these integration tests, we do not normalize the edition naming, but stick +# to the naming of the setup files. For example 'raw' and 'enterprise' rather +# than 'CRE' and 'CEE'. +test_sites: + - version: "2.2.0p8" + edition: "cre" + site: "stable_raw" + - version: "2.2.0p8" + edition: "cee" + site: "stable_ent" + - version: "2.1.0p32" + edition: "cre" + site: "old_raw" + - version: "2.0.0p38" + edition: "cre" + site: "ancient_raw" + +server_url: "http://127.0.0.1/" +automation_user: "cmkadmin" +automation_secret: "d7589df1" + +download_url: "https://download.checkmk.com/checkmk/{{ item.version }}/check-mk-{{ checkmk_server_edition_mapping[item.edition] }}-{{ item.version }}_0.{{ ansible_distribution_release }}_amd64.deb" # noqa yaml[line-length] +download_user: "d-gh-ansible-dl" +download_pass: "{{ lookup('ansible.builtin.file', '/root/ansible_collections/checkmk/general/tests/integration/files/.dl-secret', errors='ignore') | default(omit) }}" # noqa yaml[line-length] + +# Due to inconsistent naming of editions, we normalize them here for convenience +checkmk_server_edition_mapping: + cre: raw + cfe: free + cee: enterprise + cce: cloud + cme: managed diff --git a/tests/integration/targets/password/vars/main.yml b/tests/integration/targets/password/vars/main.yml index d9688f498..9ddd1a98e 100644 --- a/tests/integration/targets/password/vars/main.yml +++ b/tests/integration/targets/password/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/rule/vars/main.yml b/tests/integration/targets/rule/vars/main.yml index f224f95d4..67f0d7668 100644 --- a/tests/integration/targets/rule/vars/main.yml +++ b/tests/integration/targets/rule/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/service_group/vars/main.yml b/tests/integration/targets/service_group/vars/main.yml index ed777a8cf..74f078998 100644 --- a/tests/integration/targets/service_group/vars/main.yml +++ b/tests/integration/targets/service_group/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/tag_group/vars/main.yml b/tests/integration/targets/tag_group/vars/main.yml index 79e330c9c..623c0404a 100644 --- a/tests/integration/targets/tag_group/vars/main.yml +++ b/tests/integration/targets/tag_group/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32" diff --git a/tests/integration/targets/user/vars/main.yml b/tests/integration/targets/user/vars/main.yml index 952520510..e0eb20eb3 100644 --- a/tests/integration/targets/user/vars/main.yml +++ b/tests/integration/targets/user/vars/main.yml @@ -3,10 +3,10 @@ # to the naming of the setup files. For example 'raw' and 'enterprise' rather # than 'CRE' and 'CEE'. test_sites: - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cre" site: "stable_raw" - - version: "2.2.0p7" + - version: "2.2.0p8" edition: "cee" site: "stable_ent" - version: "2.1.0p32"