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/.circleci/config.yml b/.circleci/config.yml index 96612ff4..40c05c2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,14 +8,23 @@ 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" + 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" - unit_test: matrix: *matrix @@ -24,13 +33,51 @@ 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" - 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" cron_master: triggers: @@ -56,17 +103,18 @@ workflows: cron: "12 5 * * 2,5" filters: { branches: { only: [ master ] } } jobs: - - sanity_test: + - sanity_test_devel: matrix: &devel-matrix parameters: ansible: [ devel ] + image_ubuntu: [ "ubuntu-2204:2023.07.2" ] - unit_test: matrix: *devel-matrix - integration_test_git: requires: - - sanity_test + - sanity_test_devel - unit_test matrix: *devel-matrix @@ -84,8 +132,11 @@ jobs: ansible: description: Ansible version to use type: string + image_ubuntu: + description: Ubuntu image + type: string machine: &ci-machine - image: ubuntu-2004:202101-01 + image: << parameters.image_ubuntu >> working_directory: ~/ansible_collections/sensu/sensu_go steps: - wrapper: @@ -94,11 +145,36 @@ jobs: test_commands: - run: make sanity + sanity_test_devel: + 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: pip3 install -r sanity.requirements -r collection.requirements + - run: python3 --version + - run: ansible --version + # ansible-lint can't find roles for some reason; + # pylint inside ansible-test finds them ... + - run: ansible-test 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: @@ -119,9 +195,17 @@ jobs: ansible: description: Ansible version to use type: string + image_ubuntu: + description: Ubuntu image + type: string machine: *ci-machine working_directory: ~/sensu_go steps: + - run: + command: | + sudo apt-get update + sudo apt-get install -y dbus + # service dbus start # Start D-Bus service - wrapper: ansible: << parameters.ansible >> kind: integration @@ -136,6 +220,9 @@ jobs: ansible: description: Ansible version to use type: string + image_ubuntu: + description: Ubuntu image + type: string machine: *ci-machine working_directory: ~/sensu_go steps: 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/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 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/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..d9d90e75 100644 --- a/roles/agent/tasks/start.yml +++ b/roles/agent/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Start sensu-agent (Linux) - service: + ansible.builtin.service: name: sensu-agent state: started enabled: true @@ -8,7 +8,7 @@ - name: Start sensu-agent (Windows) action: - module: win_service + 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/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..a7b0c287 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 diff --git a/sanity.requirements b/sanity.requirements index a99e2d2c..f13f3c90 100644 --- a/sanity.requirements +++ b/sanity.requirements @@ -1,6 +1,7 @@ # 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 -requests \ No newline at end of file +requests diff --git a/tests/integration/molecule/misc_api_cert/molecule.yml b/tests/integration/molecule/misc_api_cert/molecule.yml index 1785c689..95c61144 100644 --- a/tests/integration/molecule/misc_api_cert/molecule.yml +++ b/tests/integration/molecule/misc_api_cert/molecule.yml @@ -14,7 +14,8 @@ 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 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..60c80816 100644 --- a/tests/integration/molecule/role_agent_default/molecule.yml +++ b/tests/integration/molecule/role_agent_default/molecule.yml @@ -17,7 +17,8 @@ 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 provisioner: diff --git a/tests/integration/molecule/role_agent_secured/molecule.yml b/tests/integration/molecule/role_agent_secured/molecule.yml index 774cf311..33ceb5e3 100644 --- a/tests/integration/molecule/role_agent_secured/molecule.yml +++ b/tests/integration/molecule/role_agent_secured/molecule.yml @@ -8,7 +8,8 @@ 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 provisioner: diff --git a/tests/integration/molecule/role_backend_default/molecule.yml b/tests/integration/molecule/role_backend_default/molecule.yml index f9c28ce1..632b4c69 100644 --- a/tests/integration/molecule/role_backend_default/molecule.yml +++ b/tests/integration/molecule/role_backend_default/molecule.yml @@ -17,4 +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 9d526ef3..c806861f 100644 --- a/tests/integration/molecule/role_backend_secured/molecule.yml +++ b/tests/integration/molecule/role_backend_secured/molecule.yml @@ -15,4 +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 diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt new file mode 100644 index 00000000..6a013d5c --- /dev/null +++ b/tests/sanity/ignore-2.16.txt @@ -0,0 +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 f737dce0..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.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( + module.deprecate.assert_called_once_with( "Test msg", version="3.2.1", collection_name="sensu.sensu_go", ) diff --git a/tests/unit/plugins/modules/test_datastore.py b/tests/unit/plugins/modules/test_datastore.py index b57d74a5..aa810276 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, None, 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': '', '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,