Automatically create file in CT

Bogdan.Klinowitzki

New Member
Nov 11, 2024
2
0
1
Hey, I'm fairly new here and have the following concern: I have a pre-built LXC from which others are cloned (quasi template). However, two additional files are needed that have different contents for each CT (same structure, but different variables that are needed for a script). Is it possible to create these files after cloning from the template LXC and fill them with appropriate information or to pack the files into the prefabricated LXC and then manage them with an API call after cloning and replace the placeholders? (or any other possibilities that I'm not aware of). The only important thing is that it can be automated, which is why I immediately thought about API calls, but my search in the documentation hasn't been that successful so far...

I initially thought of ../api2/json/nodes/{node}/execute, but couldn't test it until now because of 403 permission check failed (user is root@pam and API token was also created for root@pam. Others Requests like /lxc/{vmid}/clone, /lxc/{vmid}/status/start, /lxc/{vmid}/config etc.) work fine)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!