5 source = "github.com/hashicorp/amazon"
10 variable "first_run_commands" {
11 description = "Commands to run before deployment via remote-exec"
18 variable "last_run_commands" {
19 description = "Commands to run after deployment via remote-exec"
22 "sudo sed -i 's/Unattended-Upgrade \"1\"/Unattended-Upgrade \"0\"/g' /etc/apt/apt.conf.d/20auto-upgrades"
26 variable "ansible_file_path" {
27 description = "Path to Ansible playbook"
29 default = "../../fdio.infra.ansible/site.yaml"
32 variable "ansible_python_executable" {
33 description = "Path to Python interpreter"
35 default = "/usr/bin/python3"
38 variable "ansible_topology_path" {
39 description = "Path to Ansible playbook which creates a topology file"
41 default = "../../fdio.infra.ansible/cloud_topology.yaml"
44 variable "ansible_provision_pwd" {
45 description = "Password used for ansible provisioning (ansible_ssh_pass)"
50 source "amazon-ebs" "csit_c5n_ubuntu_focal_sut" {
51 ami_name = "csit_c5n_ubuntu_focal_sut"
52 ami_description = "CSIT SUT image based on Ubuntu Focal"
54 instance_type = "c5n.4xlarge"
55 launch_block_device_mappings {
56 device_name = "/dev/sda1"
60 force_deregister = true
61 region = "eu-central-1"
62 skip_create_ami = false
63 source_ami = "ami-0a875db8a031a9efb"
64 ssh_username = "ubuntu"
67 source "amazon-ebs" "csit_c5n_ubuntu_focal_tg" {
68 ami_name = "csit_c5n_ubuntu_focal_tg"
69 ami_description = "CSIT TG image based on Ubuntu Focal"
71 instance_type = "c5n.4xlarge"
72 launch_block_device_mappings {
73 device_name = "/dev/sda1"
77 force_deregister = true
78 region = "eu-central-1"
79 skip_create_ami = false
80 source_ami = "ami-0a875db8a031a9efb"
81 ssh_username = "ubuntu"
85 name = "csit_c5n_ubuntu_focal_sut-packer"
87 "source.amazon-ebs.csit_c5n_ubuntu_focal_sut"
90 inline = var.first_run_commands
92 provisioner "ansible" {
93 playbook_file = var.ansible_file_path
97 "--extra-vars", "ansible_ssh_pass=${var.ansible_provision_pwd}",
98 "--extra-vars", "ansible_python_interpreter=${var.ansible_python_executable}",
99 "--extra-vars", "aws=true"
102 provisioner "shell" {
103 inline = var.last_run_commands
108 name = "csit_c5n_ubuntu_focal_tg-packer"
110 "source.amazon-ebs.csit_c5n_ubuntu_focal_tg"
112 provisioner "shell" {
113 inline = var.first_run_commands
115 provisioner "ansible" {
116 playbook_file = var.ansible_file_path
120 "--extra-vars", "ansible_ssh_pass=${var.ansible_provision_pwd}",
121 "--extra-vars", "ansible_python_interpreter=${var.ansible_python_executable}",
122 "--extra-vars", "aws=true"
125 provisioner "shell" {
126 inline = var.last_run_commands