Merge "launch: stream syslog on remote host"
This commit is contained in:
commit
f2ac215342
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user