diff --git a/internal/config/config.go b/internal/config/config.go index 09befec..cb822d9 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -23,6 +23,7 @@ type Config = struct { HcloudRegion string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_REGION"` HcloudDatacenter string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_DATACENTER"` HcloudSSHKeys string `default:"" env:"WOODPECKER_AUTOSCALER_HCLOUD_SSH_KEYS"` + HcloudIPv6Only bool `default:"false" env:"WOODPECKER_AUTOSCALER_HCLOUD_IPV6_ONLY"` } func GenConfig() (cfg *Config, err error) { diff --git a/internal/hetzner/hetzneragent.go b/internal/hetzner/hetzneragent.go index 0521e40..264362b 100644 --- a/internal/hetzner/hetzneragent.go +++ b/internal/hetzner/hetzneragent.go @@ -94,7 +94,7 @@ func CreateNewAgent(cfg *config.Config) (*hcloud.Server, error) { } networkConf := hcloud.ServerCreatePublicNet{ - EnableIPv4: false, + EnableIPv4: !cfg.HcloudIPv6Only, EnableIPv6: true, }