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

Bug 1546247

Summary: [DOCS] The "v3_6 upgrade_control_plane" playbook fails, due to not finding restorecon & swapoff commands (/sbin not in PATH)
Product: OpenShift Container Platform Reporter: DAVID F WATSON <dwatson>
Component: DocumentationAssignee: Ashley Hardin <ahardin>
Status: CLOSED CURRENTRELEASE QA Contact: Weihua Meng <wmeng>
Severity: medium Docs Contact: Vikram Goyal <vigoyal>
Priority: unspecified    
Version: 3.6.1CC: aos-bugs, dwatson, jokerman, mmccomas, mwitzenm, rspazzol, wmeng
Target Milestone: ---   
Target Release: 3.9.z   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-05 15:54:21 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: 1546254    
Bug Blocks:    

Description DAVID F WATSON 2018-02-16 17:54:14 UTC
Description of problem:
Running the "v3_6 upgrade_control_plane" playbook failed on openshift_node_upgrade 'Disable swap' task, due to swapoff command not found, and failed on openshift_node_upgrade 'Reset selinux context' task, due to "restorecon command not found.


Version-Release number of selected component (if applicable):
During upgrade from 3.5.5.31 to 3.6.173.0.5, using ansible-2.2.3.0 & atomic-openshift-utils-3.6.173.0.48, but customer reports this has been an issue since 3.3 install.


How reproducible:
Repeatedly, until modifying specific playbook, to  prepend commands with "/sbin/", or updating PATH via environment directive.

Steps to Reproduce:
1.ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml 


Actual results:
TASK [openshift_node_upgrade : Disable swap] ***********************************
fatal: [denqca3osmas01.qic.tiaa-cref.org]: FAILED! => {
    "changed": false,
    "cmd": "swapoff --all",
    "failed": true,
    "rc": 2
}

MSG:

[Errno 2] No such file or directory

AND

TASK [openshift_node_upgrade : Reset selinux context] **************************
fatal: [denqca3osmas01.qic.tiaa-cref.org]: FAILED! => {
    "changed": false,
    "cmd": "restorecon -RF /var/lib/origin/openshift.local.volumes",
    "failed": true,
    "rc": 2
}

MSG:

[Errno 2] No such file or directory


Expected results:
The upgrade_control_plane playbook upgrades master nodes.

Additional info:
This is likely due to customer's "secured non-tty ssh session environment" not including /sbin in the PATH. See customer Support Case https://access.redhat.com/support/cases/#/case/02037064 for logs

Description of problem:

Version-Release number of the following components:
rpm -q openshift-ansible
rpm -q ansible
ansible --version

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Fabian von Feilitzsch 2018-02-21 20:49:51 UTC
---
Scott Dodson 2018-02-20 10:02:45 EST

After discussing the solution we're going to implement is to document the expected PATH and request that admins ensure that PATH is correct for both ansible_ssh_user and root. This would be the default for RHEL 7.

We feel that it's incorrect to alter all code paths to use explicit paths when those paths may change between OS releases and it's undesirable to write conditional logic for every binary we use.
---

The default path for the root user in RHEL is `/sbin:/bin:/usr/sbin:/usr/bin`. If the user has these directories in their PATH then the openshift-ansible installer should succeed without issue.

https://github.com/openshift/openshift-docs/pull/7869

Comment 3 Weihua Meng 2018-04-04 01:47:53 UTC
LGTM.