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:
James E. Blair 2016-09-15 15:03:55 -07:00
parent 8f46fbc0b5
commit ccfe5111c8

View File

@ -23,6 +23,7 @@ import os
import shutil
import subprocess
import sys
import threading
import tempfile
import time
import traceback
@ -85,6 +86,13 @@ def run(cmd, **args):
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,
mount_path, fs_label):
@ -179,6 +187,10 @@ def bootstrap_server(server, key, name, volume_device, keep,
os.symlink('/etc/ansible/hosts/generated-groups',
jobdir.groups)
t = threading.Thread(target=stream_syslog, args=(ssh_client,))
t.daemon = True
t.start()
ansible_cmd = [
'ansible-playbook',
'-i', jobdir.inventory_root, '-l', name,