Red Hat Bugzilla – Bug 1451490
[RFE] Ansible should check if Fluentd and Collectd packages are installed and install if missing
Last modified: 2017-08-28 22:37:27 EDT
Description of problem: We require the Collectd and Fluentd packages as well as the plugins to be installed and latest for running the Ansible script that deploys the configurations. We need the ansible script to verify that the packages are installed and latest and install/upgrade if not.
(In reply to Shirly Radco from comment #0) > We need the ansible script to verify that the packages are installed and > latest and install/upgrade if not. when should this script be executed?
(In reply to Sandro Bonazzola from comment #1) > (In reply to Shirly Radco from comment #0) > > > We need the ansible script to verify that the packages are installed and > > latest and install/upgrade if not. > > when should this script be executed? I was thinking to add this as a separate playbook, since I see that we have a problem in the install/upgrade process and not all of the packages that we expect to have are indeed installed on the hosts. If this would be fixed then we can later deprecate it.
This seems like the wrong design to me. The main issue is that infra and integration need to agree on one place where the list of required packages are installed/updated per arch per version. I think this should be the host, but any design that solves this would be acceptable. Sandro, can you please work with Martin on a suggestion to solve the current mess?
(In reply to Yaniv Lavi from comment #3) > Sandro, can you please work with Martin on a suggestion to solve > the current mess? I'm on it.
I have now opened Bug 1460609, Please review it and add additional info as required.
IMO BZ1460609 will solve this issue for 4.2, so it it's needed also to solve in 4.1.z, then we need to fix that with some temporary solution
(In reply to Martin Perina from comment #6) > IMO BZ1460609 will solve this issue for 4.2, so it it's needed also to solve > in 4.1.z, then we need to fix that with some temporary solution Do we prefer to do a different fix or backport BZ1460609 ? We have a lot of issues around this topic.
(In reply to Yaniv Lavi from comment #7) > (In reply to Martin Perina from comment #6) > > IMO BZ1460609 will solve this issue for 4.2, so it it's needed also to solve > > in 4.1.z, then we need to fix that with some temporary solution > > Do we prefer to do a different fix or backport BZ1460609 ? > We have a lot of issues around this topic. From my point of view BZ1460609 and BZ1380498 are to huge changes to backport to 4.1.z
I will add a separate ansible script that will install/update the required packages for 4.1.z. We can later deprecate it.
Comment to QE, I used the same code as in centos-opstools/opstools-ansible and the code checks if the packages are installed and install if missing. It does not upgrade already installed packages.
In order for the ansible playbook to check and install missing packages and plugins, it is required to add in the command line: --extra-vars "manage_packages=true"
Comment #11 is not relevant anymore. The metrics setup script will now try to install the packages required to fluentd and collectd, if they are missing, it will not update existing packages. The package installation can be disabled by adding to the config.yml: manage_packages: false
There is unwanted scenario here. When packages are not available on host and nor in the repositories (no subscription) Playbook will fail and wont continue to other hosts and engine setup. tested in ovirt-engine-metrics-1.0.5-1.el7ev.noarch There is unwanted scenario here. When packages are not available on host and nor in the repositories (no subscription) Playbook will fail and wont continue to other hosts and engine setup. Desired scenario would be, fail the single host playbook, and continue setting up other resources. tested in ovirt-engine-metrics-1.0.5-1.el7ev.noarch [root@ls-engine1 ~]# /usr/share/ovirt-engine-metrics/setup/ansible/configure_ovirt_machines_for_metrics.sh PLAY [Configure Fluentd on nodes] ******************************************************************************** TASK [Gathering Facts] ******************************************************************************** ok: [1.2.3.4] TASK [ovirt_fluentd/read_local_ca_cert : Check if local fluentd certificate exists] ******************************************************************************** ok: [1.2.3.4 -> localhost] TASK [ovirt_fluentd/read_local_ca_cert : Read fluentd certificate] ******************************************************************************** ok: [1.2.3.4] TASK [ovirt_fluentd/ovirt_host_packages : Install fluentd host plugins] ******************************************************************************** failed: [1.2.3.4] (item=fluentd) => {"changed": false, "failed": true, "item": "fluentd", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n subscription-manager repos --enable <repo>\n To enable custom repositories:\n yum-config-manager --enable <repo>\n", "rc": 1, "results": []} failed: [1.2.3.4] (item=rubygem-fluent-plugin-collectd-nest) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-collectd-nest", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n subscription-manager repos --enable <repo>\n To enable custom repositories:\n yum-config-manager --enable <repo>\n", "rc": 1, "results": []} failed: [1.2.3.4] (item=rubygem-fluent-plugin-rewrite-tag-filter) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-rewrite-tag-filter", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n subscription-manager repos --enable <repo>\n To enable custom repositories:\n yum-config-manager --enable <repo>\n", "rc": 1, "results": []} failed: [1.2.3.4] (item=rubygem-fluent-plugin-secure-forward) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-secure-forward", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n subscription-manager repos --enable <repo>\n To enable custom repositories:\n yum-config-manager --enable <repo>\n", "rc": 1, "results": []} failed: [1.2.3.4] (item=rubygem-fluent-plugin-viaq_data_model) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-viaq_data_model", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n subscription-manager repos --enable <repo>\n To enable custom repositories:\n yum-config-manager --enable <repo>\n", "rc": 1, "results": []} PLAY RECAP ******************************************************************************** 1.2.3.4 : ok=3 changed=0 unreachable=0 failed=1
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
Please attach the full playbook output.
see commenr#13
This lists only 1 host. Please run with several hosts and have only one missing repository and see if the playbook fails or continues to run for the other hosts. If it only fails for the host that is missing the packages then this is required result.
I dont see engine being configured.
I believe that the reason that caused the qa test to fail is due to a different issue and not an issue with this patch. Please have the repository available for the node to be able to install update the packages. Opened Bug #1475707. It is expected that if such a case happens, the user will fix the issues in the node and will run the script again.
verified in ovirt-engine-metrics-1.0.6-1.el7ev.noarch