Closed kruton closed 2 weeks ago
umm, I tested this with the following cc:
#cloud-config
install:
grub_options:
extra_cmdline: rd.immucore.debug
poweroff: false
reboot: false
stages:
boot:
- files:
- content: "test\n"
group: 1000
owner: 1000
path: /run/bar
permissions: 511
name: BOOT STAGE TEST
initramfs:
- name: Set user and password
users:
kairos:
passwd: kairos
- hostname: kairos-{{ trunc 4 .Random }}
Installed, rebooted and I can see the file there:
kairos@kairos-xhwk:~$ stat /run/bar
File: /run/bar
Size: 25 Blocks: 8 IO Block: 4096 regular file
Device: 0,26 Inode: 2335 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1000/ ubuntu) Gid: ( 1000/ ubuntu)
Access: 2024-10-02 10:11:38.036511722 +0000
Modify: 2024-10-02 10:11:38.036511722 +0000
Change: 2024-10-02 10:11:38.036511722 +0000
Birth: 2024-10-02 10:11:38.036511722 +0000
kairos@kairos-xhwk:~$ cat /run/bar
test
And I can see the stage being run in the service:
Oct 02 10:11:38 kairos-xhwk kairos-agent[1695]: 2024-10-02T10:11:38Z INF Processing stage step ''. ( commands: 0, files: 0, ... )
Oct 02 10:11:38 kairos-xhwk kairos-agent[1695]: 2024-10-02T10:11:38Z INF Processing stage step 'BOOT STAGE TEST'. ( commands: 0, files: 1, ... )
Oct 02 10:11:38 kairos-xhwk kairos-agent[1695]: 2024-10-02T10:11:38Z INF Done executing stage 'boot'
And this is with an example from the examples docs you linked. The only things changed were to add a name to the stage so I could see it on the logs and setting the group/owner to 1000 so it picks up the default ubuntu user on my iso.
If you want us to solve this we will need:
journalctl -u cos-setup-boot
)Also can you confirm that this happens AFTER install, i.e. from an installed system? During installation (livecd/pxe) im not sure its possible for the boot service to read from the config_url as that is ingested after it has run, so it would be good to clear that the reproduction is as follow:
stages.boot
actions (create file, set hostname, whatever)Thanks!
I'm closing this since because it's stalled. Feel free to re-open if you have more information to help us reproduce.
Kairos version:
CPU architecture, OS, and Version:
Linux beta 6.8.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 13 13:35:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Describe the bug
After trying to use the examples that use PXE and cloud-init to provision a system, none of the steps in
stages: boot:
were being applied. If I rename the step toboot.after:
it will work.After a lot of digging through the code, it appears that Yip detects the "
#cloud-config
" line at the top of the file and transpiles fromcloudInit
style toyipYaml
which tries to merge thestages:
sections for boot. I'm not sure if this is a problem when the PXE install happens or after the installation occurs.To Reproduce
config_url=
set to that cloud-configExpected behavior
Installation should occur, reboot, and then apply steps from "stages: boot:"
Logs
Additional context
When the steps are renamed to "
boot.after
" this appears to work.