]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Explicitly set ansible_ssh_user
authorZack Cerza <zack@redhat.com>
Fri, 22 May 2015 16:38:27 +0000 (10:38 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 1 Jun 2015 16:21:09 +0000 (10:21 -0600)
... to the same as the teuthology user

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/ansible.py

index fa6b1b953e377272286a8f224214abbca009f790..43a564aad924fbf75e0e25b5965533f4bb90e76f 100644 (file)
@@ -1,3 +1,4 @@
+import json
 import logging
 import requests
 import os
@@ -224,8 +225,12 @@ class Ansible(Task):
         Assemble the list of args to be executed
         """
         fqdns = [r.hostname for r in self.cluster.remotes.keys()]
+        # Assume all remotes use the same username
+        user = self.cluster.remotes.keys()[0].user
+        extra_vars = dict(ansible_ssh_user=user)
         args = [
             'ansible-playbook', '-v',
+            "--extra-vars='%s'" % json.dumps(extra_vars),
             '-i', self.inventory,
             '--limit', ','.join(fqdns),
             self.playbook_file.name,