add userdata options to allow disabling package updates during boot / cloud-init
This commit is contained in:
parent
37c8af0fb1
commit
535c875eb8
2 changed files with 13 additions and 0 deletions
|
|
@ -216,6 +216,13 @@ type BootstrapInstance struct {
|
|||
|
||||
// PoolID is the ID of the garm pool to which this runner belongs.
|
||||
PoolID string `json:"pool_id"`
|
||||
|
||||
// UserDataOptions are the options for the user data generation.
|
||||
UserDataOptions UserDataOptions `json:"user_data_options"`
|
||||
}
|
||||
|
||||
type UserDataOptions struct {
|
||||
DisableUpdatesOnBoot bool `json:"disable_updates_on_boot"`
|
||||
}
|
||||
|
||||
type Tag struct {
|
||||
|
|
|
|||
|
|
@ -266,6 +266,12 @@ func GetCloudConfig(bootstrapParams params.BootstrapInstance, tools github.Runne
|
|||
switch bootstrapParams.OSType {
|
||||
case params.Linux:
|
||||
cloudCfg := cloudconfig.NewDefaultCloudInitConfig()
|
||||
|
||||
if bootstrapParams.UserDataOptions.DisableUpdatesOnBoot {
|
||||
cloudCfg.PackageUpgrade = false
|
||||
cloudCfg.Packages = []string{}
|
||||
}
|
||||
|
||||
cloudCfg.AddSSHKey(bootstrapParams.SSHKeys...)
|
||||
cloudCfg.AddFile(installScript, "/install_runner.sh", "root:root", "755")
|
||||
cloudCfg.AddRunCmd("/install_runner.sh")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue