aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2023-07-14 12:56:06 +0000
committerpmikus <peter.mikus@protonmail.ch>2023-07-14 12:56:06 +0000
commitf04617b817436dd45eca973c24455fb9c147b3f2 (patch)
tree6f849848077646899db1682a33944846410c259a
parent6cfd831b241b9711c8573364c9e59d0e9ec2cdad (diff)
fix(packer): Naming
Signed-off-by: pmikus <peter.mikus@protonmail.ch> Change-Id: I8127beeb6664aa51ef5cb313d658ab2e5638b581
-rw-r--r--fdio.infra.ansible/roles/aws/defaults/main.yaml9
-rw-r--r--fdio.infra.ansible/roles/aws/tasks/ubuntu_jammy.yaml6
-rw-r--r--fdio.infra.ansible/roles/iperf/defaults/main.yaml2
-rw-r--r--fdio.infra.ansible/roles/trex/defaults/main.yaml3
-rw-r--r--fdio.infra.terraform/terraform-aws-2n-c6gn/variables.tf2
-rw-r--r--fdio.infra/packer-aws-sut/ubuntu_jammy_arm.pkr.hcl60
-rw-r--r--fdio.infra/packer-aws-sut/ubuntu_jammy_x86.pkr.hcl16
-rw-r--r--resources/libraries/bash/function/ansible.sh6
8 files changed, 56 insertions, 48 deletions
diff --git a/fdio.infra.ansible/roles/aws/defaults/main.yaml b/fdio.infra.ansible/roles/aws/defaults/main.yaml
index e9701cd5ab..5b6978da51 100644
--- a/fdio.infra.ansible/roles/aws/defaults/main.yaml
+++ b/fdio.infra.ansible/roles/aws/defaults/main.yaml
@@ -1,8 +1,15 @@
---
-# file: roles/aws/defaults/main.yaml
+# file: defaults/main.yaml
packages: "{{ packages_base + packages_by_distro[ansible_distribution|lower] + packages_by_arch[ansible_machine] }}"
+packages_repo:
+ ubuntu:
+ aarch64:
+ "http://ports.ubuntu.com/"
+ x86_64:
+ "http://archive.ubuntu.com/ubuntu"
+
packages_base:
- []
diff --git a/fdio.infra.ansible/roles/aws/tasks/ubuntu_jammy.yaml b/fdio.infra.ansible/roles/aws/tasks/ubuntu_jammy.yaml
index 24da26d297..c589239f61 100644
--- a/fdio.infra.ansible/roles/aws/tasks/ubuntu_jammy.yaml
+++ b/fdio.infra.ansible/roles/aws/tasks/ubuntu_jammy.yaml
@@ -3,7 +3,7 @@
- name: Enable deb-src APT Repository
ansible.builtin.apt_repository:
- repo: "deb-src http://archive.ubuntu.com/ubuntu jammy main"
+ repo: "deb-src {{ packages_repo[ansible_distribution|lower][ansible_machine] }} jammy main"
state: "present"
update_cache: true
tags:
@@ -11,7 +11,7 @@
- name: Enable deb APT Repository Focal
ansible.builtin.apt_repository:
- repo: "deb http://archive.ubuntu.com/ubuntu focal main"
+ repo: "deb {{ packages_repo[ansible_distribution|lower][ansible_machine] }} focal main"
state: "present"
update_cache: true
tags:
@@ -19,7 +19,7 @@
- name: Enable deb-src APT Repository Focal Src
ansible.builtin.apt_repository:
- repo: "deb-src http://archive.ubuntu.com/ubuntu focal main"
+ repo: "deb-src {{ packages_repo[ansible_distribution|lower][ansible_machine] }} focal main"
state: "present"
update_cache: true
tags:
diff --git a/fdio.infra.ansible/roles/iperf/defaults/main.yaml b/fdio.infra.ansible/roles/iperf/defaults/main.yaml
index 72a3604d1d..f757b287b7 100644
--- a/fdio.infra.ansible/roles/iperf/defaults/main.yaml
+++ b/fdio.infra.ansible/roles/iperf/defaults/main.yaml
@@ -10,7 +10,7 @@ packages_by_distro:
ubuntu:
jammy:
- "build-essential"
- - "lib32z1"
+ #- "lib32z1"
packages_by_arch:
aarch64:
diff --git a/fdio.infra.ansible/roles/trex/defaults/main.yaml b/fdio.infra.ansible/roles/trex/defaults/main.yaml
index 18a2b56bda..ad7a5762f7 100644
--- a/fdio.infra.ansible/roles/trex/defaults/main.yaml
+++ b/fdio.infra.ansible/roles/trex/defaults/main.yaml
@@ -23,7 +23,8 @@ packages_by_distro:
packages_by_arch:
aarch64:
- - []
+ - "libibverbs-dev"
+ - "libibverbs1"
x86_64:
- []
diff --git a/fdio.infra.terraform/terraform-aws-2n-c6gn/variables.tf b/fdio.infra.terraform/terraform-aws-2n-c6gn/variables.tf
index 329373a9f3..edad0c261a 100644
--- a/fdio.infra.terraform/terraform-aws-2n-c6gn/variables.tf
+++ b/fdio.infra.terraform/terraform-aws-2n-c6gn/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-05ea90e57d2df4368"
+ default = "ami-0cebabdc14ee56909"
}
variable "sut1_associate_public_ip_address" {
diff --git a/fdio.infra/packer-aws-sut/ubuntu_jammy_arm.pkr.hcl b/fdio.infra/packer-aws-sut/ubuntu_jammy_arm.pkr.hcl
index 6e612f1fc4..e46814c1c5 100644
--- a/fdio.infra/packer-aws-sut/ubuntu_jammy_arm.pkr.hcl
+++ b/fdio.infra/packer-aws-sut/ubuntu_jammy_arm.pkr.hcl
@@ -47,8 +47,8 @@ variable "ansible_provision_pwd" {
default = "Csit1234"
}
-source "amazon-ebs" "csit_c6gn_ubuntu_jammy_sut" {
- ami_name = "csit_c6gn_ubuntu_jammy_sut"
+source "amazon-ebs" "csit_ubuntu_jammy_arm_sut" {
+ ami_name = "csit_ubuntu_jammy_arm_sut"
ami_description = "CSIT SUT image based on Ubuntu jammy"
ena_support = true
instance_type = "c6gn.4xlarge"
@@ -60,12 +60,12 @@ source "amazon-ebs" "csit_c6gn_ubuntu_jammy_sut" {
force_deregister = true
region = "eu-central-1"
skip_create_ami = false
- source_ami = "ami-0a875db8a031a9efb"
+ source_ami = "ami-0329d3839379bfd15"
ssh_username = "ubuntu"
}
-source "amazon-ebs" "csit_c6gn_ubuntu_jammy_tg" {
- ami_name = "csit_c6gn_ubuntu_jammy_tg"
+source "amazon-ebs" "csit_ubuntu_jammy_arm_tg" {
+ ami_name = "csit_ubuntu_jammy_arm_tg"
ami_description = "CSIT TG image based on Ubuntu jammy"
ena_support = true
instance_type = "c6gn.4xlarge"
@@ -77,37 +77,37 @@ source "amazon-ebs" "csit_c6gn_ubuntu_jammy_tg" {
force_deregister = true
region = "eu-central-1"
skip_create_ami = false
- source_ami = "ami-0a875db8a031a9efb"
+ source_ami = "ami-0329d3839379bfd15"
ssh_username = "ubuntu"
}
-build {
- name = "csit_c6gn_ubuntu_jammy_sut-packer"
- sources = [
- "source.amazon-ebs.csit_c6gn_ubuntu_jammy_sut"
- ]
- provisioner "shell" {
- inline = var.first_run_commands
- }
- provisioner "ansible" {
- playbook_file = var.ansible_file_path
- user = "ubuntu"
- groups = ["sut_aws"]
- extra_arguments = [
- "--extra-vars", "ansible_ssh_pass=${var.ansible_provision_pwd}",
- "--extra-vars", "ansible_python_interpreter=${var.ansible_python_executable}",
- "--extra-vars", "aws=true"
- ]
- }
- provisioner "shell" {
- inline = var.last_run_commands
- }
-}
+#build {
+# name = "csit_ubuntu_jammy_arm_sut-packer"
+# sources = [
+# "source.amazon-ebs.csit_ubuntu_jammy_arm_sut"
+# ]
+# provisioner "shell" {
+# inline = var.first_run_commands
+# }
+# provisioner "ansible" {
+# playbook_file = var.ansible_file_path
+# user = "ubuntu"
+# groups = ["sut_aws"]
+# extra_arguments = [
+# "--extra-vars", "ansible_ssh_pass=${var.ansible_provision_pwd}",
+# "--extra-vars", "ansible_python_interpreter=${var.ansible_python_executable}",
+# "--extra-vars", "aws=true"
+# ]
+# }
+# provisioner "shell" {
+# inline = var.last_run_commands
+# }
+#}
build {
- name = "csit_c6gn_ubuntu_jammy_tg-packer"
+ name = "csit_ubuntu_jammy_arm_tg-packer"
sources = [
- "source.amazon-ebs.csit_c6gn_ubuntu_jammy_tg"
+ "source.amazon-ebs.csit_ubuntu_jammy_arm_tg"
]
provisioner "shell" {
inline = var.first_run_commands
diff --git a/fdio.infra/packer-aws-sut/ubuntu_jammy_x86.pkr.hcl b/fdio.infra/packer-aws-sut/ubuntu_jammy_x86.pkr.hcl
index 376e1c324f..7293d176e0 100644
--- a/fdio.infra/packer-aws-sut/ubuntu_jammy_x86.pkr.hcl
+++ b/fdio.infra/packer-aws-sut/ubuntu_jammy_x86.pkr.hcl
@@ -47,8 +47,8 @@ variable "ansible_provision_pwd" {
default = "Csit1234"
}
-source "amazon-ebs" "csit_c5n_ubuntu_jammy_sut" {
- ami_name = "csit_c5n_ubuntu_jammy_sut"
+source "amazon-ebs" "csit_ubuntu_jammy_x86_sut" {
+ ami_name = "csit_ubuntu_jammy_x86_sut"
ami_description = "CSIT SUT image based on Ubuntu Jammy"
ena_support = true
instance_type = "c5n.4xlarge"
@@ -64,8 +64,8 @@ source "amazon-ebs" "csit_c5n_ubuntu_jammy_sut" {
ssh_username = "ubuntu"
}
-source "amazon-ebs" "csit_c5n_ubuntu_jammy_tg" {
- ami_name = "csit_c5n_ubuntu_jammy_tg"
+source "amazon-ebs" "csit_ubuntu_jammy_x86_tg" {
+ ami_name = "csit_ubuntu_jammy_x86_tg"
ami_description = "CSIT TG image based on Ubuntu Jammy"
ena_support = true
instance_type = "c5n.4xlarge"
@@ -82,9 +82,9 @@ source "amazon-ebs" "csit_c5n_ubuntu_jammy_tg" {
}
build {
- name = "csit_c5n_ubuntu_jammy_sut-packer"
+ name = "csit_ubuntu_jammy_x86_sut-packer"
sources = [
- "source.amazon-ebs.csit_c5n_ubuntu_jammy_sut"
+ "source.amazon-ebs.csit_ubuntu_jammy_x86_sut"
]
provisioner "shell" {
inline = var.first_run_commands
@@ -105,9 +105,9 @@ build {
}
build {
- name = "csit_c5n_ubuntu_jammy_tg-packer"
+ name = "csit_ubuntu_jammy_x86_tg-packer"
sources = [
- "source.amazon-ebs.csit_c5n_ubuntu_jammy_tg"
+ "source.amazon-ebs.csit_ubuntu_jammy_x86_tg"
]
provisioner "shell" {
inline = var.first_run_commands
diff --git a/resources/libraries/bash/function/ansible.sh b/resources/libraries/bash/function/ansible.sh
index 64508bda11..a46c782cc0 100644
--- a/resources/libraries/bash/function/ansible.sh
+++ b/resources/libraries/bash/function/ansible.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2023 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -28,7 +28,7 @@ function ansible_adhoc () {
set -exuo pipefail
case "$FLAVOR" in
- "aws")
+ "aws" | "c6in" | "c6gn")
INVENTORY_PATH="cloud_inventory"
;;
*)
@@ -70,7 +70,7 @@ function ansible_playbook () {
set -exuo pipefail
case "$FLAVOR" in
- "aws")
+ "aws" | "c6in" | "c6gn")
INVENTORY_PATH="cloud_inventory"
;;
*)