Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1615227

Summary: The clusterservicebroker "ansible-service-broker" should be deleted when uninstall the ASB
Product: OpenShift Container Platform Reporter: Jian Zhang <jiazha>
Component: Service BrokerAssignee: Jason Montleon <jmontleo>
Status: CLOSED ERRATA QA Contact: Jian Zhang <jiazha>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.11.0CC: aos-bugs, chezhang, jiazha, jmatthew, zitang
Target Milestone: ---   
Target Release: 3.11.0   
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-10-11 07:24:38 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 Jian Zhang 2018-08-13 05:30:53 UTC
Description of problem:
After uninstall the ASB, the clusterservicebroker "ansible-service-broker" still exist.

Version-Release number of selected component (if applicable):
openshift-ansible master branch
The latest commit:
[jzhang@localhost openshift-ansible]$ git log
commit 7bd4429f71ae1b45f3ac7eba49d6f65c2e4bf831
Author: AOS Automation Release Team <aos-team-art>
Date:   Sun Aug 12 19:16:59 2018 -0400

    Automatic commit of package [openshift-ansible] release [3.11.0-0.14.0].
    
    Created by command:
    
    /usr/bin/tito tag --debug --accept-auto-changelog --keep-version --debug


How reproducible:
always

Steps to Reproduce:
1. Add the below variable in the inventory file:
ansible_service_broker_install=false
ansible_service_broker_remove=true
2. Run the ansible:
ansible-playbook -i qe-inventory-host-file playbooks/openshift-service-catalog/config.yml

Actual results:
The ansible run succeeds, but the clusterservicebroker "ansible-service-broker" still exist.
[root@qe-jiazha-round2master-etcd-1 ~]# oc get ns | grep ansible

[root@qe-jiazha-round2master-etcd-1 ~]# oc get clusterservicebroker
NAME                     CREATED AT
ansible-service-broker   2018-08-13T02:44:31Z


Expected results:
The clusterservicebroker "ansible-service-broker" should be deleted.


Additional info:

I double check this issue and did NOT find any task to remove the clusterservicebroker, here is the log:http://pastebin.test.redhat.com/630449

Comment 1 Jason Montleon 2018-08-14 19:35:14 UTC
There's a task to remove the clusterservicebroker:

https://github.com/openshift/openshift-ansible/blob/master/roles/ansible_service_broker/tasks/remove.yml#L110-L121

It looks like it is being skipped for some reason:
TASK [ansible_service_broker : shell] *****************************************************************************************************************************************************************************
Monday 13 August 2018  11:55:22 +0800 (0:00:06.349)       0:04:11.794 *********
ok: [host-8-246-132.host.centralci.eng.rdu2.redhat.com]
 
TASK [ansible_service_broker : remove broker object from the catalog] *********************************************************************************************************************************************
Monday 13 August 2018  11:55:24 +0800 (0:00:01.842)       0:04:13.636 *********
skipping: [host-8-246-132.host.centralci.eng.rdu2.redhat.com]

I ran the shell command my hand and it worked ok, so I'm not sure what's going wrong here.

Can you run the playbook with -vvv so we can see what's going wrong?

Comment 2 Jason Montleon 2018-08-14 19:47:56 UTC
The syntax in the conditional is incorrect.

https://github.com/openshift/openshift-ansible/pull/9593

Comment 3 Jian Zhang 2018-08-20 10:07:31 UTC
Change status to "ON_QA".

Comment 4 Jian Zhang 2018-08-20 10:10:14 UTC
I used the latest master branch and ansible 2.6 to test this issue.
TASK [ansible_service_broker : remove broker object from the catalog] *********************************************************************************************************************************************
Monday 20 August 2018  17:57:37 +0800 (0:00:02.971)       0:05:21.932 ********* 
changed: [qe-jiazha-round3master-etcd-1.0820-145.qe.rhcloud.com]
[root@qe-jiazha-round3master-etcd-1 ~]# oc get clusterservicebroker
NAME                      CREATED AT
abroker                   2018-08-20T08:57:36Z
template-service-broker   2018-08-20T09:58:54Z
ups-broker                2018-08-20T07:47:45Z

The ansible-service-broker can be deleted successfully, LGTM, verify it.

Comment 6 errata-xmlrpc 2018-10-11 07:24:38 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-2018:2652