Repository: openshift/openshift-ansible

Issue:
Quick install dumps out “openshift” four times
Reporting on behalf of @jwforres

Noticed several times during the quick install that it dumps out “openshift” four times. It’s odd looking output with no clear reason for why it’s there.
Example snippet https://gist.github.com/jwforres/e67120e06f709c6cf9d33c5b1a6ab75c



Discussion:
That is indeed quite odd. Need more information from the relevant reporter. Please provide:

```
$ rpm -q openshift-ansible atomic-openshift-utils ansible
```
I don't have the instances anymore but I happen to still have the output from the yum install in my terminal history

```
Installing:
 atomic-openshift-utils                                     noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         171 k
Installing for dependencies:
 ansible                                                    noarch                         2.2.0.0-1.el7                                         rhel-7-server-ose-3.3-rpms                         4.5 M
 openshift-ansible                                          noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         150 k
 openshift-ansible-callback-plugins                         noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         137 k
 openshift-ansible-docs                                     noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         146 k
 openshift-ansible-filter-plugins                           noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         157 k
 openshift-ansible-lookup-plugins                           noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         130 k
 openshift-ansible-playbooks                                noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         223 k
 openshift-ansible-roles                                    noarch                         3.3.54-1.git.0.61a1dee.el7                            rhel-7-server-ose-3.3-rpms                         452 k

```
Also I have two slightly longer output captures from the two points during the install where the 'openshift' text showed up:

https://gist.github.com/jwforres/463365ca3b1218294a7fbb20abed7283
https://gist.github.com/jwforres/bda311c0737a1c64cda15f51e4579a7d
@jwforres I rebuilt and installed the packages from the hash you referenced (61a1dee). It did not reproduce the error for me though, weeeeeeird :crying_cat_face: 

That version you're using is from November though. Can you please try using a newer version than 3.3.54 and re-running your tests? Thanks
erm. One moment

@sdodson @detiber @tdawson *is there* a newer version than 3.3.54 available in the repos/channels right now?
@rhamilto @benjaminapetersen you guys ran through the same setup I did, do you remember whether you noticed this issue?
@jwforres, yep, we both saw the issue.
@tbielawa 
3.3 repos / channels - 3.3.57
3.4 repos / channels - 3.4.41
@tbielawa I think I might have found the culprit: https://github.com/openshift/openshift-ansible/blob/4cdc771f8e04f88ac47dd194da03dadfa2fdba2d/utils/src/ooinstall/openshift_ansible.py#L215
@detiber I think this might 'fix' it

https://gist.github.com/tbielawa/67c8285a09108b35ddb19365fcca85a4

Resolving patch:
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py
--- a/utils/src/ooinstall/openshift_ansible.py
+++ b/utils/src/ooinstall/openshift_ansible.py
@@ -212,7 +212,7 @@ def write_host(host, role, inventory, schedulable=None):
     if installer_host in [host.connect_to, host.hostname, host.public_hostname]:
         facts += ' ansible_connection=local'
         if os.geteuid() != 0:
-            no_pwd_sudo = subprocess.call(['sudo', '-n', 'echo', 'openshift'])
+            no_pwd_sudo = subprocess.call(['sudo', '-n', 'echo', '-n'])
             if no_pwd_sudo == 1:
                 print('The atomic-openshift-installer requires sudo access without a password.')
                 sys.exit(1)


Test patch: