Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lolli001 committed Jul 19, 2024
1 parent a88ed68 commit f843e5f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ export AWS_PROFILE=229685449397-csvd-dev-gov.inf-admin-t2

aws sts get-caller-identity

git push origin main --force
git push ansible-upstream main --force
git push goss-upstream main --force

rebecaa linn : She does x86 (get context for ARM)


cd ~/.aws/


rebecaa linn : She does x86 (get context for ARM)
3 changes: 2 additions & 1 deletion ansible/rhel-arm-baseline.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---

name: RHEL ARM Baseline
Expand Down Expand Up @@ -32,7 +33,7 @@ tasks:
state: present
groups: wheel
shell: /bin/bash
password: "{{ 'password' | password_hash('sha512') }}" # Need to change password here
password: "{{ 'password' | password_hash('sha512') }}" # Change 'password' to a secure password or hash

- name: Configure SSH for exampleuser
authorized_key:
Expand Down
16 changes: 7 additions & 9 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ phases:
runtime-versions:
python: 3.11
commands:
- echo "Installing dependencies..."
- pip install ansible boto3

- echo "Installing Python version 3.11 ...
- pyenv global $PYTHON_311_VERSION
- echo "Installing Ansible ..."
- pip3 install ansible
build:
commands:
- echo "Running Packer build..."
- packer build -var project_name=rhel-arm-image-pipeline-demo -var ansible_dir=${CODEBUILD_SRC_DIR_SourceAnsibleOutput} build.pkr.hcl

artifacts:
files:
- '**/*'
- echo "Building with Packer ..."
- packer init build.pkr.hcl
- packer build -var project_name=rhel-arm-image-pipeline-demo -var ansible_dir=${CODEBUILD_SRC_DIR}/ansible build.pkr.hcl
29 changes: 11 additions & 18 deletions modules/image-pipeline/build.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
packer {
required_plugins {
amazon = {
version = ">= 1.0.0"
source = "github.com/hashicorp/amazon"
}
ansible = {
version = ">= 1.0.0"
source = "github.com/hashicorp/ansible"
}
}
}

source "amazon-ebs" "rhel-arm" {
ami_name = "${var.project_name}-${timestamp()}"
source "amazon-ebs" "rhel" {
ami_name = "rhel-arm-{{timestamp}}"
instance_type = "t4g.micro"
region = "us-gov-west-1"
source_ami = "ami-0ce8fc041db68907c"
ssh_username = "ec2-user"
}

build {
sources = ["source.amazon-ebs.rhel-arm"]
sources = ["source.amazon-ebs.rhel"]

provisioner "ansible" {
playbook_file = "${var.ansible_dir}/rhel-arm-baseline.yaml"
playbook_file = "ansible/rhel-arm-baseline.yaml"
}
}

post-processor "shell-local" {
inline = [
"echo 'Build finished!'",
]
}
}

0 comments on commit f843e5f

Please sign in to comment.