mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-10-31 11:22:28 +00:00 
			
		
		
		
	Transfer encryption key on capture
This commit is contained in:
		| @@ -138,8 +138,10 @@ def capture_remote(opts, args): | ||||
|     targ = args[0] | ||||
|     outdir = args[1] | ||||
|     os.umask(0o022) | ||||
|     if '/' not in outdir: | ||||
|         outdir = os.path.join('/var/lib/confluent/public/os/', outdir) | ||||
|     if '/' in outdir: | ||||
|         raise Exception('Full path not supported, supply only the profile name') | ||||
|     outdir = os.path.join('/var/lib/confluent/public/os/', outdir) | ||||
|     privdir = os.path.join('/var/lib/confluent/private/os/', outdir) | ||||
|     # need kernel, initramfs, shim, grub | ||||
|     # maybe break pack_image into three, one that is common to call | ||||
|     # with here locally, | ||||
| @@ -159,7 +161,12 @@ def capture_remote(opts, args): | ||||
|     utillib = os.path.join(utillib, '{}/dracut/'.format(oscat)) | ||||
|     subprocess.check_call(['rsync', '-a', utillib, '{0}:/usr/lib/dracut/modules.d/97confluent'.format(targ)]) | ||||
|     subprocess.check_call(['ssh', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocalboot']) | ||||
|     sys.stdout.write('Transferring image...') | ||||
|     sys.stdout.flush() | ||||
|     subprocess.check_call(['rsync', '-a', '{0}:/run/imgutil/capout/'.format(targ), outdir]) | ||||
|     subprocess.check_call(['rsync', '-a', '{0}:/run/imgutil/private.key'.format(targ), '{}/pending/rootimg.key'.format(privdir)]) | ||||
|     sys.stdout.write('Done\n') | ||||
|     sys.stdout.flush() | ||||
|     subprocess.check_call(['ssh', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocalcleanup']) | ||||
|     profname = os.path.basename(outdir) | ||||
|     os.symlink('/var/lib/confluent/public/site/initramfs.cpio', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user