Bug 1296615

Summary: [SME] Interactive Installer should (optionally?) replace /etc/ansible/hosts
Product: OpenShift Container Platform Reporter: Josh Preston <jpreston>
Component: InstallerAssignee: Samuel Munilla <smunilla>
Status: CLOSED WONTFIX QA Contact: Xiaoli Tian <xtian>
Severity: low Docs Contact:
Priority: high    
Version: 3.1.0CC: aos-bugs, bleanhar, jdetiber, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-24 20:49: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 Josh Preston 2016-01-07 16:35:50 UTC
Description of problem:

When running the interactive installer, the ansible hosts file is only stored in ~/.config/openshift/.ansible/hosts.  The system default /etc/ansible/hosts file is not updated.

Per BZ 1296597

It would be great if running ansible manually and/or converting to an advanced installation were easier.

It appears that I could potentially copy /root/.config/openshift/.ansible/hosts to /etc/ansible/hosts ...

Version-Release number of selected component (if applicable):

atomic-openshift-utils-3.0.20-1.git.0.3703f1b.el7aos.noarch

How reproducible:

always

Steps to Reproduce:
1. run atomic-openshift-installer
2.
3.

Actual results:

installed / upgraded properly, but /etc/ansible/hosts is not updated, replaced or touched.

Expected results:

/etc/ansible/hosts should be linked, updated, replaced properly.

Additional info:

Comment 1 Brenton Leanhardt 2016-01-07 19:22:26 UTC
atomic-openshift-installer was designed so that it wouldn't have to be run as root.  You can definitely copy the host file it creates to /etc/ansible/hosts.

I'd prefer to address this in documentation as you mention in Bug #1296597.  I'm curious if Jason agrees.

Comment 2 Josh Preston 2016-01-07 19:36:20 UTC
It might be nice for atomic-openshift-installer to print a notice advising to copy the hosts file to /etc/ansible.

While not directly related and only out of curiosity, since the installer does not ask me what account to use for ansible, do I assume that it will only ssh as root?

If the goal is to not have to run as root, perhaps the atomic-openshift-installer should ask for ssh user and sudo information for ansible for the non-root use case.

Comment 3 Brenton Leanhardt 2016-01-07 20:03:15 UTC
When the installer asks, "User for ssh access" that is the user that is used.  The requirement is that passwordless sudo access be available for that user.  When I was referring to ansible not running as root I meant from the "control" machine.  It can run as your normal user even if it connect to the remote hosts as root to install everything.

I'm not opposed to finding a non-intrusive way to present the various steps for switching to an advanced installation.  Marking this as low severity will remove it from our release blocker list while still causing our nag emails to be sent to the bug owner.

Comment 4 Jason DeTiberus 2016-01-11 18:19:09 UTC
Outside of modifying /etc/ansible/hosts, it is possible to avoid having to specify the host file when running ansible. One could specify hostfile in an ansible config file (lookup path is ./ansible.cfg, ~/.ansible.cfg, /etc/ansible/ansible.cfg).

Without knowing the user's intent, I'd be hesitant to assume that the user would want to overwrite /etc/ansible/hosts by running the openshift installer.

That said, I fully agree that we should probably tell the user about it and how they could invoke the playbooks manually. Maybe a README file that is generated in ~/.config/openshift/ that references the host file and the advanced installation docs?

Comment 5 Brenton Leanhardt 2016-01-11 18:51:53 UTC
I like the idea of README in ~/.config/openshift/