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

Bug 1625875

Summary: [olm] cannot install/uninstall the OLM component via openshift-ansible
Product: OpenShift Container Platform Reporter: Jian Zhang <jiazha>
Component: OLMAssignee: Evan Cordell <ecordell>
Status: CLOSED CURRENTRELEASE QA Contact: Jian Zhang <jiazha>
Severity: high Docs Contact:
Priority: high    
Version: 3.11.0CC: chezhang, dyan, jfan, 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-12-21 15:23:36 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-09-06 07:19:29 UTC
Description of problem:
Cannot install/uninstall the OLM component by using the master branch.
I think the root cause is that the OLM main task was deleted from this PR:
https://github.com/openshift/openshift-ansible/pull/9864/files#diff-cac757c94a3fec820c37c7dde67a688d

Version-Release number of selected component (if applicable):
openshift-ansible master branch

How reproducible:
always

Steps to Reproduce:
1. Set variables to uninstall the OLM component in the inventory file:
operator_lifecycle_manager_remove=true
operator_lifecycle_manager_install=false

2. Run the playbook.
[jzhang@localhost openshift-ansible]$ ansible-playbook -i qe-inventory-host-file playbooks/olm/config.yml 

Actual results:
The OLM component still exists. The remove tasks didn't invoke.
...
PLAY [OLM Install Checkpoint Start] *******************************************************************************************************************************************************************************

TASK [Set OLM install 'In Progress'] ******************************************************************************************************************************************************************************
Thursday 06 September 2018  14:56:55 +0800 (0:00:00.044)       0:00:23.565 **** 
ok: [qe-jiazha-nfs-rhel-1.0906-c4y.qe.rhcloud.com]

PLAY [Operator Lifecycle Manager] *********************************************************************************************************************************************************************************

PLAY [OLM Install Checkpoint End] *********************************************************************************************************************************************************************************

TASK [Set OLM install 'Complete'] *********************************************************************************************************************************************************************************
Thursday 06 September 2018  14:56:55 +0800 (0:00:00.056)       0:00:23.622 **** 
ok: [qe-jiazha-nfs-rhel-1.0906-c4y.qe.rhcloud.com]

PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost                  : ok=12   changed=0    unreachable=0    failed=0   
qe-jiazha-master-etcd-1.0906-c4y.qe.rhcloud.com : ok=37   changed=1    unreachable=0    failed=0   
qe-jiazha-nfs-rhel-1.0906-c4y.qe.rhcloud.com : ok=4    changed=0    unreachable=0    failed=0   
qe-jiazha-node-1.0906-c4y.qe.rhcloud.com : ok=0    changed=0    unreachable=0    failed=0   
qe-jiazha-node-infra-1.0906-c4y.qe.rhcloud.com : ok=0    changed=0    unreachable=0    failed=0   


Expected results:
Users can uninstall/install the OLM component via the playbooks.

Additional info:

Comment 1 Jian Zhang 2018-09-06 08:31:52 UTC
workaround:
create the main yaml file for it, like below:
[jzhang@localhost openshift-ansible]$ cat roles/olm/tasks/main.yaml 
---
# do any asserts here

- include_tasks: install.yaml
  when: operator_lifecycle_manager_install | bool

- include_tasks: remove.yaml
  when: operator_lifecycle_manager_remove | bool

Comment 2 Evan Cordell 2018-09-07 02:21:13 UTC
https://github.com/openshift/openshift-ansible/pull/9949 this should be fixed in the PR once merged

Comment 3 Jian Zhang 2018-09-11 05:54:33 UTC
Yes, LGTM, verify it.

Comment 4 Luke Meyer 2018-12-21 15:23:36 UTC
Closing bugs that were verified and targeted for GA but for some reason were not picked up by errata. This bug fix should be present in current 3.11 release content.