Bug 1658935

Summary: [RFE] Remove unnecessary warning from running prerequisites.yml playbook when checking for chrony
Product: OpenShift Container Platform Reporter: Brendan Mchugh <bmchugh>
Component: InstallerAssignee: Scott Dodson <sdodson>
Installer sub component: openshift-ansible QA Contact: Johnny Liu <jialiu>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: unspecified    
Version: 3.11.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-13 18:14:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brendan Mchugh 2018-12-13 08:30:25 UTC
Description of problem:
Every time that the prerequisites.yml playbook runs this warning comes up.

TASK [Determine if chrony is installed] ********************************************************************************************************************************************************************
 [WARNING]: Consider using the yum, dnf or zypper module rather than running rpm.  If you need to use command because yum, dnf or zypper is insufficient you can add warn=False to this command task or set
command_warnings=False in ansible.cfg to get rid of this message.


Version-Release number of the following components:

openshift-ansible-3.11.16-1.git.0.4ac6f81.el7.noarch
ansible-2.6.5-1.el7ae.noarch

ansible 2.6.5
  config file = /home/quicklab/ansible.cfg
  configured module search path = [u'/home/quicklab/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]


How reproducible:

Steps to Reproduce:
1. ansible -i hosts masters -m command -a "rpm -q chrony"
2.
3.

Actual results:
[WARNING]: Consider using the yum, dnf or zypper module rather than running rpm.  If you need to use command because yum, dnf or zypper is insufficient you can add warn=False to this command task or set
command_warnings=False in ansible.cfg to get rid of this message.


Expected results:
No unnecessary warnings in the ansible output.

Additional info:
The current version of the task in "/usr/share/ansible/openshift-ansible/playbooks/init/base_packages.yml" is as follows:

  - name: Determine if chrony is installed
    command: rpm -q chrony
    failed_when: false
    register: chrony_installed


Perhaps this specific task could be modified so that it specifically will not emit the warning while other tasks would remain unaffected.

  - name: Determine if chrony is installed
    command: rpm -q chrony
    args:
      warn: no
    failed_when: false
    register: chrony_installed

Comment 1 Scott Dodson 2018-12-13 18:14:59 UTC
This will be removed in 4.0 and does not meet the criteria for resolution in existing releases.