feat: add boot staging configuration and automation utility scripts
This commit is contained in:
20
scripts/check_job_100.py
Normal file
20
scripts/check_job_100.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.11', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
py_code = """
|
||||
from awx.main.models import Job
|
||||
job = Job.objects.get(id=100)
|
||||
print(f"Job [100]: Status={job.status}, Elapsed={job.elapsed}s, Failed={job.failed}")
|
||||
events = job.job_events.order_by('id')
|
||||
for e in events:
|
||||
if e.stdout:
|
||||
print(e.stdout)
|
||||
"""
|
||||
|
||||
cmd = f"kubectl exec -i -n awx -c awx-task deployment/awx-task -- awx-manage shell_plus --quiet << 'EOF'\n{py_code}\nEOF"
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
print(stdout.read().decode())
|
||||
ssh.close()
|
||||
Reference in New Issue
Block a user