launch: stream syslog on remote host
So that operators have a clue what's going on during the long initial puppet run. Change-Id: If310c3420d942c79c8b04d3e9ce68f39081cc507
This commit is contained in:
		| @@ -23,6 +23,7 @@ import os | |||||||
| import shutil | import shutil | ||||||
| import subprocess | import subprocess | ||||||
| import sys | import sys | ||||||
|  | import threading | ||||||
| import tempfile | import tempfile | ||||||
| import time | import time | ||||||
| import traceback | import traceback | ||||||
| @@ -85,6 +86,13 @@ def run(cmd, **args): | |||||||
|     return ret |     return ret | ||||||
|  |  | ||||||
|  |  | ||||||
|  | def stream_syslog(ssh_client): | ||||||
|  |     try: | ||||||
|  |         ssh_client.ssh('tail -f /var/log/syslog') | ||||||
|  |     except Exception: | ||||||
|  |         print "Syslog stream terminated" | ||||||
|  |  | ||||||
|  |  | ||||||
| def bootstrap_server(server, key, name, volume_device, keep, | def bootstrap_server(server, key, name, volume_device, keep, | ||||||
|                      mount_path, fs_label): |                      mount_path, fs_label): | ||||||
|  |  | ||||||
| @@ -179,6 +187,10 @@ def bootstrap_server(server, key, name, volume_device, keep, | |||||||
|         os.symlink('/etc/ansible/hosts/generated-groups', |         os.symlink('/etc/ansible/hosts/generated-groups', | ||||||
|                    jobdir.groups) |                    jobdir.groups) | ||||||
|  |  | ||||||
|  |         t = threading.Thread(target=stream_syslog, args=(ssh_client,)) | ||||||
|  |         t.daemon = True | ||||||
|  |         t.start() | ||||||
|  |  | ||||||
|         ansible_cmd = [ |         ansible_cmd = [ | ||||||
|             'ansible-playbook', |             'ansible-playbook', | ||||||
|             '-i', jobdir.inventory_root, '-l', name, |             '-i', jobdir.inventory_root, '-l', name, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 James E. Blair
					James E. Blair