diff --git a/examples/terraform/aws/variables.tf b/examples/terraform/aws/variables.tf index e347d5af4..00394fd64 100644 --- a/examples/terraform/aws/variables.tf +++ b/examples/terraform/aws/variables.tf @@ -26,6 +26,7 @@ variable "worker_os" { # * centos # * flatcar # * rhel + # * amzn2 default = "" } @@ -104,6 +105,7 @@ variable "os" { # * centos # * rhel # * flatcar + # * amzn2 default = "ubuntu" } @@ -135,7 +137,7 @@ variable "ami_filters" { image_name = ["RHEL-8*_HVM-*-x86_64-*"] } - amazon_linux2 = { + amzn2 = { owners = ["137112412989"] # Amazon image_name = ["amzn2-ami-hvm-2.0.*-x86_64-gp2"] } diff --git a/pkg/scripts/os.go b/pkg/scripts/os.go index 0a4468533..155d8d0ec 100644 --- a/pkg/scripts/os.go +++ b/pkg/scripts/os.go @@ -16,698 +16,7 @@ limitations under the License. package scripts -import ( - "k8c.io/kubeone/pkg/apis/kubeone" -) - const ( defaultKubernetesCNIVersion = "0.8.7" defaultCriToolsVersion = "1.21.0" ) - -const ( - kubeadmDebianTemplate = ` -sudo swapoff -a -sudo sed -i '/.*swap.*/d' /etc/fstab -sudo systemctl disable --now ufw || true - -source /etc/kubeone/proxy-env - -{{ template "sysctl-k8s" }} -{{ template "journald-config" }} - -sudo mkdir -p /etc/apt/apt.conf.d -cat < /tmp/yum.conf || true -echo -n "${yum_proxy}" >> /tmp/yum.conf -sudo mv /tmp/yum.conf /etc/yum.conf - -{{ if .CONFIGURE_REPOSITORIES }} -cat < /tmp/yum.conf || true -echo -n "${yum_proxy}" >> /tmp/yum.conf -sudo mv /tmp/yum.conf /etc/yum.conf - -{{ if .CONFIGURE_REPOSITORIES }} -cat < /tmp/yum.conf || true +echo -n "${yum_proxy}" >> /tmp/yum.conf +sudo mv /tmp/yum.conf /etc/yum.conf + +{{ if .CONFIGURE_REPOSITORIES }} +cat < /tmp/yum.conf || true +echo -n "${yum_proxy}" >> /tmp/yum.conf +sudo mv /tmp/yum.conf /etc/yum.conf + +{{ if .CONFIGURE_REPOSITORIES }} +cat <