Bug 1414625

Summary: [IntService_public_295] add mandatory check 'httpd-tools' is installed on master
Product: OpenShift Container Platform Reporter: Peng Li <penli>
Component: InstallerAssignee: Jeff Cantrill <jcantril>
Status: CLOSED ERRATA QA Contact: Peng Li <penli>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: aos-bugs, jcantril, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-12 18:48:57 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:
Bug Depends On: 1418911    
Bug Blocks:    

Description Peng Li 2017-01-19 03:26:35 UTC
Description of problem:
Try the new Metrics install way using Ansible, failed at step task TASK [openshift_metrics : generate htpasswd file for hawkular metrics] *********
task path: openshift-ansible/roles/openshift_metrics/tasks/generate_hawkular_certificates.yaml:31
Form the log we can see it's caused by command 'htpasswd' is not available on master.
We should check it and install package 'httpd-tools' or in the document let user to install this package as prerequisite.

Version-Release number of selected component (if applicable):
openshift v3.5.0.5+8f2840d

How reproducible:
always

Steps to Reproduce:
1. prepare the inventory file

[oo_first_master]
$MASTER ansible_user=root ansible_ssh_user=root ansible_ssh_private_key_file="/home/penli/.ssh/libra.pem" openshift_public_hostname=$MASTER

[oo_first_master:vars]
deployment_type=openshift-enterprise
openshift_release=v3.5.0
openshift_metrics_install_metrics=true

openshift_metrics_hostname=hawkular-metrics.$SUBDOMAIN
openshift_metrics_project=openshift-infra

openshift_metrics_image_prefix=registry.ops.openshift.com/openshift3/
openshift_metrics_image_version=3.5.0

2. git clone https://github.com/openshift/openshift-ansible.git

3. ansible-playbook -vvv -i ~/inventory   playbooks/common/openshift-cluster/openshift_metrics.yml

4. task fail and abort.
message
fatal: [$MASTER]: FAILED! => {
    "changed": true, 
    "cmd": "htpasswd -ci '/etc/origin/master/metrics/hawkular-metrics.htpasswd' hawkular < '/etc/origin/master/metrics/hawkular-metrics.pwd'", 
    "delta": "0:00:00.003536", 
    "end": "2017-01-18 21:02:16.384476", 
    "failed": true, 
    "invocation": {
        "module_args": {
            "_raw_params": "htpasswd -ci '/etc/origin/master/metrics/hawkular-metrics.htpasswd' hawkular < '/etc/origin/master/metrics/hawkular-metrics.pwd'", 
            "_uses_shell": true, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "warn": true
        }, 
        "module_name": "command"
    }, 
    "rc": 127, 
    "start": "2017-01-18 21:02:16.380940", 
    "stderr": "/bin/sh: htpasswd: command not found", 
    "stdout": "", 
    "stdout_lines": [], 
    "warnings": []
}

Expected results:
install successfully.

Additional info:
Ansible execution log attached.

Comment 2 Jeff Cantrill 2017-01-23 19:11:17 UTC
Provided check in https://github.com/openshift/openshift-ansible/pull/3151

Comment 3 Peng Li 2017-01-26 09:11:40 UTC
@jcantril, I tried on a env which both master and ansible control node(not the master) don't have httpd-tools installed, and run ansible, it generate below error[1]. Then I installed httpd-tools on ansible control node, it passed this task but return the same error what I report at https://bugzilla.redhat.com/show_bug.cgi?id=1414625#c0

So things come back to https://bugzilla.redhat.com/show_bug.cgi?id=1414477#c6, will we restrict this ansible task should only be run on master? If this is the design, I can set this bug to 'verified' and document this. Though from QE's test, most our ansible jobs run on control node but not the master.


[1]
TASK [openshift_metrics : fail] ************************************************
task path: /root/openshift-ansible/roles/openshift_metrics/tasks/install_support.yaml:8
fatal: [ec2-54-90-212-109.compute-1.amazonaws.com]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "msg": "'htpasswd' is unavailable. Please install httpd-tools on the control node"
        }, 
        "module_name": "fail"
    }, 
    "msg": "'htpasswd' is unavailable. Please install httpd-tools on the control node"
}
	to retry, use: --limit @/root/openshift-ansible/playbooks/common/openshift-cluster/openshift_metrics.retry

Comment 4 Jeff Cantrill 2017-01-26 17:59:34 UTC
Added another PR to address #3 https://github.com/openshift/openshift-ansible/pull/3195

Comment 5 Peng Li 2017-02-03 03:28:42 UTC
There is a typo here

https://github.com/openshift/openshift-ansible/blob/master/roles/openshift_metrics/tasks/install_support.yaml#L12

should check keytool 
 local_action: command which htpasswd

Comment 6 Peng Li 2017-02-03 03:30:18 UTC
other parts looks good, after install htpasswd and jdk on Ansible control node, the job can proceed.

Comment 7 Jeff Cantrill 2017-02-03 13:46:01 UTC
fixed check for keytool in https://github.com/openshift/openshift-ansible/pull/3258

Comment 8 Peng Li 2017-02-04 07:41:01 UTC
will verify this once https://bugzilla.redhat.com/show_bug.cgi?id=1418911 is fixed.

Comment 9 Peng Li 2017-02-07 06:31:48 UTC
verified with master branch, a hint is there when java is not installed on ansible control node.

Comment 11 errata-xmlrpc 2017-04-12 18:48:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0903