mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-05 07:41:31 +00:00
add runcmd to copy autoinstall from user-data to /autoinstall.yaml
This commit is contained in:
parent
0dc12a1122
commit
c969c8e4b9
@ -116,3 +116,15 @@ system_info:
|
|||||||
primary: http://ports.ubuntu.com/ubuntu-ports
|
primary: http://ports.ubuntu.com/ubuntu-ports
|
||||||
security: http://ports.ubuntu.com/ubuntu-ports
|
security: http://ports.ubuntu.com/ubuntu-ports
|
||||||
ssh_svcname: ssh
|
ssh_svcname: ssh
|
||||||
|
|
||||||
|
runcmd:
|
||||||
|
- - "python3"
|
||||||
|
- "-c"
|
||||||
|
- |
|
||||||
|
import subprocess, sys, yaml
|
||||||
|
user_data = yaml.safe_load(subprocess.run([
|
||||||
|
"cloud-init", "query", "userdata"],
|
||||||
|
check=True, stdout=subprocess.PIPE, encoding='utf-8').stdout)
|
||||||
|
if 'autoinstall' in user_data:
|
||||||
|
with open("/autoinstall.yaml", "w") as fp:
|
||||||
|
yaml.dump(user_data['autoinstall'], fp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user