From 241a52a2ef91d9d8f104c38ab8805581bfabc8ef Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 2 Aug 2023 14:38:16 +0200 Subject: [PATCH 01/86] sanity fix --- docs/source/release_notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index 46a38628..4768e964 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -3,7 +3,7 @@ Release notes Version 1.14.0 -- New pipeline module added, smaller changes to datastore and user module -------------------------------------------- -Added pipeline module, smaller changes to datastore and user module +Added pipeline module, smaller changes to datastore and user module, solved bcrypt check bug **New features:** From afc0593199b01bca7a4d06f26bf1a9b9b900b018 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 2 Aug 2023 14:41:48 +0200 Subject: [PATCH 02/86] white space fix --- docs/source/release_notes.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index 4768e964..5ce9c51d 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -2,7 +2,6 @@ Release notes ============= Version 1.14.0 -- New pipeline module added, smaller changes to datastore and user module -------------------------------------------- - Added pipeline module, smaller changes to datastore and user module, solved bcrypt check bug **New features:** From 88e0cfa31b04a60cde2161d7a5b0fd96d21c7454 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 2 Aug 2023 14:47:11 +0200 Subject: [PATCH 03/86] fixing title line --- docs/source/release_notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index 5ce9c51d..fff4fb97 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -1,7 +1,7 @@ Release notes ============= Version 1.14.0 -- New pipeline module added, smaller changes to datastore and user module --------------------------------------------- +----------------------------------------------------------------------------------------- Added pipeline module, smaller changes to datastore and user module, solved bcrypt check bug **New features:** From b5733f0fa451e890a4c633e45f825313ec6eac4a Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 09:55:36 +0200 Subject: [PATCH 04/86] image update --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96612ff4..c8a80085 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,7 +85,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: ubuntu-2004:202101-01 + image: ubuntu-2204:2023.07.2 working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From 2433ddf5d4a91c82264ba163e21291c528006ba4 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:37:23 +0200 Subject: [PATCH 05/86] test new matrix --- .circleci/config.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c8a80085..276b2344 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,13 +8,11 @@ workflows: matrix: &matrix parameters: # ansible is branch name in ansible/ansible git repo - ansible: - - stable-2.9 - - stable-2.10 - - stable-2.11 - - stable-2.12 - - stable-2.13 - - stable-2.14 + ansible: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, stable-2.14] + inlcude: + - image: ubuntu-2004:202101-01 + - image: ubuntu-2204:2023.07.2 + parameters.ansible: stable-2.14 - unit_test: @@ -85,7 +83,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: ubuntu-2204:2023.07.2 + image: << image >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From 9ff30efa63538f0971b9f0fd58ccd79ab60e8206 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:40:23 +0200 Subject: [PATCH 06/86] test matrix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 276b2344..5991b1a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: << image >> + image: << parameters.image >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From c157524b98d1ef89f8f14007f7e47fde54e67c44 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:42:39 +0200 Subject: [PATCH 07/86] maxtrix test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5991b1a9..d1a5bd8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: << parameters.image >> + image: ${{ matrix.image }} working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From 8b458924ef34c32c25ad9e1b00873ba202236931 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:43:46 +0200 Subject: [PATCH 08/86] matrix test --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1a5bd8b..25033fad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,7 @@ workflows: parameters: # ansible is branch name in ansible/ansible git repo ansible: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, stable-2.14] + image: [ubuntu-2004:202101-01, ubuntu-2204:2023.07.2] inlcude: - image: ubuntu-2004:202101-01 - image: ubuntu-2204:2023.07.2 From cd14a5662928ad5a17379a47948e70bb7d1b22ab Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:44:41 +0200 Subject: [PATCH 09/86] matrix test --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 25033fad..f15a7439 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,10 +9,10 @@ workflows: parameters: # ansible is branch name in ansible/ansible git repo ansible: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, stable-2.14] - image: [ubuntu-2004:202101-01, ubuntu-2204:2023.07.2] + image_ubuntu: [ubuntu-2004:202101-01, ubuntu-2204:2023.07.2] inlcude: - - image: ubuntu-2004:202101-01 - - image: ubuntu-2204:2023.07.2 + - image_ubuntu: ubuntu-2004:202101-01 + - image_ubuntu: ubuntu-2204:2023.07.2 parameters.ansible: stable-2.14 @@ -84,7 +84,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: ${{ matrix.image }} + image: ${{ matrix.image_ubuntu }} working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From b0b9c8e11ded7cdc231109162d07e16792a5e136 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:45:28 +0200 Subject: [PATCH 10/86] matrix test --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f15a7439..2a40ee3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,6 @@ workflows: parameters: # ansible is branch name in ansible/ansible git repo ansible: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, stable-2.14] - image_ubuntu: [ubuntu-2004:202101-01, ubuntu-2204:2023.07.2] inlcude: - image_ubuntu: ubuntu-2004:202101-01 - image_ubuntu: ubuntu-2204:2023.07.2 From 2d7a022c4fd55b11f44d8716985557e955e7770c Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 10:56:38 +0200 Subject: [PATCH 11/86] maxtrix test --- .circleci/config.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a40ee3e..8ec192f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,10 +9,18 @@ workflows: parameters: # ansible is branch name in ansible/ansible git repo ansible: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, stable-2.14] - inlcude: - - image_ubuntu: ubuntu-2004:202101-01 - - image_ubuntu: ubuntu-2204:2023.07.2 - parameters.ansible: stable-2.14 + image_ubuntu: [ubuntu-2004:202101-01, ubuntu-2204:2023.07.2] + exclude: + - stable-2.9 + ubuntu-2204:2023.07.2 + - stable-2.10 + ubuntu-2204:2023.07.2 + - stable-2.11 + ubuntu-2204:2023.07.2 + - stable-2.12 + ubuntu-2204:2023.07.2 + - stable-2.13 + ubuntu-2204:2023.07.2 - unit_test: @@ -83,7 +91,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: ${{ matrix.image_ubuntu }} + image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From fea8e11d6022b23f620976f25c5ec97e0834a627 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:02:49 +0200 Subject: [PATCH 12/86] matrix test --- .circleci/config.yml | 46 -------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ec192f1..d30a520b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,6 @@ workflows: - stable-2.13 ubuntu-2204:2023.07.2 - - unit_test: matrix: *matrix @@ -38,51 +37,6 @@ workflows: - integration_test_git matrix: *matrix - cron_master: - triggers: - - schedule: - cron: "12 5 * * 0,3" - filters: { branches: { only: [ master ] } } - jobs: - - integration_test_git: - matrix: *matrix - - cron_released: - triggers: - - schedule: - cron: "12 5 * * 1,4" - filters: { branches: { only: [ stable ] } } - jobs: - - integration_test_galaxy: - matrix: *matrix - - cron_ansible_devel: - triggers: - - schedule: - cron: "12 5 * * 2,5" - filters: { branches: { only: [ master ] } } - jobs: - - sanity_test: - matrix: &devel-matrix - parameters: - ansible: [ devel ] - - - unit_test: - matrix: *devel-matrix - - - integration_test_git: - requires: - - sanity_test - - unit_test - matrix: *devel-matrix - - windows_version_check: - triggers: - - schedule: - cron: "12 3 * * 0,2,4" - filters: { branches: { only: [ master ] } } - jobs: - - windows_version_check jobs: sanity_test: From f14991a0a740d7caeb6cb2c3305931799b3888f1 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:07:35 +0200 Subject: [PATCH 13/86] matrix test --- .circleci/config.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d30a520b..de94cb07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,19 +8,21 @@ workflows: matrix: &matrix parameters: # ansible is branch name in ansible/ansible git repo - ansible: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, stable-2.14] - image_ubuntu: [ubuntu-2004:202101-01, ubuntu-2204:2023.07.2] + ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14"] + image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"] exclude: - - stable-2.9 - ubuntu-2204:2023.07.2 - - stable-2.10 - ubuntu-2204:2023.07.2 - - stable-2.11 - ubuntu-2204:2023.07.2 - - stable-2.12 - ubuntu-2204:2023.07.2 - - stable-2.13 - ubuntu-2204:2023.07.2 + - ansible: "stable-2.9" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.10" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.11" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.12" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.13" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.14" + image_ubuntu: "ubuntu-2004:202101-01" - unit_test: matrix: *matrix From 576fe8346033d20bafe507e9e98b441c8fea03b6 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:10:18 +0200 Subject: [PATCH 14/86] matrix test --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index de94cb07..55ac4b65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,6 @@ jobs: description: Ansible version to use type: string machine: &ci-machine - image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From bd82f8b41a3053981bc725b6455027664e1af1e7 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:14:32 +0200 Subject: [PATCH 15/86] matrix test --- .circleci/config.yml | 78 -------------------------------------------- 1 file changed, 78 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55ac4b65..b7c2f0ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,22 +24,6 @@ workflows: - ansible: "stable-2.14" image_ubuntu: "ubuntu-2004:202101-01" - - unit_test: - matrix: *matrix - - - integration_test_git: - requires: - - sanity_test - - unit_test - matrix: *matrix - - - integration_test_galaxy: - filters: { branches: { only: [ stable ] } } - requires: - - integration_test_git - matrix: *matrix - - jobs: sanity_test: parameters: @@ -55,68 +39,6 @@ jobs: test_commands: - run: make sanity - unit_test: - parameters: - ansible: - description: Ansible version to use - type: string - machine: *ci-machine - working_directory: ~/ansible_collections/sensu/sensu_go - steps: - - wrapper: - ansible: << parameters.ansible >> - kind: sanity - test_commands: - - run: make units - - store_artifacts: - path: tests/output/reports/coverage - destination: coverage-report - - store_test_results: - path: tests/output/junit - - integration_test_git: - parallelism: 6 - parameters: - ansible: - description: Ansible version to use - type: string - machine: *ci-machine - working_directory: ~/sensu_go - steps: - - wrapper: - ansible: << parameters.ansible >> - kind: integration - test_commands: - - run: ansible-galaxy collection build - - run: ansible-galaxy collection install sensu-sensu_go-*.tar.gz - - run_integration_tests - - integration_test_galaxy: - parallelism: 6 - parameters: - ansible: - description: Ansible version to use - type: string - machine: *ci-machine - working_directory: ~/sensu_go - steps: - - wrapper: - ansible: << parameters.ansible >> - kind: integration - test_commands: - - run: | - ansible-galaxy collection install \ - sensu.sensu_go:$(grep version: galaxy.yml | cut -d" " -f2) - - run_integration_tests - - windows_version_check: - docker: - - image: cimg/python:3.10.6 - steps: - - checkout - - run: pip3 install pyyaml - - run: make check_windows_versions - commands: run_integration_tests: description: Run integration tests From 855e38406778aff6145b9938da6c465843565b25 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:16:53 +0200 Subject: [PATCH 16/86] matrix test --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b7c2f0ce..48df3a42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,6 +31,7 @@ jobs: description: Ansible version to use type: string machine: &ci-machine + image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From e55a8f6854c92462cece3f3fb39fe4b35a154e13 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:19:33 +0200 Subject: [PATCH 17/86] matrix test --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48df3a42..6f32d585 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,9 @@ jobs: ansible: description: Ansible version to use type: string + image_ubuntu: + description: Ubuntu image + type: string machine: &ci-machine image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go From fe785948154f5399ef9da0909fd7299ce93b9be1 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:23:04 +0200 Subject: [PATCH 18/86] adding back unit tests --- .circleci/config.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f32d585..7a82892f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,9 @@ workflows: - ansible: "stable-2.14" image_ubuntu: "ubuntu-2004:202101-01" + - unit_test: + matrix: *matrix + jobs: sanity_test: parameters: @@ -43,6 +46,28 @@ jobs: test_commands: - run: make sanity + unit_test: + parameters: + ansible: + description: Ansible version to use + type: string + image_ubuntu: + description: Ubuntu image + type: string + machine: *ci-machine + working_directory: ~/ansible_collections/sensu/sensu_go + steps: + - wrapper: + ansible: << parameters.ansible >> + kind: sanity + test_commands: + - run: make units + - store_artifacts: + path: tests/output/reports/coverage + destination: coverage-report + - store_test_results: + path: tests/output/junit + commands: run_integration_tests: description: Run integration tests From 5b7138d13298cef964e3549296a1c07ffdd35682 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:24:57 +0200 Subject: [PATCH 19/86] adding back integration test_git --- .circleci/config.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a82892f..e399b51a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,12 @@ workflows: - unit_test: matrix: *matrix + - integration_test_git: + requires: + - sanity_test + - unit_test + matrix: *matrix + jobs: sanity_test: parameters: @@ -68,6 +74,26 @@ jobs: - store_test_results: path: tests/output/junit + integration_test_git: + parallelism: 6 + parameters: + ansible: + description: Ansible version to use + type: string + image_ubuntu: + description: Ubuntu image + type: string + machine: *ci-machine + working_directory: ~/sensu_go + steps: + - wrapper: + ansible: << parameters.ansible >> + kind: integration + test_commands: + - run: ansible-galaxy collection build + - run: ansible-galaxy collection install sensu-sensu_go-*.tar.gz + - run_integration_tests + commands: run_integration_tests: description: Run integration tests From 0d494b0a472c253a419673742b60d116815e7f88 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:36:15 +0200 Subject: [PATCH 20/86] adding other workflows back --- .circleci/config.yml | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e399b51a..0f4da01c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,58 @@ workflows: - unit_test matrix: *matrix + - integration_test_galaxy: + filters: { branches: { only: [ stable ] } } + requires: + - integration_test_git + matrix: *matrix + + cron_master: + triggers: + - schedule: + cron: "12 5 * * 0,3" + filters: { branches: { only: [ master ] } } + jobs: + - integration_test_git: + matrix: *matrix + + cron_released: + triggers: + - schedule: + cron: "12 5 * * 1,4" + filters: { branches: { only: [ stable ] } } + jobs: + - integration_test_galaxy: + matrix: *matrix + + cron_ansible_devel: + triggers: + - schedule: + cron: "12 5 * * 2,5" + filters: { branches: { only: [ master ] } } + jobs: + - sanity_test: + matrix: &devel-matrix + parameters: + ansible: [ devel ] + + - unit_test: + matrix: *devel-matrix + + - integration_test_git: + requires: + - sanity_test + - unit_test + matrix: *devel-matrix + + windows_version_check: + triggers: + - schedule: + cron: "12 3 * * 0,2,4" + filters: { branches: { only: [ master ] } } + jobs: + - windows_version_check + jobs: sanity_test: parameters: @@ -94,6 +146,35 @@ jobs: - run: ansible-galaxy collection install sensu-sensu_go-*.tar.gz - run_integration_tests + integration_test_galaxy: + parallelism: 6 + parameters: + ansible: + description: Ansible version to use + type: string + image_ubuntu: + description: Ubuntu image + type: string + machine: *ci-machine + working_directory: ~/sensu_go + steps: + - wrapper: + ansible: << parameters.ansible >> + kind: integration + test_commands: + - run: | + ansible-galaxy collection install \ + sensu.sensu_go:$(grep version: galaxy.yml | cut -d" " -f2) + - run_integration_tests + + windows_version_check: + docker: + - image: cimg/python:3.10.6 + steps: + - checkout + - run: pip3 install pyyaml + - run: make check_windows_versions + commands: run_integration_tests: description: Run integration tests From 097995854207ab043c479b4f8b1fd36d617eb169 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:38:48 +0200 Subject: [PATCH 21/86] adding other workflows back fix --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f4da01c..843fe61e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] + image_ubuntu: [ devel ] - unit_test: matrix: *devel-matrix From 58539e33e9de9d97c1f584c7e34437039e359254 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:40:59 +0200 Subject: [PATCH 22/86] testing cron_ansible_devel --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 843fe61e..699ee136 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,10 +58,6 @@ workflows: matrix: *matrix cron_ansible_devel: - triggers: - - schedule: - cron: "12 5 * * 2,5" - filters: { branches: { only: [ master ] } } jobs: - sanity_test: matrix: &devel-matrix From 1490889d3d53d6ce91b1231bd29d645cc5557492 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:49:33 +0200 Subject: [PATCH 23/86] cron_ansible_devel fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 699ee136..6c71bace 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] - image_ubuntu: [ devel ] + image_ubuntu: ubuntu-2004:202101-01 - unit_test: matrix: *devel-matrix From f5fd1a1b253b9f91bf4ab4327a7f53fad1eca6f1 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:50:07 +0200 Subject: [PATCH 24/86] cron_ansible_devel fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c71bace..fb77f514 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] - image_ubuntu: ubuntu-2004:202101-01 + image_ubuntu: "ubuntu-2004:202101-01" - unit_test: matrix: *devel-matrix From c3a564e06bd24c526ae33c682423cbcb58799825 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:51:32 +0200 Subject: [PATCH 25/86] cron_ansible_devel fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb77f514..5e569d65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] - image_ubuntu: "ubuntu-2004:202101-01" + image_ubuntu: [ "ubuntu-2004:202101-01" ] - unit_test: matrix: *devel-matrix From c36044121c8a3b5edd5060ff372d4079c45138fd Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 11:52:35 +0200 Subject: [PATCH 26/86] updating ubuntu image in cron_ansible_devel --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e569d65..8241c909 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] - image_ubuntu: [ "ubuntu-2004:202101-01" ] + image_ubuntu: [ "ubuntu-2204:2023.07.2" ] - unit_test: matrix: *devel-matrix From 0345f36a5844e2064c19b7b9c9cba8cd09c9f545 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:19:30 +0200 Subject: [PATCH 27/86] test changes --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ff62a6a..5cef0aa5 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,8 @@ sanity: ## Run sanity tests pip3 install -r sanity.requirements -r collection.requirements pip install pyyaml flake8 - if which ansible-lint 2> /dev/null; then ansible-lint -p roles/*; fi + which ansible-lint + ansible-lint -p roles/* ansible-test sanity --docker python3 ./tests/sanity/validate-role-metadata.py roles/* From 9874715caa2bc09cc64010cdac5e54189d7f1f17 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:24:16 +0200 Subject: [PATCH 28/86] testing python version --- .circleci/config.yml | 1 + Makefile | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8241c909..d2ef11dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,6 +99,7 @@ jobs: ansible: << parameters.ansible >> kind: sanity test_commands: + - run: python --version - run: make sanity unit_test: diff --git a/Makefile b/Makefile index 5cef0aa5..9ff62a6a 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,7 @@ sanity: ## Run sanity tests pip3 install -r sanity.requirements -r collection.requirements pip install pyyaml flake8 - which ansible-lint - ansible-lint -p roles/* + if which ansible-lint 2> /dev/null; then ansible-lint -p roles/*; fi ansible-test sanity --docker python3 ./tests/sanity/validate-role-metadata.py roles/* From c194ebc0f3ccacb9d02cf5a15251a557f180be1a Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:27:12 +0200 Subject: [PATCH 29/86] testing ansible-lint --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2ef11dd..f3dbb804 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,6 +100,8 @@ jobs: kind: sanity test_commands: - run: python --version + - run: pip3 install -r sanity.requirements -r collection.requirements + - run: ansible-lint - run: make sanity unit_test: From ffd84d1cf1f3b5e4cba12886ad22a7d9f6f32f36 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:29:11 +0200 Subject: [PATCH 30/86] testing roles ansible-lint --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3dbb804..208a8b71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,9 +99,8 @@ jobs: ansible: << parameters.ansible >> kind: sanity test_commands: - - run: python --version - run: pip3 install -r sanity.requirements -r collection.requirements - - run: ansible-lint + - run: ansible-lint -p roles/* - run: make sanity unit_test: From ea1f75aae03bdd0de4c752cea8c88c6caa59d5fb Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:36:46 +0200 Subject: [PATCH 31/86] cehck ansible version --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 208a8b71..0ccac645 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,6 +100,8 @@ jobs: kind: sanity test_commands: - run: pip3 install -r sanity.requirements -r collection.requirements + - run: python --version + - run: ansible --version - run: ansible-lint -p roles/* - run: make sanity From 48b72d4e4613bc4a31fdc2f9c6b7f1ab1391e43b Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:40:15 +0200 Subject: [PATCH 32/86] testing ansible-lint --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ccac645..c23789cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,6 +102,7 @@ jobs: - run: pip3 install -r sanity.requirements -r collection.requirements - run: python --version - run: ansible --version + - run: ansible-lint --version - run: ansible-lint -p roles/* - run: make sanity From f5375979bde185b81915a1906870cba219b152c4 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:47:15 +0200 Subject: [PATCH 33/86] ubuntu image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c23789cb..296627a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] - image_ubuntu: [ "ubuntu-2204:2023.07.2" ] + image_ubuntu: [ "ubuntu-2004:202101-01" ] - unit_test: matrix: *devel-matrix From 2731331a6d9a58db5f345016010542a9a20b790e Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:50:01 +0200 Subject: [PATCH 34/86] updating ubuntu image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 296627a5..c23789cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: matrix: &devel-matrix parameters: ansible: [ devel ] - image_ubuntu: [ "ubuntu-2004:202101-01" ] + image_ubuntu: [ "ubuntu-2204:2023.07.2" ] - unit_test: matrix: *devel-matrix From 86fb5fde2fc9b7bf6b39b758da6ddec84ee331b3 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 12:51:18 +0200 Subject: [PATCH 35/86] python3 version check --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c23789cb..ffdce11d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,7 +100,7 @@ jobs: kind: sanity test_commands: - run: pip3 install -r sanity.requirements -r collection.requirements - - run: python --version + - run: python3 --version - run: ansible --version - run: ansible-lint --version - run: ansible-lint -p roles/* From 9dddf96d457aab7da41d376b2d694d7fe1c8515a Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 13:13:17 +0200 Subject: [PATCH 36/86] unit test update --- tests/unit/plugins/modules/test_datastore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/plugins/modules/test_datastore.py b/tests/unit/plugins/modules/test_datastore.py index b57d74a5..6ff55b08 100644 --- a/tests/unit/plugins/modules/test_datastore.py +++ b/tests/unit/plugins/modules/test_datastore.py @@ -305,12 +305,12 @@ class TestDatastoreParams(ModuleTestCase): 'max_idle_conns': 0, 'batch_workers': 0, 'batch_buffer': 0, 'batch_size': 0, 'enable_round_robin': False, 'strict': False}}), # Absent - ("my_resource", "absent", "", None, None, None, None, None, None, + ("my_resource", "absent", "", None, None, 0, None, None, None, False, True, {'type': 'PostgresConfig', 'api_version': 'store/v1', 'metadata': {'name': 'my_resource'}, 'spec': { - 'dsn': '', 'enable_round_robin': False, 'strict': True}}), + 'dsn': '', 'max_idle_conns': 0, 'enable_round_robin': False, 'strict': True}}), ("my_resource", "absent", "postgresql://user:secret@host:port/dbname", 2, 1, 1, 1, 2, 3, False, True, From 643651410f329e6461c4598c913178f1ce667964 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 13:19:34 +0200 Subject: [PATCH 37/86] unit test fix --- tests/unit/plugins/modules/test_datastore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/plugins/modules/test_datastore.py b/tests/unit/plugins/modules/test_datastore.py index 6ff55b08..abc29647 100644 --- a/tests/unit/plugins/modules/test_datastore.py +++ b/tests/unit/plugins/modules/test_datastore.py @@ -305,12 +305,13 @@ class TestDatastoreParams(ModuleTestCase): 'max_idle_conns': 0, 'batch_workers': 0, 'batch_buffer': 0, 'batch_size': 0, 'enable_round_robin': False, 'strict': False}}), # Absent - ("my_resource", "absent", "", None, None, 0, None, None, None, + ("my_resource", "absent", "", 0, None, 0, 0, 0, 0, False, True, {'type': 'PostgresConfig', 'api_version': 'store/v1', 'metadata': {'name': 'my_resource'}, 'spec': { - 'dsn': '', 'max_idle_conns': 0, 'enable_round_robin': False, 'strict': True}}), + 'dsn': '', 'pool_size': 0,'max_idle_conns': 0, 'batch_workers': 0, 'batch_buffer': 0, + 'batch_size': 0, 'enable_round_robin': False, 'strict': True}}), ("my_resource", "absent", "postgresql://user:secret@host:port/dbname", 2, 1, 1, 1, 2, 3, False, True, From cabfd1601907fe0a07c87af997309f9d09a82b85 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 13:22:23 +0200 Subject: [PATCH 38/86] sanity fix --- tests/unit/plugins/modules/test_datastore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/plugins/modules/test_datastore.py b/tests/unit/plugins/modules/test_datastore.py index abc29647..aa810276 100644 --- a/tests/unit/plugins/modules/test_datastore.py +++ b/tests/unit/plugins/modules/test_datastore.py @@ -310,7 +310,7 @@ class TestDatastoreParams(ModuleTestCase): {'type': 'PostgresConfig', 'api_version': 'store/v1', 'metadata': {'name': 'my_resource'}, 'spec': { - 'dsn': '', 'pool_size': 0,'max_idle_conns': 0, 'batch_workers': 0, 'batch_buffer': 0, + 'dsn': '', 'pool_size': 0, 'max_idle_conns': 0, 'batch_workers': 0, 'batch_buffer': 0, 'batch_size': 0, 'enable_round_robin': False, 'strict': True}}), ("my_resource", "absent", "postgresql://user:secret@host:port/dbname", 2, 1, 1, 1, 2, 3, From a3a4b185092c56c844ecca50d2713b95a36d5eef Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 16 Aug 2023 15:44:34 +0200 Subject: [PATCH 39/86] unit test fix --- tests/unit/plugins/module_utils/test_utils.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/unit/plugins/module_utils/test_utils.py b/tests/unit/plugins/module_utils/test_utils.py index f737dce0..cc6f887f 100644 --- a/tests/unit/plugins/module_utils/test_utils.py +++ b/tests/unit/plugins/module_utils/test_utils.py @@ -471,21 +471,16 @@ def test_missing_secrets(self, secrets, diff): class TestDeprecate: def test_ansible_lt_2_9_10(self, mocker): module = mocker.MagicMock() - module.deprecate.side_effect = ( - TypeError("Simulating Ansible 2.9.9 and older"), - None, # Success, since no exception is raised - ) + module.deprecate.side_effect = [TypeError("Simulating Ansible 2.9.9 and older"), None] utils.deprecate(module, "Test msg", "3.2.1") assert module.deprecate.call_count == 2 - assert module.deprecate.called_once_with("Test msg", version="3.2.1") + module.deprecate.assert_called_with("Test msg", version="3.2.1") def test_ansible_ge_2_9_10(self, mocker): module = mocker.MagicMock() utils.deprecate(module, "Test msg", "3.2.1") - assert module.deprecate.called_once_with( - "Test msg", version="3.2.1", collection_name="sensu.sensu_go", - ) + module.deprecate.assert_called_once_with("Test msg", version="3.2.1", collection_name="sensu.sensu_go") From 23cc9647c0abefe1143479067a355e0b0e0cb254 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 10:38:52 +0200 Subject: [PATCH 40/86] adding make sanity --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ffdce11d..69a74004 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,8 +103,8 @@ jobs: - run: python3 --version - run: ansible --version - run: ansible-lint --version - - run: ansible-lint -p roles/* - run: make sanity + - run: ansible-lint -p roles/* unit_test: parameters: From ba38e93f79da2e76c71dd5cb143b97e31b25118f Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 10:47:54 +0200 Subject: [PATCH 41/86] removing make file from cron devel --- .circleci/config.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69a74004..6bae7e0c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,7 +59,7 @@ workflows: cron_ansible_devel: jobs: - - sanity_test: + - sanity_test_devel: matrix: &devel-matrix parameters: ansible: [ devel ] @@ -70,7 +70,7 @@ workflows: - integration_test_git: requires: - - sanity_test + - sanity_test_devel - unit_test matrix: *devel-matrix @@ -106,6 +106,28 @@ jobs: - run: make sanity - run: ansible-lint -p roles/* + sanity_test_devel: + parameters: + ansible: + description: Ansible version to use + type: string + image_ubuntu: + description: Ubuntu image + type: string + machine: &ci-machine + image: << parameters.image_ubuntu >> + working_directory: ~/ansible_collections/sensu/sensu_go + steps: + - wrapper: + ansible: << parameters.ansible >> + kind: sanity + test_commands: + - run: pip3 install -r sanity.requirements -r collection.requirements + - run: python3 --version + - run: ansible --version + # ansible-lint can't find roles for some reason; We run sanity check without roles for devel + - run: ansible-test sanity + unit_test: parameters: ansible: From 353231f08b5d4ba97d2712a91ec0c1c62398e225 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 10:52:18 +0200 Subject: [PATCH 42/86] sanity fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bae7e0c..6d93979c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,7 +114,7 @@ jobs: image_ubuntu: description: Ubuntu image type: string - machine: &ci-machine + machine: *ci-machine image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go steps: From 7a30ef538a0f76eed71570ef120709103f10dd39 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 10:56:17 +0200 Subject: [PATCH 43/86] sanity fix --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d93979c..6faafd78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,7 +115,6 @@ jobs: description: Ubuntu image type: string machine: *ci-machine - image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: From 40aa9c3bbe4255e2d5178ddf0d4d0aea9eaca437 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 12:08:09 +0200 Subject: [PATCH 44/86] removing deprecated unit tests --- plugins/modules/bonsai_asset.py | 16 ---------------- plugins/modules/datastore.py | 1 + tests/unit/plugins/module_utils/test_utils.py | 18 ------------------ 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/plugins/modules/bonsai_asset.py b/plugins/modules/bonsai_asset.py index 417218ec..bdbc0878 100644 --- a/plugins/modules/bonsai_asset.py +++ b/plugins/modules/bonsai_asset.py @@ -29,29 +29,13 @@ version_added: 1.0.0 extends_documentation_fragment: - sensu.sensu_go.requirements - - sensu.sensu_go.auth - sensu.sensu_go.name - - sensu.sensu_go.namespace - - sensu.sensu_go.labels - - sensu.sensu_go.annotations options: version: description: - Version number of the asset to install. type: str required: true - rename: - description: - - The name that will be used when adding the asset to Sensu. - - If not present, value of the I(name) parameter will be used. - type: str - on_remote: - description: - - If set to C(true), module will download asset defnition on remote host. - - If not set or set to C(false), ansible downloads asset definition - on control node. - type: bool - version_added: 1.13.0 notes: - I(labels) and I(annotations) values are merged with the values obtained from Bonsai. Values passed-in as parameters take precedence over the diff --git a/plugins/modules/datastore.py b/plugins/modules/datastore.py index 9df33902..75e4ebde 100644 --- a/plugins/modules/datastore.py +++ b/plugins/modules/datastore.py @@ -43,6 +43,7 @@ - The maximum number of connections to hold in the PostgreSQL connection pool. type: int + default: 0 max_conn_lifetime: description: - Maximum time a connection can persist before being destroyed. diff --git a/tests/unit/plugins/module_utils/test_utils.py b/tests/unit/plugins/module_utils/test_utils.py index cc6f887f..0e066636 100644 --- a/tests/unit/plugins/module_utils/test_utils.py +++ b/tests/unit/plugins/module_utils/test_utils.py @@ -466,21 +466,3 @@ def test_difference(self, current, desired): def test_missing_secrets(self, secrets, diff): assert utils.do_secrets_differ(dict(), dict(secrets=secrets)) is diff assert utils.do_secrets_differ(dict(secrets=secrets), dict()) is diff - - -class TestDeprecate: - def test_ansible_lt_2_9_10(self, mocker): - module = mocker.MagicMock() - module.deprecate.side_effect = [TypeError("Simulating Ansible 2.9.9 and older"), None] - - utils.deprecate(module, "Test msg", "3.2.1") - - assert module.deprecate.call_count == 2 - module.deprecate.assert_called_with("Test msg", version="3.2.1") - - def test_ansible_ge_2_9_10(self, mocker): - module = mocker.MagicMock() - - utils.deprecate(module, "Test msg", "3.2.1") - - module.deprecate.assert_called_once_with("Test msg", version="3.2.1", collection_name="sensu.sensu_go") From 361f0246a55c0d5b412caa8d28c86f07c8e00d80 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 12:13:10 +0200 Subject: [PATCH 45/86] removing lines from ignore files --- tests/sanity/ignore-2.10.txt | 2 -- tests/sanity/ignore-2.11.txt | 2 -- tests/sanity/ignore-2.12.txt | 2 -- tests/sanity/ignore-2.13.txt | 2 -- tests/sanity/ignore-2.14.txt | 2 -- tests/sanity/ignore-2.15.txt | 2 -- tests/sanity/ignore-2.9.txt | 1 - 7 files changed, 13 deletions(-) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index af9fcfb5..49388554 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,4 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index af9fcfb5..49388554 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,4 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index af9fcfb5..49388554 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,4 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index af9fcfb5..49388554 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1,4 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index af9fcfb5..49388554 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,4 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index af9fcfb5..49388554 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,4 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 5a7ce765..49388554 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,3 +1,2 @@ -plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints From 2226ab8364f5ac4232e495f78e68203390a87ea7 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 12:59:34 +0200 Subject: [PATCH 46/86] revert --- plugins/modules/bonsai_asset.py | 16 ++++++++++++++++ tests/sanity/ignore-2.16.txt | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 tests/sanity/ignore-2.16.txt diff --git a/plugins/modules/bonsai_asset.py b/plugins/modules/bonsai_asset.py index bdbc0878..417218ec 100644 --- a/plugins/modules/bonsai_asset.py +++ b/plugins/modules/bonsai_asset.py @@ -29,13 +29,29 @@ version_added: 1.0.0 extends_documentation_fragment: - sensu.sensu_go.requirements + - sensu.sensu_go.auth - sensu.sensu_go.name + - sensu.sensu_go.namespace + - sensu.sensu_go.labels + - sensu.sensu_go.annotations options: version: description: - Version number of the asset to install. type: str required: true + rename: + description: + - The name that will be used when adding the asset to Sensu. + - If not present, value of the I(name) parameter will be used. + type: str + on_remote: + description: + - If set to C(true), module will download asset defnition on remote host. + - If not set or set to C(false), ansible downloads asset definition + on control node. + type: bool + version_added: 1.13.0 notes: - I(labels) and I(annotations) values are merged with the values obtained from Bonsai. Values passed-in as parameters take precedence over the diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt new file mode 100644 index 00000000..af9fcfb5 --- /dev/null +++ b/tests/sanity/ignore-2.16.txt @@ -0,0 +1,4 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call +tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints +tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints From d1d2fa0d8f82b8235c936ec2168a06b6a1381b5e Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 14:26:04 +0200 Subject: [PATCH 47/86] adding ignore files --- tests/sanity/ignore-2.10.txt | 1 + tests/sanity/ignore-2.11.txt | 2 ++ tests/sanity/ignore-2.12.txt | 2 ++ tests/sanity/ignore-2.13.txt | 2 ++ tests/sanity/ignore-2.14.txt | 2 ++ tests/sanity/ignore-2.15.txt | 2 ++ 6 files changed, 11 insertions(+) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 49388554..5a7ce765 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,2 +1,3 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 49388554..af9fcfb5 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,2 +1,4 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 49388554..af9fcfb5 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,2 +1,4 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 49388554..af9fcfb5 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1,2 +1,4 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 49388554..af9fcfb5 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,2 +1,4 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 49388554..af9fcfb5 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,2 +1,4 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints From e4b539ce6ac2c11f8f925a14d1e81c138a4537aa Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 14:32:26 +0200 Subject: [PATCH 48/86] ignore files --- tests/sanity/ignore-2.11.txt | 1 - tests/sanity/ignore-2.12.txt | 1 - tests/sanity/ignore-2.13.txt | 1 - tests/sanity/ignore-2.14.txt | 1 - tests/sanity/ignore-2.9.txt | 1 + 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index af9fcfb5..5a7ce765 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,4 +1,3 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index af9fcfb5..5a7ce765 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,4 +1,3 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index af9fcfb5..5a7ce765 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1,4 +1,3 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index af9fcfb5..5a7ce765 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,4 +1,3 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 49388554..5a7ce765 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,2 +1,3 @@ +plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints From 23485b1e32751f9e9e86a819db6fe5d206531ab9 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 14:39:57 +0200 Subject: [PATCH 49/86] devel ignore file --- tests/sanity/ignore-2.16.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index af9fcfb5..5a7ce765 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1,4 +1,3 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints From 224b40847432e73a5926286ff51c70418724a7d3 Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 14:43:29 +0200 Subject: [PATCH 50/86] updating ignore file for devel --- tests/sanity/ignore-2.16.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 5a7ce765..cd9bf6cb 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1,3 +1 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module -tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints -tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints From 9c70a65dc1c9fac783c8e2826b8e032bcd52d94b Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 15:06:29 +0200 Subject: [PATCH 51/86] Adding to ignore file, returning unit tests --- tests/sanity/ignore-2.16.txt | 1 + tests/unit/plugins/module_utils/test_utils.py | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index cd9bf6cb..6a013d5c 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1 +1,2 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint!skip # Issue with depricate module in ansible devel version diff --git a/tests/unit/plugins/module_utils/test_utils.py b/tests/unit/plugins/module_utils/test_utils.py index 0e066636..f737dce0 100644 --- a/tests/unit/plugins/module_utils/test_utils.py +++ b/tests/unit/plugins/module_utils/test_utils.py @@ -466,3 +466,26 @@ def test_difference(self, current, desired): def test_missing_secrets(self, secrets, diff): assert utils.do_secrets_differ(dict(), dict(secrets=secrets)) is diff assert utils.do_secrets_differ(dict(secrets=secrets), dict()) is diff + + +class TestDeprecate: + def test_ansible_lt_2_9_10(self, mocker): + module = mocker.MagicMock() + module.deprecate.side_effect = ( + TypeError("Simulating Ansible 2.9.9 and older"), + None, # Success, since no exception is raised + ) + + utils.deprecate(module, "Test msg", "3.2.1") + + assert module.deprecate.call_count == 2 + assert module.deprecate.called_once_with("Test msg", version="3.2.1") + + def test_ansible_ge_2_9_10(self, mocker): + module = mocker.MagicMock() + + utils.deprecate(module, "Test msg", "3.2.1") + + assert module.deprecate.called_once_with( + "Test msg", version="3.2.1", collection_name="sensu.sensu_go", + ) From b7349dca151c0d2b2dc3b17b1bb8dd5e7036b3ae Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 15:10:57 +0200 Subject: [PATCH 52/86] Fixing assert statement --- tests/unit/plugins/module_utils/test_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/plugins/module_utils/test_utils.py b/tests/unit/plugins/module_utils/test_utils.py index f737dce0..a6e40e0c 100644 --- a/tests/unit/plugins/module_utils/test_utils.py +++ b/tests/unit/plugins/module_utils/test_utils.py @@ -479,13 +479,13 @@ def test_ansible_lt_2_9_10(self, mocker): utils.deprecate(module, "Test msg", "3.2.1") assert module.deprecate.call_count == 2 - assert module.deprecate.called_once_with("Test msg", version="3.2.1") + assert module.deprecate.assert_called_once_with("Test msg", version="3.2.1") def test_ansible_ge_2_9_10(self, mocker): module = mocker.MagicMock() utils.deprecate(module, "Test msg", "3.2.1") - assert module.deprecate.called_once_with( + assert module.deprecate.assert_called_once_with( "Test msg", version="3.2.1", collection_name="sensu.sensu_go", ) From 88759cf3869c13ab0eba3a25c426b42eb2c100aa Mon Sep 17 00:00:00 2001 From: Domen Date: Mon, 21 Aug 2023 15:19:21 +0200 Subject: [PATCH 53/86] assertion error fix --- tests/sanity/ignore-2.10.txt | 1 + tests/sanity/ignore-2.11.txt | 1 + tests/sanity/ignore-2.12.txt | 1 + tests/sanity/ignore-2.13.txt | 1 + tests/sanity/ignore-2.14.txt | 1 + tests/unit/plugins/module_utils/test_utils.py | 4 ++-- 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 5a7ce765..af9fcfb5 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,3 +1,4 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 5a7ce765..af9fcfb5 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,3 +1,4 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 5a7ce765..af9fcfb5 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,3 +1,4 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 5a7ce765..af9fcfb5 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1,3 +1,4 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 5a7ce765..af9fcfb5 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,3 +1,4 @@ plugins/modules/bonsai_asset.py validate-modules:nonexistent-parameter-documented # This is not a real module, more helper for the asset module +tests/unit/plugins/module_utils/test_utils.py pylint:ansible-deprecated-no-collection-name # sanity misdetects this as module deprecation call tools/windows-versions.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints tests/sanity/validate-role-metadata.py replace-urlopen # Maintainer tools should not be bound by the general collection constraints diff --git a/tests/unit/plugins/module_utils/test_utils.py b/tests/unit/plugins/module_utils/test_utils.py index a6e40e0c..c0ba702d 100644 --- a/tests/unit/plugins/module_utils/test_utils.py +++ b/tests/unit/plugins/module_utils/test_utils.py @@ -479,13 +479,13 @@ def test_ansible_lt_2_9_10(self, mocker): utils.deprecate(module, "Test msg", "3.2.1") assert module.deprecate.call_count == 2 - assert module.deprecate.assert_called_once_with("Test msg", version="3.2.1") + module.deprecate.assert_called_with("Test msg", version="3.2.1") def test_ansible_ge_2_9_10(self, mocker): module = mocker.MagicMock() utils.deprecate(module, "Test msg", "3.2.1") - assert module.deprecate.assert_called_once_with( + module.deprecate.assert_called_once_with( "Test msg", version="3.2.1", collection_name="sensu.sensu_go", ) From 61cba013f5acd10683f77f7ed9acca7b8ee62bcf Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 10:34:56 +0200 Subject: [PATCH 54/86] reverting back to old image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6faafd78..ed58ceca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ workflows: - ansible: "stable-2.13" image_ubuntu: "ubuntu-2204:2023.07.2" - ansible: "stable-2.14" - image_ubuntu: "ubuntu-2004:202101-01" + image_ubuntu: "ubuntu-2204:2023.07.2" - unit_test: matrix: *matrix From 8b3f1bf345a9e75b51754f72188e2d4cddae449b Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 11:35:23 +0200 Subject: [PATCH 55/86] changes --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed58ceca..819458fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,10 @@ workflows: matrix: *matrix cron_ansible_devel: + triggers: + - schedule: + cron: "12 5 * * 2,5" + filters: { branches: { only: [ master ] } } jobs: - sanity_test_devel: matrix: &devel-matrix @@ -99,12 +103,7 @@ jobs: ansible: << parameters.ansible >> kind: sanity test_commands: - - run: pip3 install -r sanity.requirements -r collection.requirements - - run: python3 --version - - run: ansible --version - - run: ansible-lint --version - run: make sanity - - run: ansible-lint -p roles/* sanity_test_devel: parameters: @@ -124,7 +123,8 @@ jobs: - run: pip3 install -r sanity.requirements -r collection.requirements - run: python3 --version - run: ansible --version - # ansible-lint can't find roles for some reason; We run sanity check without roles for devel + # ansible-lint can't find roles for some reason; + # pylint inside ansible-test finds them ... - run: ansible-test sanity unit_test: From 7ae523a41c00e232fc08f3a3b2b11b6fe982f1b2 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 11:41:32 +0200 Subject: [PATCH 56/86] adding ansible 215 to pipeline --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 819458fe..4d0b7c5a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ workflows: matrix: &matrix parameters: # ansible is branch name in ansible/ansible git repo - ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14"] + ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14", "stable-2.15"] image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"] exclude: - ansible: "stable-2.9" From b4ce6bb6a0301dfefdf2691069277f64837e7fa0 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 11:48:17 +0200 Subject: [PATCH 57/86] updating ansible-lint version for tests --- sanity.requirements | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanity.requirements b/sanity.requirements index a99e2d2c..750ea4b0 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,5 +1,5 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore -ansible-lint==5.4.0; python_version >= "3.6" +ansible-lint==6.18.0; python_version >= "3.6" flake8 yamllint pyyaml From 57b0707ea2ab42b809977ae706c2776181443161 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 12:16:17 +0200 Subject: [PATCH 58/86] updating role playbooks to satisfy updated ansible-lint --- roles/agent/handlers/main.yml | 4 ++-- roles/agent/tasks/configure.yml | 4 ++-- roles/agent/tasks/linux/configure.yml | 6 +++--- roles/agent/tasks/main.yml | 10 +++++----- roles/agent/tasks/start.yml | 4 ++-- roles/agent/tasks/windows/configure.yml | 6 +++--- roles/backend/handlers/main.yml | 2 +- roles/backend/tasks/configure.yml | 8 ++++---- roles/backend/tasks/main.yml | 10 +++++----- roles/backend/tasks/start.yml | 6 +++--- roles/install/tasks/apt/install.yml | 2 +- roles/install/tasks/apt/prepare.yml | 17 +++++++++-------- roles/install/tasks/dnf/install.yml | 2 +- roles/install/tasks/dnf/prepare.yml | 6 +++--- roles/install/tasks/main.yml | 4 ++-- roles/install/tasks/msi/install.yml | 12 ++++++------ roles/install/tasks/packages.yml | 4 ++-- roles/install/tasks/repositories.yml | 2 +- roles/install/tasks/yum/install.yml | 2 +- roles/install/tasks/yum/prepare.yml | 6 +++--- 20 files changed, 59 insertions(+), 58 deletions(-) diff --git a/roles/agent/handlers/main.yml b/roles/agent/handlers/main.yml index 1921322c..8a880074 100644 --- a/roles/agent/handlers/main.yml +++ b/roles/agent/handlers/main.yml @@ -1,13 +1,13 @@ --- - name: Restart Linux agent - service: + ansible.builtin.service: name: sensu-agent state: restarted when: manage_sensu_agent_service | default(False) - name: Restart Windows agent action: - module: win_service + module: ansible.windows.win_service name: SensuAgent state: restarted when: manage_sensu_agent_service | default(False) diff --git a/roles/agent/tasks/configure.yml b/roles/agent/tasks/configure.yml index 5c1e35ea..de86d012 100644 --- a/roles/agent/tasks/configure.yml +++ b/roles/agent/tasks/configure.yml @@ -1,8 +1,8 @@ --- - name: Configure agent (Linux) - include_tasks: linux/configure.yml + ansible.builtin.include_tasks: linux/configure.yml when: ansible_facts.os_family != "Windows" - name: Configure agent (Windows) - include_tasks: windows/configure.yml + ansible.builtin.include_tasks: windows/configure.yml when: ansible_facts.os_family == "Windows" diff --git a/roles/agent/tasks/linux/configure.yml b/roles/agent/tasks/linux/configure.yml index 4a3db7d9..d4ae4039 100644 --- a/roles/agent/tasks/linux/configure.yml +++ b/roles/agent/tasks/linux/configure.yml @@ -1,9 +1,9 @@ --- - name: Load Linux locations - include_vars: linux.yml + ansible.builtin.include_vars: linux.yml - name: Install agent communication PKI - copy: + ansible.builtin.copy: src: "{{ agent_trusted_ca_file }}" dest: "{{ trusted_ca_file_path }}" # Keep this in sync with what the backend service is running as from packager @@ -13,7 +13,7 @@ when: agent_trusted_ca_file is defined - name: Configure sensu-agent ({{ agent_config_path }}) - template: + ansible.builtin.template: src: agent.yml.j2 dest: "{{ agent_config_path }}" owner: *sensu_user diff --git a/roles/agent/tasks/main.yml b/roles/agent/tasks/main.yml index 44135ccd..cd3a2f13 100644 --- a/roles/agent/tasks/main.yml +++ b/roles/agent/tasks/main.yml @@ -1,16 +1,16 @@ --- - name: Install sensu-go-agent binary - include_role: + ansible.builtin.include_role: name: install vars: - components: [sensu-go-agent] + components: [sensu-go-agent] # noqa: var-naming[no-role-prefix] - name: Inform restart handler that we are in charge of the agent service - set_fact: + ansible.builtin.set_fact: manage_sensu_agent_service: true - name: Configure the agent - include_tasks: configure.yml + ansible.builtin.include_tasks: configure.yml - name: Start the agent - include_tasks: start.yml + ansible.builtin.include_tasks: start.yml diff --git a/roles/agent/tasks/start.yml b/roles/agent/tasks/start.yml index 7c5970a1..47636931 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -1,13 +1,13 @@ --- - name: Start sensu-agent (Linux) - service: + ansible.builtin.service: name: sensu-agent state: started enabled: true when: ansible_facts.os_family != "Windows" - name: Start sensu-agent (Windows) - action: + ansible.builtin.action: module: win_service name: SensuAgent path: C:\Program Files\sensu\sensu-agent\bin\sensu-agent.exe service run diff --git a/roles/agent/tasks/windows/configure.yml b/roles/agent/tasks/windows/configure.yml index e6b5f33c..033cf267 100644 --- a/roles/agent/tasks/windows/configure.yml +++ b/roles/agent/tasks/windows/configure.yml @@ -1,15 +1,15 @@ --- - name: Load Windows locations - include_vars: windows.yml + ansible.builtin.include_vars: windows.yml - name: Install agent communication PKI - win_copy: + ansible.windows.win_copy: src: "{{ agent_trusted_ca_file }}" dest: "{{ trusted_ca_file_path }}" when: agent_trusted_ca_file is defined - name: Configure sensu-agent ({{ agent_config_path }}) - win_template: + ansible.windows.win_template: src: agent.yml.j2 dest: "{{ agent_config_path }}" notify: Restart Windows agent diff --git a/roles/backend/handlers/main.yml b/roles/backend/handlers/main.yml index f327f3f1..d0ddc6a5 100644 --- a/roles/backend/handlers/main.yml +++ b/roles/backend/handlers/main.yml @@ -1,6 +1,6 @@ --- - name: Restart backend - service: + ansible.builtin.service: name: sensu-backend state: restarted when: manage_sensu_backend_service | default(False) diff --git a/roles/backend/tasks/configure.yml b/roles/backend/tasks/configure.yml index 56102681..c7b28ca7 100644 --- a/roles/backend/tasks/configure.yml +++ b/roles/backend/tasks/configure.yml @@ -1,6 +1,6 @@ --- - name: Install etcd communication PKI - copy: + ansible.builtin.copy: src: "{{ item.source }}" dest: "/etc/sensu/{{ item.filename }}" # Keep this in sync with what the backend service is running as from packager @@ -27,7 +27,7 @@ etcd_peer_key_file is defined - name: Install API communication PKI - copy: + ansible.builtin.copy: src: "{{ item.source }}" dest: "/etc/sensu/{{ item.filename }}" owner: *sensu_user @@ -45,7 +45,7 @@ api_trusted_ca_file is defined - name: Install dashboard communication PKI - copy: + ansible.builtin.copy: src: "{{ item.source }}" dest: "/etc/sensu/{{ item.filename }}" owner: *sensu_user @@ -61,7 +61,7 @@ when: dashboard_cert_file is defined or dashboard_key_file is defined - name: Configure sensu-backend (/etc/sensu/backend.yml) - template: + ansible.builtin.template: src: backend.yml.j2 dest: /etc/sensu/backend.yml owner: *sensu_user diff --git a/roles/backend/tasks/main.yml b/roles/backend/tasks/main.yml index 85de418d..b19fdad6 100644 --- a/roles/backend/tasks/main.yml +++ b/roles/backend/tasks/main.yml @@ -1,16 +1,16 @@ --- - name: Install sensu-go-backend binary - include_role: + ansible.builtin.include_role: name: install vars: - components: [sensu-go-backend] + components: [sensu-go-backend] # noqa: var-naming[no-role-prefix] - name: Inform restart handler that we are in charge of the backend service - set_fact: + ansible.builtin.set_fact: manage_sensu_backend_service: true - name: Configure the backend - include_tasks: configure.yml + ansible.builtin.include_tasks: configure.yml - name: Start the backend - include_tasks: start.yml + ansible.builtin.include_tasks: start.yml diff --git a/roles/backend/tasks/start.yml b/roles/backend/tasks/start.yml index 90a8a419..611a4064 100644 --- a/roles/backend/tasks/start.yml +++ b/roles/backend/tasks/start.yml @@ -1,12 +1,12 @@ --- - name: Start sensu-backend - service: + ansible.builtin.service: name: sensu-backend state: started enabled: true - name: Check for sensu-backend init command - command: + ansible.builtin.command: cmd: sensu-backend init -h register: init_command_test failed_when: false # Never fail, we just want to know if init exists. @@ -14,7 +14,7 @@ check_mode: false # We do not modify the system, so we can always run - name: Initialize backend - command: + ansible.builtin.command: cmd: sensu-backend init environment: SENSU_BACKEND_CLUSTER_ADMIN_USERNAME: "{{ cluster_admin_username }}" diff --git a/roles/install/tasks/apt/install.yml b/roles/install/tasks/apt/install.yml index da7f2027..e6d159d0 100644 --- a/roles/install/tasks/apt/install.yml +++ b/roles/install/tasks/apt/install.yml @@ -1,6 +1,6 @@ --- - name: Install component - apt: + ansible.builtin.apt: name: "{{ 'apt' | sensu.sensu_go.package_name(item, version, build) }}" state: "{{ (version == 'latest') | ternary('latest', 'present') }}" # FIXME(@tadeboro): This is a temporary "fix" for diff --git a/roles/install/tasks/apt/prepare.yml b/roles/install/tasks/apt/prepare.yml index fd124136..fdf29da1 100644 --- a/roles/install/tasks/apt/prepare.yml +++ b/roles/install/tasks/apt/prepare.yml @@ -1,21 +1,22 @@ --- - name: Include distro-specific vars ({{ ansible_distribution }}) - include_vars: + ansible.builtin.include_vars: file: '{{ ansible_distribution }}.yml' - name: Update sources.list file - shell: echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list + ansible.builtin.shell: echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '9' + changed_when: false - name: Update apt cache (ensure we have package index) - apt: + ansible.builtin.apt: update_cache: true # Updating the APT cache does not change the system so we never report a # change here (helps keep the role idempotent). changed_when: false - name: Install utility packages - apt: + ansible.builtin.apt: name: - gnupg - debian-archive-keyring @@ -23,7 +24,7 @@ state: present - name: Fetch the apt repository key - uri: + ansible.builtin.uri: url: https://{{ packagecloud_auth }}packagecloud.io/sensu/{{ channel }}/gpgkey force_basic_auth: true return_content: true @@ -37,17 +38,17 @@ check_mode: false - name: Add apt key - apt_key: + ansible.builtin.apt_key: data: "{{ apt_key_download.content }}" - name: Add apt repository - apt_repository: + ansible.builtin.apt_repository: repo: deb https://{{ packagecloud_auth }}packagecloud.io/sensu/{{ channel }}/{{ os }}/ {{ dist }} main filename: /etc/apt/sources.list.d/sensu_{{ channel }} validate_certs: true - name: Add apt source repository - apt_repository: + ansible.builtin.apt_repository: repo: deb-src https://{{ packagecloud_auth }}packagecloud.io/sensu/{{ channel }}/{{ os }}/ {{ dist }} main filename: /etc/apt/sources.list.d/sensu_{{ channel }} validate_certs: true diff --git a/roles/install/tasks/dnf/install.yml b/roles/install/tasks/dnf/install.yml index 5e1f02b7..97794309 100644 --- a/roles/install/tasks/dnf/install.yml +++ b/roles/install/tasks/dnf/install.yml @@ -2,7 +2,7 @@ # Why did we kill the package-latest check? Because we really do want to be # able to upgrade the packages to the latest stable version. - name: Install component - dnf: + ansible.builtin.dnf: name: "{{ 'yum' | sensu.sensu_go.package_name(item, version, build) }}" state: latest # noqa package-latest allow_downgrade: true diff --git a/roles/install/tasks/dnf/prepare.yml b/roles/install/tasks/dnf/prepare.yml index 47742ed4..e90ccee3 100644 --- a/roles/install/tasks/dnf/prepare.yml +++ b/roles/install/tasks/dnf/prepare.yml @@ -1,10 +1,10 @@ --- - name: Include distro-specific vars ({{ ansible_distribution }}) - include_vars: + ansible.builtin.include_vars: file: '{{ ansible_distribution }}.yml' - name: Add yum repository - yum_repository: + ansible.builtin. yum_repository: name: sensu_{{ channel }} description: sensu_{{ channel }} file: sensu @@ -18,7 +18,7 @@ metadata_expire: '300' - name: Add yum source repository - yum_repository: + ansible.builtin.yum_repository: name: sensu_{{ channel }}-source description: sensu_{{ channel }}-source file: sensu diff --git a/roles/install/tasks/main.yml b/roles/install/tasks/main.yml index 26d8e3b1..7af2903d 100644 --- a/roles/install/tasks/main.yml +++ b/roles/install/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: Prepare package repositories - include_tasks: repositories.yml + ansible.builtin.include_tasks: repositories.yml when: ansible_facts.os_family != "Windows" # No repo concept on Windows - name: Install selected packages - include_tasks: packages.yml + ansible.builtin.include_tasks: packages.yml diff --git a/roles/install/tasks/msi/install.yml b/roles/install/tasks/msi/install.yml index 5b357554..3da3da81 100644 --- a/roles/install/tasks/msi/install.yml +++ b/roles/install/tasks/msi/install.yml @@ -1,6 +1,6 @@ --- - name: Make sure we are installing agent - assert: + ansible.builtin.assert: that: - components | length == 1 - components.0 == "sensu-go-agent" @@ -8,28 +8,28 @@ quiet: true - name: Load supported agent versions on Windows - include_vars: + ansible.builtin.include_vars: file: Windows.yml - name: Check if version is supported - assert: + ansible.builtin.assert: that: - version in _msi_lookup fail_msg: Version {{ version }} is not supported quiet: true - name: Set version, build, and arch - set_fact: + ansible.builtin.set_fact: _version: "{{ _msi_lookup[version].version }}" _build: "{{ _msi_lookup[version].build }}" _arch: "{{ (ansible_facts.architecture == '64-bit') | ternary('x64', 'x86') }}" - name: Fetch product code - set_fact: + ansible.builtin.set_fact: _product_code: "{{ _msi_lookup[_version].product_codes[_arch] }}" - name: Install component - win_package: + ansible.windows.win_package: path: "https://s3-us-west-2.amazonaws.com/sensu.io/sensu-go/{{ _version }}\ /sensu-go-agent_{{ _version }}.{{ _build }}_en-US.{{ _arch }}.msi" product_id: "{{ _product_code }}" diff --git a/roles/install/tasks/packages.yml b/roles/install/tasks/packages.yml index 73eb5153..df6a3e53 100644 --- a/roles/install/tasks/packages.yml +++ b/roles/install/tasks/packages.yml @@ -1,8 +1,8 @@ --- - name: Install selected components (Linux) - include_tasks: "{{ ansible_pkg_mgr }}/install.yml" + ansible.builtin.include_tasks: "{{ ansible_pkg_mgr }}/install.yml" when: ansible_facts.os_family != "Windows" - name: Install selected components (Windows) - include_tasks: "msi/install.yml" + ansible.builtin.include_tasks: "msi/install.yml" when: ansible_facts.os_family == "Windows" diff --git a/roles/install/tasks/repositories.yml b/roles/install/tasks/repositories.yml index 5c32d80c..265a6d43 100644 --- a/roles/install/tasks/repositories.yml +++ b/roles/install/tasks/repositories.yml @@ -1,3 +1,3 @@ --- - name: Prepare package repositories - include_tasks: "{{ ansible_pkg_mgr }}/prepare.yml" + ansible.builtin.include_tasks: "{{ ansible_pkg_mgr }}/prepare.yml" diff --git a/roles/install/tasks/yum/install.yml b/roles/install/tasks/yum/install.yml index e919c9f5..935c3b50 100644 --- a/roles/install/tasks/yum/install.yml +++ b/roles/install/tasks/yum/install.yml @@ -2,7 +2,7 @@ # Why did we kill the package-latest check? Because we really do want to be # able to upgrade the packages to the latest stable version. - name: Install component - yum: + ansible.builtin.yum: name: "{{ 'yum' | sensu.sensu_go.package_name(item, version, build) }}" state: "{{ (version == 'latest') | ternary('latest', 'present') }}" allow_downgrade: true diff --git a/roles/install/tasks/yum/prepare.yml b/roles/install/tasks/yum/prepare.yml index 47742ed4..a7b0c287 100644 --- a/roles/install/tasks/yum/prepare.yml +++ b/roles/install/tasks/yum/prepare.yml @@ -1,10 +1,10 @@ --- - name: Include distro-specific vars ({{ ansible_distribution }}) - include_vars: + ansible.builtin.include_vars: file: '{{ ansible_distribution }}.yml' - name: Add yum repository - yum_repository: + ansible.builtin.yum_repository: name: sensu_{{ channel }} description: sensu_{{ channel }} file: sensu @@ -18,7 +18,7 @@ metadata_expire: '300' - name: Add yum source repository - yum_repository: + ansible.builtin.yum_repository: name: sensu_{{ channel }}-source description: sensu_{{ channel }}-source file: sensu From c1de8e9f3011580b1e06f4b8653a1edc39c52877 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 12:35:21 +0200 Subject: [PATCH 59/86] requirement file update --- sanity.requirements | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanity.requirements b/sanity.requirements index 750ea4b0..a63fd968 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,5 +1,6 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore -ansible-lint==6.18.0; python_version >= "3.6" +ansible-lint==6.18.0; ansible_version > "2.10" +ansible-lint==5.4.0; ansible_version <= "2.10" flake8 yamllint pyyaml From 4561165cd52e0423e113f65473bb772fd78e2bb6 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 12:39:27 +0200 Subject: [PATCH 60/86] requirements update --- sanity.requirements | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sanity.requirements b/sanity.requirements index a63fd968..56a79a64 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,7 +1,5 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore -ansible-lint==6.18.0; ansible_version > "2.10" -ansible-lint==5.4.0; ansible_version <= "2.10" -flake8 +ansible-lint==5.4.0; python_version >= "3.6" yamllint pyyaml requests \ No newline at end of file From 87f3e4cc6805f0848dbfe88e0ed086231b3521a9 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 12:41:18 +0200 Subject: [PATCH 61/86] adding flake8 to requirement file --- sanity.requirements | 1 + 1 file changed, 1 insertion(+) diff --git a/sanity.requirements b/sanity.requirements index 56a79a64..a99e2d2c 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,5 +1,6 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore ansible-lint==5.4.0; python_version >= "3.6" +flake8 yamllint pyyaml requests \ No newline at end of file From c3ae253ec88c996ea1f7440cde9dbaa842aa18ef Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 13:00:40 +0200 Subject: [PATCH 62/86] requirement file --- sanity.requirements | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanity.requirements b/sanity.requirements index a99e2d2c..c1326284 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,5 +1,6 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore -ansible-lint==5.4.0; python_version >= "3.6" +ansible-lint==6.18.0; python_version >= "3.10" +ansible-lint==5.4.0; python_version < "3.10" flake8 yamllint pyyaml From 445fb181ed6b300a044a22c422f5d4436a9d573c Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 13:04:43 +0200 Subject: [PATCH 63/86] adding exceptions for ansible 215 --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d0b7c5a..a9511c75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,8 @@ workflows: image_ubuntu: "ubuntu-2204:2023.07.2" - ansible: "stable-2.14" image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.15" + image_ubuntu: "ubuntu-2004:202101-01" - unit_test: matrix: *matrix From c898980a3c2d424541c7c7347ec463e4cdd6a519 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 13:56:46 +0200 Subject: [PATCH 64/86] fixing sanity issues --- .ansible-lint-ignore | 2 ++ roles/agent/tasks/start.yml | 4 ++-- roles/install/tasks/dnf/prepare.yml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .ansible-lint-ignore diff --git a/.ansible-lint-ignore b/.ansible-lint-ignore new file mode 100644 index 00000000..c84a7fdf --- /dev/null +++ b/.ansible-lint-ignore @@ -0,0 +1,2 @@ +# This file contains ignores rule violations for ansible-lint +roles/agent/tasks/start.yml schema[tasks] diff --git a/roles/agent/tasks/start.yml b/roles/agent/tasks/start.yml index 47636931..d9d90e75 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -7,8 +7,8 @@ when: ansible_facts.os_family != "Windows" - name: Start sensu-agent (Windows) - ansible.builtin.action: - module: win_service + action: + module: ansible.windows.win_service name: SensuAgent path: C:\Program Files\sensu\sensu-agent\bin\sensu-agent.exe service run state: started diff --git a/roles/install/tasks/dnf/prepare.yml b/roles/install/tasks/dnf/prepare.yml index e90ccee3..a7b0c287 100644 --- a/roles/install/tasks/dnf/prepare.yml +++ b/roles/install/tasks/dnf/prepare.yml @@ -4,7 +4,7 @@ file: '{{ ansible_distribution }}.yml' - name: Add yum repository - ansible.builtin. yum_repository: + ansible.builtin.yum_repository: name: sensu_{{ channel }} description: sensu_{{ channel }} file: sensu From 6d383119b025acb6d97dc3db6a162fb12781aae8 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 15:09:34 +0200 Subject: [PATCH 65/86] changing service to systemd_service --- roles/agent/tasks/start.yml | 2 +- roles/backend/tasks/start.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/agent/tasks/start.yml b/roles/agent/tasks/start.yml index d9d90e75..79e03723 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-agent (Linux) - ansible.builtin.service: + ansible.builtin.systemd_service: name: sensu-agent state: started enabled: true diff --git a/roles/backend/tasks/start.yml b/roles/backend/tasks/start.yml index 611a4064..88a26b8a 100644 --- a/roles/backend/tasks/start.yml +++ b/roles/backend/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-backend - ansible.builtin.service: + ansible.builtin.systemd_service: name: sensu-backend state: started enabled: true From 53d004d33d540d77f9b1fa0cfe40f67e932bbb94 Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 15:50:15 +0200 Subject: [PATCH 66/86] reverting back to service --- roles/agent/tasks/start.yml | 2 +- roles/backend/tasks/start.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/agent/tasks/start.yml b/roles/agent/tasks/start.yml index 79e03723..d9d90e75 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-agent (Linux) - ansible.builtin.systemd_service: + ansible.builtin.service: name: sensu-agent state: started enabled: true diff --git a/roles/backend/tasks/start.yml b/roles/backend/tasks/start.yml index 88a26b8a..611a4064 100644 --- a/roles/backend/tasks/start.yml +++ b/roles/backend/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-backend - ansible.builtin.systemd_service: + ansible.builtin.service: name: sensu-backend state: started enabled: true From c5bcbaa114be9b4ec2e3a0010f2d410723e76d4c Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 23 Aug 2023 15:56:17 +0200 Subject: [PATCH 67/86] change to systemd --- roles/agent/tasks/start.yml | 2 +- roles/backend/tasks/start.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/agent/tasks/start.yml b/roles/agent/tasks/start.yml index d9d90e75..4f684af1 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-agent (Linux) - ansible.builtin.service: + ansible.builtin.systemd: name: sensu-agent state: started enabled: true diff --git a/roles/backend/tasks/start.yml b/roles/backend/tasks/start.yml index 611a4064..df3b5ffb 100644 --- a/roles/backend/tasks/start.yml +++ b/roles/backend/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-backend - ansible.builtin.service: + ansible.builtin.systemd: name: sensu-backend state: started enabled: true From 13f35cd5f3c10098ab96054fd570dffe9dc8afdc Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:37:00 +0200 Subject: [PATCH 68/86] Update config.yml --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a9511c75..b1c07c58 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -163,6 +163,12 @@ jobs: machine: *ci-machine working_directory: ~/sensu_go steps: + - setup_dbus: + name: Setup D-Bus + command: | + apt-get update + apt-get install -y dbus + service dbus start # Start D-Bus service - wrapper: ansible: << parameters.ansible >> kind: integration From 89bc6e013c6dc4fd28f2b2b06e935323015cfaa3 Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:40:09 +0200 Subject: [PATCH 69/86] Update config.yml --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1c07c58..e2e2770a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -163,8 +163,7 @@ jobs: machine: *ci-machine working_directory: ~/sensu_go steps: - - setup_dbus: - name: Setup D-Bus + - run: command: | apt-get update apt-get install -y dbus From 462df5c71cda248dc22b643355089ca4244459d0 Mon Sep 17 00:00:00 2001 From: Domen Date: Thu, 31 Aug 2023 10:14:50 +0200 Subject: [PATCH 70/86] removing start service --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2e2770a..8c3ec319 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -167,7 +167,7 @@ jobs: command: | apt-get update apt-get install -y dbus - service dbus start # Start D-Bus service + # service dbus start # Start D-Bus service - wrapper: ansible: << parameters.ansible >> kind: integration From 576a9abc0c62297d9dc39f6620e8a7939a9c61f0 Mon Sep 17 00:00:00 2001 From: Domen Date: Thu, 31 Aug 2023 10:30:48 +0200 Subject: [PATCH 71/86] adding sudo --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c3ec319..58fa8a66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,8 +165,8 @@ jobs: steps: - run: command: | - apt-get update - apt-get install -y dbus + sudo apt-get update + sudo apt-get install -y dbus # service dbus start # Start D-Bus service - wrapper: ansible: << parameters.ansible >> From 600439db6adba17f336e46f5349136cabaabc61d Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:31:33 +0200 Subject: [PATCH 72/86] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58fa8a66..43a9376e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ workflows: - ansible: "stable-2.14" image_ubuntu: "ubuntu-2204:2023.07.2" - ansible: "stable-2.15" - image_ubuntu: "ubuntu-2004:202101-01" + image_ubuntu: "ubuntu-2204:2023.07.2" - unit_test: matrix: *matrix From c7460190d6d53915f2e9163756b81ddebf49506c Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:49:30 +0200 Subject: [PATCH 73/86] Update sanity.requirements --- sanity.requirements | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanity.requirements b/sanity.requirements index c1326284..5d9ec59f 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,7 +1,7 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore ansible-lint==6.18.0; python_version >= "3.10" -ansible-lint==5.4.0; python_version < "3.10" +ansible-lint==6.0.0; python_version < "3.10" flake8 yamllint pyyaml -requests \ No newline at end of file +requests From d4ef134e373b4ae9e0e4f08f68d4aea673f37fcb Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:51:26 +0200 Subject: [PATCH 74/86] Update sanity.requirements --- sanity.requirements | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanity.requirements b/sanity.requirements index 5d9ec59f..f13f3c90 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,6 +1,6 @@ # ansible-lint >= 4.3.0 does not support python < 3.6 anymore ansible-lint==6.18.0; python_version >= "3.10" -ansible-lint==6.0.0; python_version < "3.10" +ansible-lint==5.4.0; python_version < "3.10" flake8 yamllint pyyaml From ebd077d9d82f7bd524a11e9e6a4af82490e2f4e9 Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:52:34 +0200 Subject: [PATCH 75/86] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43a9376e..58fa8a66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ workflows: - ansible: "stable-2.14" image_ubuntu: "ubuntu-2204:2023.07.2" - ansible: "stable-2.15" - image_ubuntu: "ubuntu-2204:2023.07.2" + image_ubuntu: "ubuntu-2004:202101-01" - unit_test: matrix: *matrix From 98a63d0822338ea0b9d5bd3f18d31fe4160cd58e Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 10:07:41 +0200 Subject: [PATCH 76/86] adding c_groupns_mode to molecule --- tests/integration/molecule/misc_api_cert/molecule.yml | 1 + tests/integration/molecule/role_agent_default/molecule.yml | 1 + tests/integration/molecule/role_agent_secured/molecule.yml | 1 + tests/integration/molecule/role_backend_default/molecule.yml | 1 + tests/integration/molecule/role_backend_secured/molecule.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index 1785c689..25a5e5bd 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -15,6 +15,7 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + cgroupns_mode: host etc_hosts: # sensu-api is the hostname used in the test certificate sensu-api: 127.0.0.1 diff --git a/tests/integration/molecule/role_agent_default/molecule.yml b/tests/integration/molecule/role_agent_default/molecule.yml index a067e841..58a682f3 100644 --- a/tests/integration/molecule/role_agent_default/molecule.yml +++ b/tests/integration/molecule/role_agent_default/molecule.yml @@ -18,6 +18,7 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + cgroupns_mode: host # Upstream container - just to populate the inventory provisioner: diff --git a/tests/integration/molecule/role_agent_secured/molecule.yml b/tests/integration/molecule/role_agent_secured/molecule.yml index 774cf311..d1cfa3c7 100644 --- a/tests/integration/molecule/role_agent_secured/molecule.yml +++ b/tests/integration/molecule/role_agent_secured/molecule.yml @@ -9,6 +9,7 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + cgroupns_mode: host # Upstream container - just to populate the inventory provisioner: diff --git a/tests/integration/molecule/role_backend_default/molecule.yml b/tests/integration/molecule/role_backend_default/molecule.yml index f9c28ce1..dac38066 100644 --- a/tests/integration/molecule/role_backend_default/molecule.yml +++ b/tests/integration/molecule/role_backend_default/molecule.yml @@ -18,3 +18,4 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + cgroupns_mode: host diff --git a/tests/integration/molecule/role_backend_secured/molecule.yml b/tests/integration/molecule/role_backend_secured/molecule.yml index 9d526ef3..1fdd435a 100644 --- a/tests/integration/molecule/role_backend_secured/molecule.yml +++ b/tests/integration/molecule/role_backend_secured/molecule.yml @@ -16,3 +16,4 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro + cgroupns_mode: host From deb93377a76fc8db911064e972d76c69bea48985 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 10:34:17 +0200 Subject: [PATCH 77/86] raising molecule version for newer python versions --- integration.requirements | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration.requirements b/integration.requirements index bbe5a9da..74c8dd22 100644 --- a/integration.requirements +++ b/integration.requirements @@ -1,4 +1,5 @@ -molecule ~= 5.0.1 +molecule ~= 6.0.1; python_version >= "3.10" +molecule ~= 5.0.1; python_version < "3.10" molecule-docker ~= 2.1.0 pytest pytest-molecule ~= 2.0.0 \ No newline at end of file From 8313d911560e523e365c8af3d83515ccc87233b2 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 10:59:37 +0200 Subject: [PATCH 78/86] changing to /sys/fs/cgroup:rw --- tests/integration/molecule/misc_api_cert/molecule.yml | 2 +- tests/integration/molecule/role_agent_default/molecule.yml | 2 +- tests/integration/molecule/role_agent_secured/molecule.yml | 2 +- tests/integration/molecule/role_backend_default/molecule.yml | 2 +- tests/integration/molecule/role_backend_secured/molecule.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index 25a5e5bd..95c61144 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -14,7 +14,7 @@ platforms: override_command: false privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw cgroupns_mode: host etc_hosts: # sensu-api is the hostname used in the test certificate diff --git a/tests/integration/molecule/role_agent_default/molecule.yml b/tests/integration/molecule/role_agent_default/molecule.yml index 58a682f3..60c80816 100644 --- a/tests/integration/molecule/role_agent_default/molecule.yml +++ b/tests/integration/molecule/role_agent_default/molecule.yml @@ -17,7 +17,7 @@ platforms: override_command: false privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw cgroupns_mode: host # Upstream container - just to populate the inventory diff --git a/tests/integration/molecule/role_agent_secured/molecule.yml b/tests/integration/molecule/role_agent_secured/molecule.yml index d1cfa3c7..33ceb5e3 100644 --- a/tests/integration/molecule/role_agent_secured/molecule.yml +++ b/tests/integration/molecule/role_agent_secured/molecule.yml @@ -8,7 +8,7 @@ platforms: override_command: false privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw cgroupns_mode: host # Upstream container - just to populate the inventory diff --git a/tests/integration/molecule/role_backend_default/molecule.yml b/tests/integration/molecule/role_backend_default/molecule.yml index dac38066..632b4c69 100644 --- a/tests/integration/molecule/role_backend_default/molecule.yml +++ b/tests/integration/molecule/role_backend_default/molecule.yml @@ -17,5 +17,5 @@ platforms: override_command: false privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw cgroupns_mode: host diff --git a/tests/integration/molecule/role_backend_secured/molecule.yml b/tests/integration/molecule/role_backend_secured/molecule.yml index 1fdd435a..c806861f 100644 --- a/tests/integration/molecule/role_backend_secured/molecule.yml +++ b/tests/integration/molecule/role_backend_secured/molecule.yml @@ -15,5 +15,5 @@ platforms: override_command: false privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw cgroupns_mode: host From 2351acdcfe0dd486de88ccf62fe5eee1bce48797 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 11:24:31 +0200 Subject: [PATCH 79/86] switching to centos:8 --- tests/integration/molecule/misc_api_cert/molecule.yml | 2 +- tests/integration/molecule/role_agent_default/molecule.yml | 2 +- tests/integration/molecule/role_agent_secured/molecule.yml | 2 +- tests/integration/molecule/role_backend_default/molecule.yml | 2 +- tests/integration/molecule/role_backend_secured/molecule.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index 95c61144..b0a53954 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -8,7 +8,7 @@ scenario: platforms: - name: backend - image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 pre_build_image: true pull: true override_command: false diff --git a/tests/integration/molecule/role_agent_default/molecule.yml b/tests/integration/molecule/role_agent_default/molecule.yml index 60c80816..bcc642fb 100644 --- a/tests/integration/molecule/role_agent_default/molecule.yml +++ b/tests/integration/molecule/role_agent_default/molecule.yml @@ -10,7 +10,7 @@ scenario: platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 pre_build_image: true pull: true groups: [agents] diff --git a/tests/integration/molecule/role_agent_secured/molecule.yml b/tests/integration/molecule/role_agent_secured/molecule.yml index 33ceb5e3..77c35c86 100644 --- a/tests/integration/molecule/role_agent_secured/molecule.yml +++ b/tests/integration/molecule/role_agent_secured/molecule.yml @@ -1,7 +1,7 @@ --- platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 pre_build_image: true pull: true groups: [agents] diff --git a/tests/integration/molecule/role_backend_default/molecule.yml b/tests/integration/molecule/role_backend_default/molecule.yml index 632b4c69..61dccd5f 100644 --- a/tests/integration/molecule/role_backend_default/molecule.yml +++ b/tests/integration/molecule/role_backend_default/molecule.yml @@ -11,7 +11,7 @@ scenario: platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 pre_build_image: true pull: true override_command: false diff --git a/tests/integration/molecule/role_backend_secured/molecule.yml b/tests/integration/molecule/role_backend_secured/molecule.yml index c806861f..9d29dc4c 100644 --- a/tests/integration/molecule/role_backend_secured/molecule.yml +++ b/tests/integration/molecule/role_backend_secured/molecule.yml @@ -9,7 +9,7 @@ scenario: platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 pre_build_image: true pull: true override_command: false From 2922d4aa843bec46ae8eb5729122cd29d1a78db0 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 11:53:04 +0200 Subject: [PATCH 80/86] systemd to service --- roles/agent/tasks/start.yml | 2 +- roles/backend/tasks/start.yml | 2 +- tests/integration/molecule/misc_api_cert/molecule.yml | 2 +- tests/integration/molecule/role_agent_default/molecule.yml | 2 +- tests/integration/molecule/role_agent_secured/molecule.yml | 2 +- tests/integration/molecule/role_backend_secured/molecule.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/agent/tasks/start.yml b/roles/agent/tasks/start.yml index 4f684af1..d9d90e75 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-agent (Linux) - ansible.builtin.systemd: + ansible.builtin.service: name: sensu-agent state: started enabled: true diff --git a/roles/backend/tasks/start.yml b/roles/backend/tasks/start.yml index df3b5ffb..611a4064 100644 --- a/roles/backend/tasks/start.yml +++ b/roles/backend/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-backend - ansible.builtin.systemd: + ansible.builtin.service: name: sensu-backend state: started enabled: true diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index b0a53954..95c61144 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -8,7 +8,7 @@ scenario: platforms: - name: backend - image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 pre_build_image: true pull: true override_command: false diff --git a/tests/integration/molecule/role_agent_default/molecule.yml b/tests/integration/molecule/role_agent_default/molecule.yml index bcc642fb..60c80816 100644 --- a/tests/integration/molecule/role_agent_default/molecule.yml +++ b/tests/integration/molecule/role_agent_default/molecule.yml @@ -10,7 +10,7 @@ scenario: platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 pre_build_image: true pull: true groups: [agents] diff --git a/tests/integration/molecule/role_agent_secured/molecule.yml b/tests/integration/molecule/role_agent_secured/molecule.yml index 77c35c86..33ceb5e3 100644 --- a/tests/integration/molecule/role_agent_secured/molecule.yml +++ b/tests/integration/molecule/role_agent_secured/molecule.yml @@ -1,7 +1,7 @@ --- platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 pre_build_image: true pull: true groups: [agents] diff --git a/tests/integration/molecule/role_backend_secured/molecule.yml b/tests/integration/molecule/role_backend_secured/molecule.yml index 9d29dc4c..c806861f 100644 --- a/tests/integration/molecule/role_backend_secured/molecule.yml +++ b/tests/integration/molecule/role_backend_secured/molecule.yml @@ -9,7 +9,7 @@ scenario: platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 pre_build_image: true pull: true override_command: false From 54cd772e9fb45516f3e537d920fc5abbe63fee15 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 12:17:10 +0200 Subject: [PATCH 81/86] to centos:7 --- tests/integration/molecule/role_backend_default/molecule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/molecule/role_backend_default/molecule.yml b/tests/integration/molecule/role_backend_default/molecule.yml index 61dccd5f..632b4c69 100644 --- a/tests/integration/molecule/role_backend_default/molecule.yml +++ b/tests/integration/molecule/role_backend_default/molecule.yml @@ -11,7 +11,7 @@ scenario: platforms: - name: centos - image: quay.io/xlab-steampunk/sensu-go-tests-centos:8 + image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 pre_build_image: true pull: true override_command: false From 8a0ba6a8d2e503f2617bd8d38659916eed8de1a2 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 12:37:55 +0200 Subject: [PATCH 82/86] misc_api_cert test --- docker/centos-7.docker | 1 + tests/integration/molecule/misc_api_cert/molecule.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/centos-7.docker b/docker/centos-7.docker index c11f9b55..1b6d697f 100644 --- a/docker/centos-7.docker +++ b/docker/centos-7.docker @@ -18,6 +18,7 @@ RUN ( \ /usr/bin/python /usr/bin/python2-config sudo \ yum-plugin-ovl bash iproute; \ sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf; \ + yum -y update systemd; \ yum clean all; \ chmod 777 /root; diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index 95c61144..98fd5351 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -9,8 +9,8 @@ scenario: platforms: - name: backend image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 - pre_build_image: true - pull: true + pre_build_image: false + pull: false override_command: false privileged: true volumes: From 534e7024709c63da57a6274a1bec6395e0d5fd94 Mon Sep 17 00:00:00 2001 From: Domen Dobnikar <113340617+domendobnikar@users.noreply.github.com> Date: Fri, 1 Sep 2023 13:41:32 +0200 Subject: [PATCH 83/86] Update config.yml --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58fa8a66..daf5f56b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,13 +33,55 @@ workflows: requires: - sanity_test - unit_test - matrix: *matrix + matrix: + parameters: + # ansible is branch name in ansible/ansible git repo + ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14", "stable-2.15"] + image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"] + exclude: + - ansible: "stable-2.9" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.10" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.11" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.12" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.13" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.14" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.15" + image_ubuntu: "ubuntu-2004:202101-01" + - ansible: "stable-2.15" + image_ubuntu: "ubuntu-2204:2023.07.2" - integration_test_galaxy: filters: { branches: { only: [ stable ] } } requires: - integration_test_git - matrix: *matrix + matrix: + parameters: + # ansible is branch name in ansible/ansible git repo + ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14", "stable-2.15"] + image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"] + exclude: + - ansible: "stable-2.9" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.10" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.11" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.12" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.13" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.14" + image_ubuntu: "ubuntu-2204:2023.07.2" + - ansible: "stable-2.15" + image_ubuntu: "ubuntu-2004:202101-01" + - ansible: "stable-2.15" + image_ubuntu: "ubuntu-2204:2023.07.2" cron_master: triggers: From 61b8448ff655e891d46007310c028a828f967f04 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 16:16:02 +0200 Subject: [PATCH 84/86] testing modified centos 7 image --- tests/integration/molecule/misc_api_cert/molecule.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index 98fd5351..95c61144 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -9,8 +9,8 @@ scenario: platforms: - name: backend image: quay.io/xlab-steampunk/sensu-go-tests-centos:7 - pre_build_image: false - pull: false + pre_build_image: true + pull: true override_command: false privileged: true volumes: From d66965a1e01ec0c3797f94ff5fddf314881a4d59 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 16:27:49 +0200 Subject: [PATCH 85/86] workflow file update --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index daf5f56b..06e6934e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,8 +80,6 @@ workflows: image_ubuntu: "ubuntu-2204:2023.07.2" - ansible: "stable-2.15" image_ubuntu: "ubuntu-2004:202101-01" - - ansible: "stable-2.15" - image_ubuntu: "ubuntu-2204:2023.07.2" cron_master: triggers: From 28e02d06081aded650b14acf807f445e67f70cb1 Mon Sep 17 00:00:00 2001 From: Domen Date: Fri, 1 Sep 2023 16:57:03 +0200 Subject: [PATCH 86/86] workflow file update --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06e6934e..40c05c2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,8 +53,6 @@ workflows: image_ubuntu: "ubuntu-2204:2023.07.2" - ansible: "stable-2.15" image_ubuntu: "ubuntu-2004:202101-01" - - ansible: "stable-2.15" - image_ubuntu: "ubuntu-2204:2023.07.2" - integration_test_galaxy: filters: { branches: { only: [ stable ] } }