diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2bd14e1..f699509 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,4 +23,4 @@ jobs: run: "packer validate packer.pkr.hcl" - name: Validate ansible playbooks - uses: ansible/ansible-lint-action@main \ No newline at end of file + uses: ansible/ansible-lint-action@main diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f37233 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +init: + packer init packer.pkr.hcl + +test: init + packer validate packer.pkr.hcl + ansible-lint + +build: test + packer build packer.pkr.hcl + +all: build diff --git a/README.md b/README.md index 3acd259..c5577fc 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ # AWS-Baseimage -This repository contains the [Chef](https://www.chef.io/) cookbooks and the [Packer](https://www.packer.io/) configuration -to generate the AWS AMI, which we use at [codemonauts](https://codemonauts.com/) -to start our EC2 instances. +This repository contains the [Ansible](https://www.ansible.com/) cookbooks and the [Packer](https://www.packer.io/) configuration +to generate the AWS AMI, which we use at [codemonauts](https://codemonauts.com/) to start our EC2 instances. -If you find some problems or errors in this repositoy feel free to open an issue -or directly fix it with an pull request if you want to. +If you find some problems or errors in this repositoy feel free to open an issue or directly fix it with an pull request if you want to. ## Content As a basis we choose the latest Ubuntu LTS from the official AWS AMI store. On top of this we did the following for the **base** images: @@ -22,13 +20,12 @@ Additionaly on top for the **web** images: * Install PHP-FPM and some PHP Modules which are used by CraftCMS ## Images build by this repo -All images are public and available in eu-central-1 and eu-west-1. The *XXX* in the AMI name is the timestamp during build in the format `YYYY-MM-DD-hhmm` +All images are public and available in eu-central-1 and eu-west-1. The *XXX* in the AMI name is the timestamp during build in the format `YYYY-MM-DD-hh-mm`. **arm64** -* Ubuntu Focal, Base (codemonauts-arm-base-focal_XXX) -* Ubuntu Focal, Web with PHP 8.0 (codemonauts-arm-web-focal-php80_XXX) +* Ubuntu Jammy, Base (codemonauts-arm-base-jammy_XXX) +* Ubuntu Jammy, Web with PHP 8.3 (codemonauts-arm-web-jammy-php83_XXX) **amd64** -* Ubuntu Focal, Base (codemonauts-base-focal_XXX) -* Ubuntu Focal, Web with PHP 7.4 (codemonauts-web-focal-php74_XXX) -* Ubuntu Focal, Web with PHP 7.0 (codemonauts-web-focal-php70_XXX) +* Ubuntu Jammy, Base (codemonauts-base-jammy_XXX) +* Ubuntu Jammy, Web with PHP 7.4 (codemonauts-web-jammy-php74_XXX) diff --git a/packer.pkr.hcl b/packer.pkr.hcl index 7423612..0fcb92d 100644 --- a/packer.pkr.hcl +++ b/packer.pkr.hcl @@ -134,22 +134,22 @@ build { } } -# arm-web-jammy-82 -source "amazon-ebs" "arm64-web-jammy-php82" { +# arm-web-jammy-83 +source "amazon-ebs" "arm64-web-jammy-php83" { ami_groups = ["all"] - ami_name = "codemonauts-arm-web-jammy-php82_${formatdate("YYYY-MM-DD-hh-mm", timestamp())}" + ami_name = "codemonauts-arm-web-jammy-php83_${formatdate("YYYY-MM-DD-hh-mm", timestamp())}" ami_regions = ["eu-west-1"] instance_type = "t4g.micro" region = "eu-central-1" source_ami = "${data.amazon-ami.ubuntu-jammy-arm64.id}" ssh_username = "ubuntu" tags = { - Amazon_AMI_Management_Identifier = "arm64_web_jammy_82" + Amazon_AMI_Management_Identifier = "arm64_web_jammy_83" } } build { - name = "arm64-web-jammy-82" - sources = ["source.amazon-ebs.arm64-web-jammy-php82"] + name = "arm64-web-jammy-83" + sources = ["source.amazon-ebs.arm64-web-jammy-php83"] provisioner "shell" { inline = [ @@ -171,12 +171,12 @@ build { playbook_file = "webserver.yaml" extra_arguments = [ "-e", - "php_version=8.2" + "php_version=8.3" ] } post-processor "amazon-ami-management" { - identifier = "arm64_web_jammy_82" + identifier = "arm64_web_jammy_83" keep_releases = "3" regions = ["eu-central-1", "eu-west-1"] }