diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/converge.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/converge.yml deleted file mode 100644 index 0873d1879..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/converge.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# Copyright 2021 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Converge - hosts: collectd-test - tasks: - - name: "Set up expected THT vars" - set_fact: - tripleo_role_name: "SomeRole" - service_net_map: - some_role_metrics_qdr_network: "ctlplane" - ctlplane_ip: "10.0.0.42" - - - name: "Use the tripleo_collectd role to configure collectd to export metrics to amqp" - include_role: - name: "{{ playbook_dir }}/../../../tripleo_collectd" - tasks_from: configure_collectd - vars: - collectd_conf_output_dir: "/etc/collectd.d/" - # This is not the right things to put here... need to check tripleo_collectd - tripleo_collectd_connection_type: 'amqp1' diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/verify.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/verify.yml deleted file mode 100644 index 00822611f..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/verify.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# Copyright 2021 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- import_playbook: ../common/verify.yml - -- name: Verify - hosts: collectd-test - tasks: - - name: "Get amqp conf" - stat: - path: "{{ collectd_conf_output_dir }}/amqp1.conf" - register: amqp_conf - failed_when: - - not amqp_conf.stat.exists diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/converge.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/converge.yml similarity index 93% rename from tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/converge.yml rename to tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/converge.yml index f3f6930c9..3ecc9c223 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/converge.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/converge.yml @@ -32,6 +32,5 @@ vars: collectd_conf_output_dir: "/etc/collectd.d/" tripleo_collectd_amqp_host: collectd-test - # This is not the right things to put here... need to check tripleo_collectd tripleo_collectd_connection_type: 'amqp1' tripleo_collectd_amqp_interval: -666 diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/molecule.yml similarity index 90% rename from tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/molecule.yml rename to tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/molecule.yml index c2d5de1f1..3cbc78f2c 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/molecule.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/molecule.yml @@ -10,9 +10,9 @@ platforms: url: registry.access.redhat.com volumes: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars + - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg:O + - /opt/yum.repos.d:/etc/yum.repos.d:O + - /etc/dnf/vars:/etc/dnf/vars:O privileged: true environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/verify.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/verify.yml similarity index 100% rename from tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/verify.yml rename to tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection_default_interval/verify.yml diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/molecule.yml deleted file mode 100644 index c2d5de1f1..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_default_interval/molecule.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -driver: - name: podman - -platforms: - - name: collectd-test - hostname: collectd-test - image: ubi9/ubi-init - registry: - url: registry.access.redhat.com - volumes: - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars - privileged: true - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - CONTAINER_BIN: podman - ulimits: &ulimit - - host - -provisioner: - inventory: - hosts: - all: - hosts: - collectd-test: - ansible_python_interpreter: /usr/bin/python3 - host_vars: - collectd-test: - collectd_conf_output_dir: "/etc/collectd.d/" - name: ansible - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-\ - /usr/share/ansible/plugins/filter}" - playbooks: - prepare: ../common/prepare.yml - -verifier: - name: ansible - -dependency: - name: galaxy - options: - role-file: molecule/common/requirements.yml - -scenario: - test_sequence: - - destroy - - dependency - - create - - prepare - - converge - - check - - verify - - destroy diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/collectd_connection/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/collectd_connection/molecule.yml index 14b4695fd..81e20ab40 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/collectd_connection/molecule.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/collectd_connection/molecule.yml @@ -14,9 +14,9 @@ platforms: url: registry.access.redhat.com volumes: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars + - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg:O + - /opt/yum.repos.d:/etc/yum.repos.d:O + - /etc/dnf/vars:/etc/dnf/vars:O privileged: true environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" @@ -32,6 +32,7 @@ platforms: networks: - name: collectd ipv4_address: "192.168.42.1" + - name: collectd-server hostname: collectd-server image: ubi9/ubi-init @@ -39,6 +40,9 @@ platforms: url: registry.access.redhat.com volumes: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg:O + - /opt/yum.repos.d:/etc/yum.repos.d:O + - /etc/dnf/vars:/etc/dnf/vars:O privileged: true environment: http_proxy: "{{ lookup('env', 'http_proxy') }}" @@ -57,6 +61,8 @@ provisioner: hosts: collectd-test: ansible_python_interpreter: /usr/bin/python3 + collectd-server: + ansible_python_interpreter: /usr/bin/python3 host_vars: collectd-test: collectd_conf_output_dir: "/etc/collectd.d/" diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/default/molecule.yml index b61393509..e5f4a2102 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/default/molecule.yml @@ -10,9 +10,9 @@ platforms: url: registry.access.redhat.com volumes: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars + - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg:O + - /opt/yum.repos.d:/etc/yum.repos.d:O + - /etc/dnf/vars:/etc/dnf/vars:O privileged: true environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/converge.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/converge.yml deleted file mode 100644 index 6340fd689..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/converge.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -# Copyright 2021 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Converge - hosts: collectd-test - tasks: - - set_fact: - tripleo_role_name: "SomeRole" - service_net_map: - some_role_metrics_qdr_network: "ctlplane" - ctlplane_ip: "10.0.0.42" - fqdn_ctlplane: "standalone.ctlplane.localdomain" - - - name: "Use tripleo_collectd to configure collectd with defaults" - include_role: - name: '{{ playbook_dir }}/../../../tripleo_collectd' - tasks_from: configure_collectd - vars: - collectd_conf_output_dir: "/etc/collectd.d" - tripleo_collectd_enable_libpodstats: true diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/molecule.yml deleted file mode 100644 index c2d5de1f1..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/molecule.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -driver: - name: podman - -platforms: - - name: collectd-test - hostname: collectd-test - image: ubi9/ubi-init - registry: - url: registry.access.redhat.com - volumes: - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars - privileged: true - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - CONTAINER_BIN: podman - ulimits: &ulimit - - host - -provisioner: - inventory: - hosts: - all: - hosts: - collectd-test: - ansible_python_interpreter: /usr/bin/python3 - host_vars: - collectd-test: - collectd_conf_output_dir: "/etc/collectd.d/" - name: ansible - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-\ - /usr/share/ansible/plugins/filter}" - playbooks: - prepare: ../common/prepare.yml - -verifier: - name: ansible - -dependency: - name: galaxy - options: - role-file: molecule/common/requirements.yml - -scenario: - test_sequence: - - destroy - - dependency - - create - - prepare - - converge - - check - - verify - - destroy diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/verify.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/verify.yml deleted file mode 100644 index e56fc8155..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/verify.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -# Copyright 2021 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- import_playbook: ../common/verify.yml - -- name: "Verify collectd libpodstats plugin" - hosts: collectd-test - tasks: - - name: Check that the libpodstats conf file exists - stat: - path: '/etc/collectd.d/libpodstats.conf' - register: output - failed_when: - - not output.stat.exists - - - name: Get contents of libpodstats.conf - slurp: - src: /etc/collectd.d/libpodstats.conf - register: libpodstats_conf - failed_when: - - not 'LoadPlugin "libpodstats"' in libpodstats_conf.content | b64decode - - not '' in libpodstats_conf.content | b64decode - - not '' in libpodstats_conf.content | b64decode - - - name: "Check that the TypesDB has been updated" - slurp: - src: /etc/collectd.conf - register: output - failed_when: - - not "TypesDB \"/etc/collectd.d//types.db.libpodstats\"" in output.content | b64decode - - - name: "Check that the contents of types.db.libpodstats are as expected" - slurp: - src: /etc/collectd.d/types.db.libpodstats - register: typesdb - failed_when: - - not "pod_cpu percent:GAUGE:0:100.1, time:DERIVE:0:U" in typesdb.content | b64decode - - not "pod_memory value:GAUGE:0:281474976710656" in typesdb.content | b64decode diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/converge.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/converge.yml similarity index 85% rename from tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/converge.yml rename to tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/converge.yml index 6dd3242bc..48020b870 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/converge.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/converge.yml @@ -15,4 +15,6 @@ vars: collectd_conf_output_dir: "/etc/collectd.d/" tripleo_collectd_enable_sensubility: true + tripleo_collectd_enable_libpodstats: true + tripleo_collectd_enable_sqlalchemy: true tripleo_collectd_sensubility_exec_sudo_rule: "collectd ALL = NOPASSWD: ALL" diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/molecule.yml similarity index 90% rename from tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/molecule.yml rename to tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/molecule.yml index c2d5de1f1..3cbc78f2c 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/amqp_connection/molecule.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/molecule.yml @@ -10,9 +10,9 @@ platforms: url: registry.access.redhat.com volumes: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars + - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg:O + - /opt/yum.repos.d:/etc/yum.repos.d:O + - /etc/dnf/vars:/etc/dnf/vars:O privileged: true environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/verify.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/verify.yml similarity index 50% rename from tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/verify.yml rename to tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/verify.yml index 08d74c0cf..effe2203d 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility/verify.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sensubility_libpodstats_sqlalchemy/verify.yml @@ -59,3 +59,65 @@ register: sensubility_sudoers failed_when: - 'not "collectd ALL = NOPASSWD: ALL" in sensubility_sudoers.content | b64decode' + +- name: "Verify collectd libpodstats plugin" + hosts: collectd-test + tasks: + - name: Check that the libpodstats conf file exists + stat: + path: '/etc/collectd.d/libpodstats.conf' + register: output + failed_when: + - not output.stat.exists + + - name: Get contents of libpodstats.conf + slurp: + src: /etc/collectd.d/libpodstats.conf + register: libpodstats_conf + failed_when: + - not 'LoadPlugin "libpodstats"' in libpodstats_conf.content | b64decode + - not '' in libpodstats_conf.content | b64decode + - not '' in libpodstats_conf.content | b64decode + + - name: "Check that the TypesDB has been updated" + slurp: + src: /etc/collectd.conf + register: output + failed_when: + - not "TypesDB \"/etc/collectd.d//types.db.libpodstats\"" in output.content | b64decode + + - name: "Check that the contents of types.db.libpodstats are as expected" + slurp: + src: /etc/collectd.d/types.db.libpodstats + register: typesdb + failed_when: + - not "pod_cpu percent:GAUGE:0:100.1, time:DERIVE:0:U" in typesdb.content | b64decode + - not "pod_memory value:GAUGE:0:281474976710656" in typesdb.content | b64decode + +- name: Verify collectd sqlalchemy plugin + hosts: collectd-test + tasks: + - name: "Make sure python.conf exists" + stat: + path: "{{ collectd_conf_output_dir }}/python.conf" + register: python_conf + failed_when: + - not python_conf.stat.exists + + - name: "Get contents of python.conf" + slurp: + path: "{{ collectd_conf_output_dir }}/python.conf" + register: python_conf + + - name: "Check that the config imports sqlalchemy" + assert: + that: + - '"Import \"sqlalchemy_collectd.server.plugin\"" in python_conf.content | b64decode' + fail_msg: "SQLAlchemy is not imported by python config" + + - name: "Check that collectd_sqlalchemy is configured as expected" + assert: + that: + - '"" in python_conf.content | b64decode' + - '"listen \"localhost\" 25827" in python_conf.content | b64decode' + - '"loglevel \"info\"" in python_conf.content | b64decode' diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/converge.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/converge.yml deleted file mode 100644 index f52e76fc9..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/converge.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -# Copyright 2021 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Converge - hosts: collectd-test - tasks: - - name: "Set up expected THT vars" - set_fact: - tripleo_role_name: "SomeRole" - service_net_map: - some_role_metrics_qdr_network: "ctlplane" - ctlplane_ip: "10.0.0.42" - - - name: "Include tripleo-collectd-ansible-role" - include_role: - name: '{{ playbook_dir }}/../../../tripleo_collectd' - tasks_from: configure_collectd - vars: - collectd_conf_output_dir: "/etc/collectd.d/" - tripleo_collectd_enable_sqlalchemy: true diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/molecule.yml deleted file mode 100644 index c2d5de1f1..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/molecule.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -driver: - name: podman - -platforms: - - name: collectd-test - hostname: collectd-test - image: ubi9/ubi-init - registry: - url: registry.access.redhat.com - volumes: - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars - privileged: true - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - CONTAINER_BIN: podman - ulimits: &ulimit - - host - -provisioner: - inventory: - hosts: - all: - hosts: - collectd-test: - ansible_python_interpreter: /usr/bin/python3 - host_vars: - collectd-test: - collectd_conf_output_dir: "/etc/collectd.d/" - name: ansible - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-\ - /usr/share/ansible/plugins/filter}" - playbooks: - prepare: ../common/prepare.yml - -verifier: - name: ansible - -dependency: - name: galaxy - options: - role-file: molecule/common/requirements.yml - -scenario: - test_sequence: - - destroy - - dependency - - create - - prepare - - converge - - check - - verify - - destroy diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/requirements.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/requirements.yml deleted file mode 100644 index 4e9edefea..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/requirements.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- src: git+https://github.com/infrawatch/functional-tests - name: functional_tests - -- src: git+http://github.com/infrawatch/collectd-config-ansible-role - name: collectd_config diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/verify.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/verify.yml deleted file mode 100644 index 7e002e40c..000000000 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_sqlalchemy/verify.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -# Copyright 2021 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- import_playbook: ../common/verify.yml - -- name: Verify - hosts: collectd-test - tasks: - - name: "Make sure python.conf exists" - stat: - path: "{{ collectd_conf_output_dir }}/python.conf" - register: python_conf - failed_when: - - not python_conf.stat.exists - - - name: "Get contents of python.conf" - slurp: - path: "{{ collectd_conf_output_dir }}/python.conf" - register: python_conf - - - name: "Check that the config imports sqlalchemy" - assert: - that: - - '"Import \"sqlalchemy_collectd.server.plugin\"" in python_conf.content | b64decode' - fail_msg: "SQLAlchemy is not imported by python config" - - - name: "Check that collectd_sqlalchemy is configured as expected" - assert: - that: - - '"" in python_conf.content | b64decode' - - '"listen \"localhost\" 25827" in python_conf.content | b64decode' - - '"loglevel \"info\"" in python_conf.content | b64decode' diff --git a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_stf/molecule.yml b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_stf/molecule.yml index c2d5de1f1..3cbc78f2c 100644 --- a/tripleo_ansible/roles/tripleo_collectd/molecule/enable_stf/molecule.yml +++ b/tripleo_ansible/roles/tripleo_collectd/molecule/enable_stf/molecule.yml @@ -10,9 +10,9 @@ platforms: url: registry.access.redhat.com volumes: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - - /etc/dnf/vars:/etc/dnf/vars + - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg:O + - /opt/yum.repos.d:/etc/yum.repos.d:O + - /etc/dnf/vars:/etc/dnf/vars:O privileged: true environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" diff --git a/zuul.d/molecule.yaml b/zuul.d/molecule.yaml index 25e63163d..f3c31cce7 100644 --- a/zuul.d/molecule.yaml +++ b/zuul.d/molecule.yaml @@ -386,7 +386,7 @@ enable_fips: true nslookup_target: opendev.org tripleo_role_name: tripleo_collectd - voting: false + voting: true - job: files: - ^molecule-requirements.txt