diff options
7 files changed, 60 insertions, 34 deletions
diff --git a/fdio.infra.ansible/roles/aws/tasks/main.yaml b/fdio.infra.ansible/roles/aws/tasks/main.yaml index 47b8c10135..d6304f8bc7 100644 --- a/fdio.infra.ansible/roles/aws/tasks/main.yaml +++ b/fdio.infra.ansible/roles/aws/tasks/main.yaml @@ -79,6 +79,14 @@ tags: - conf-ssh +- name: "Enable Password Less sudo" + ansible.builtin.lineinfile: + dest: "/etc/ssh/sshd_config" + regexp: "^#PermitRootLogin prohibit-password" + line: "PermitRootLogin yes" + tags: + - conf-ssh + - name: "Recursively Delete Other Configs" ansible.builtin.file: path: "/etc/ssh/sshd_config.d" @@ -170,3 +178,12 @@ validate: "/usr/sbin/visudo -cf %s" tags: - aws-sudoers + +- name: "sudoers nopasswd" + ansible.builtin.lineinfile: + path: "/etc/sudoers" + state: "present" + line: "%testuser ALL=(ALL) NOPASSWD: ALL" + validate: "/usr/sbin/visudo -cf %s" + tags: + - aws-sudoers
\ No newline at end of file diff --git a/fdio.infra.terraform/terraform-aws-1n-aws-c5n/variables.tf b/fdio.infra.terraform/terraform-aws-1n-aws-c5n/variables.tf index 5016b935e2..7b054d5aa4 100644 --- a/fdio.infra.terraform/terraform-aws-1n-aws-c5n/variables.tf +++ b/fdio.infra.terraform/terraform-aws-1n-aws-c5n/variables.tf @@ -38,7 +38,7 @@ variable "placement_group_strategy" { variable "tg_ami" { description = "AMI to use for the instance." type = string - default = "ami-0c18f927fc6ac6c52" + default = "ami-04f5fbbd9880e691a" } variable "tg_associate_public_ip_address" { diff --git a/fdio.infra.terraform/terraform-aws-1n-c6in/variables.tf b/fdio.infra.terraform/terraform-aws-1n-c6in/variables.tf index f9cd5bc2ed..efdbe912e2 100644 --- a/fdio.infra.terraform/terraform-aws-1n-c6in/variables.tf +++ b/fdio.infra.terraform/terraform-aws-1n-c6in/variables.tf @@ -38,7 +38,7 @@ variable "placement_group_strategy" { variable "tg_ami" { description = "AMI to use for the instance." type = string - default = "ami-0c18f927fc6ac6c52" + default = "ami-04f5fbbd9880e691a" } variable "tg_associate_public_ip_address" { diff --git a/fdio.infra.terraform/terraform-aws-2n-aws-c5n/variables.tf b/fdio.infra.terraform/terraform-aws-2n-aws-c5n/variables.tf index 096299757a..a498645df9 100644 --- a/fdio.infra.terraform/terraform-aws-2n-aws-c5n/variables.tf +++ b/fdio.infra.terraform/terraform-aws-2n-aws-c5n/variables.tf @@ -38,7 +38,7 @@ variable "placement_group_strategy" { variable "tg_ami" { description = "AMI to use for the instance." type = string - default = "ami-0c18f927fc6ac6c52" + default = "ami-04f5fbbd9880e691a" } variable "tg_associate_public_ip_address" { @@ -74,7 +74,7 @@ variable "tg_source_dest_check" { variable "sut1_ami" { description = "AMI to use for the instance." type = string - default = "ami-0269b92e0a5932902" + default = "ami-01d325fa583a17daa" } variable "sut1_associate_public_ip_address" { diff --git a/fdio.infra.terraform/terraform-aws-2n-c6in/variables.tf b/fdio.infra.terraform/terraform-aws-2n-c6in/variables.tf index 9f14b5b4d3..b901fca8d9 100644 --- a/fdio.infra.terraform/terraform-aws-2n-c6in/variables.tf +++ b/fdio.infra.terraform/terraform-aws-2n-c6in/variables.tf @@ -86,7 +86,7 @@ variable "tg_source_dest_check" { variable "sut1_ami" { description = "AMI to use for the instance." type = string - default = "ami-0269b92e0a5932902" + default = "ami-01d325fa583a17daa" } variable "sut1_associate_public_ip_address" { diff --git a/fdio.infra.terraform/terraform-aws-2n-c7gn/variables.tf b/fdio.infra.terraform/terraform-aws-2n-c7gn/variables.tf index 1bdb701c8a..0cc9252c68 100644 --- a/fdio.infra.terraform/terraform-aws-2n-c7gn/variables.tf +++ b/fdio.infra.terraform/terraform-aws-2n-c7gn/variables.tf @@ -38,7 +38,7 @@ variable "placement_group_strategy" { variable "tg_ami" { description = "AMI to use for the instance." type = string - default = "ami-0c18f927fc6ac6c52" + default = "ami-04f5fbbd9880e691a" } variable "tg_associate_public_ip_address" { diff --git a/fdio.infra/packer-aws-sut/ubuntu_noble_x86.pkr.hcl b/fdio.infra/packer-aws-sut/ubuntu_noble_x86.pkr.hcl index 93e6d08a8c..a9e0dc7dfb 100644 --- a/fdio.infra/packer-aws-sut/ubuntu_noble_x86.pkr.hcl +++ b/fdio.infra/packer-aws-sut/ubuntu_noble_x86.pkr.hcl @@ -15,7 +15,7 @@ variable "first_run_commands" { ] } -variable "last_run_commands" { +variable "last_run_commands_sut" { description = "Commands to run after deployment via remote-exec" type = list(string) default = [ @@ -23,6 +23,15 @@ variable "last_run_commands" { ] } +variable "last_run_commands_tg" { + description = "Commands to run after deployment via remote-exec" + type = list(string) + default = [ + "sudo sed -i 's/Unattended-Upgrade \"1\"/Unattended-Upgrade \"0\"/g' /etc/apt/apt.conf.d/20auto-upgrades", + "sudo systemctl start csit-initialize-docker-tg.service" + ] +} + variable "ansible_file_path" { description = "Path to Ansible playbook" type = string @@ -51,7 +60,7 @@ source "amazon-ebs" "csit_ubuntu_noble_x86_sut" { ami_name = "csit_ubuntu_noble_x86_sut" ami_description = "CSIT SUT image based on Ubuntu noble" ena_support = true - instance_type = "c5n.4xlarge" + instance_type = "c6in.4xlarge" launch_block_device_mappings { device_name = "/dev/sda1" volume_size = 40 @@ -62,14 +71,14 @@ source "amazon-ebs" "csit_ubuntu_noble_x86_sut" { skip_create_ami = false source_ami = "ami-0084a47cc718c111a" ssh_username = "ubuntu" - ssh_timeout = "30m" + ssh_timeout = "60m" } source "amazon-ebs" "csit_ubuntu_noble_x86_tg" { ami_name = "csit_ubuntu_noble_x86_tg" ami_description = "CSIT TG image based on Ubuntu noble" ena_support = true - instance_type = "c5n.4xlarge" + instance_type = "c6in.4xlarge" launch_block_device_mappings { device_name = "/dev/sda1" volume_size = 40 @@ -80,31 +89,31 @@ source "amazon-ebs" "csit_ubuntu_noble_x86_tg" { skip_create_ami = false source_ami = "ami-0084a47cc718c111a" ssh_username = "ubuntu" - ssh_timeout = "30m" + ssh_timeout = "60m" } -#build { -# name = "csit_ubuntu_noble_x86_sut-packer" -# sources = [ -# "source.amazon-ebs.csit_ubuntu_noble_x86_sut" -# ] -# provisioner "shell" { -# inline = var.first_run_commands -# } -# provisioner "ansible" { -# playbook_file = var.ansible_file_path -# user = "ubuntu" -# use_proxy = false -# groups = ["sut_aws"] -# extra_arguments = [ -# "--extra-vars", "ansible_ssh_pass=${var.ansible_provision_pwd}", -# "--extra-vars", "aws=true" -# ] -# } -# provisioner "shell" { -# inline = var.last_run_commands -# } -#} +build { + name = "csit_ubuntu_noble_x86_sut-packer" + sources = [ + "source.amazon-ebs.csit_ubuntu_noble_x86_sut" + ] + provisioner "shell" { + inline = var.first_run_commands + } + provisioner "ansible" { + playbook_file = var.ansible_file_path + user = "ubuntu" + use_proxy = false + groups = ["sut_aws"] + extra_arguments = [ + "--extra-vars", "ansible_ssh_pass=${var.ansible_provision_pwd}", + "--extra-vars", "aws=true" + ] + } + provisioner "shell" { + inline = var.last_run_commands_sut + } +} build { name = "csit_ubuntu_noble_x86_tg-packer" @@ -126,6 +135,6 @@ build { ] } provisioner "shell" { - inline = var.last_run_commands + inline = var.last_run_commands_tg } } |