From 907f68a2cc1b57593d142469957b78a4a74648d5 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Wed, 14 Jun 2023 09:21:19 -0400 Subject: [PATCH 1/6] Update base AMI to Debian Bookworm Debian Bookworm was officially released on June 10,2023. --- src/packer.pkr.hcl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/packer.pkr.hcl b/src/packer.pkr.hcl index cce1c94..849c29d 100644 --- a/src/packer.pkr.hcl +++ b/src/packer.pkr.hcl @@ -63,9 +63,9 @@ variable "skip_create_ami" { type = bool } -data "amazon-ami" "debian_bullseye" { +data "amazon-ami" "debian_bookworm" { filters = { - name = "debian-11-amd64-*" + name = "debian-12-amd64-*" root-device-type = "ebs" virtualization-type = "hvm" } @@ -93,7 +93,7 @@ source "amazon-ebs" "example" { region = var.build_region region_kms_key_ids = var.region_kms_keys skip_create_ami = var.skip_create_ami - source_ami = data.amazon-ami.debian_bullseye.id + source_ami = data.amazon-ami.debian_bookworm.id ssh_username = "admin" subnet_filter { filters = { @@ -102,9 +102,9 @@ source "amazon-ebs" "example" { } tags = { Application = "Example" - Base_AMI_Name = data.amazon-ami.debian_bullseye.name + Base_AMI_Name = data.amazon-ami.debian_bookworm.name GitHub_Release_URL = var.release_url - OS_Version = "Debian Bullseye" + OS_Version = "Debian Bookworm" Pre_Release = var.is_prerelease Release = var.release_tag Team = "VM Fusion - Development" From 39e3d3102531e932c02d45d68b2b8dc8895f343e Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Fri, 12 Jan 2024 15:07:24 -0500 Subject: [PATCH 2/6] Add a playbook to install prerequisites for fixing a broken Netplan configuration See these issues for more information: - cisagov/skeleton-packer#300 - canonical/cloud-init#4764 --- src/fix-netplan-configuration.yml | 18 ++++++++++++++++++ src/playbook.yml | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 src/fix-netplan-configuration.yml diff --git a/src/fix-netplan-configuration.yml b/src/fix-netplan-configuration.yml new file mode 100644 index 0000000..1461335 --- /dev/null +++ b/src/fix-netplan-configuration.yml @@ -0,0 +1,18 @@ +--- +# Install the prerequisites for the user script that fixes the Netplan +# configuration generated by cloud-init from the instance metadata. +# +# See these issues for more details: +# - cisagov/skeleton-packer#300 +# - canonical/cloud-init#4764 +- hosts: all + name: >- + Install prerequisites for the script that fixes the Netplan + configuration generated by cloud-init from the instance metadata + become: true + become_method: ansible.builtin.sudo + tasks: + - name: Install python3-pyyaml + ansible.builtin.package: + name: + - python3-yaml diff --git a/src/playbook.yml b/src/playbook.yml index b1e5b7c..5197ff0 100644 --- a/src/playbook.yml +++ b/src/playbook.yml @@ -2,6 +2,9 @@ - name: Import base image playbook ansible.builtin.import_playbook: base.yml +- name: Import playbook to fix Netplan configuration + ansible.builtin.import_playbook: fix-netplan-configuration.yml + - name: Import AWS playbook ansible.builtin.import_playbook: aws.yml From 90277d71693eee1cd6f51a4eeb792007418ba908 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Fri, 12 Jan 2024 16:17:55 -0500 Subject: [PATCH 3/6] Rename playbook to better describe what it does Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com> Co-authored-by: dav3r --- ...install-prerequisites-for-netplan-configuration-fix.yml} | 0 src/playbook.yml | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename src/{fix-netplan-configuration.yml => install-prerequisites-for-netplan-configuration-fix.yml} (100%) diff --git a/src/fix-netplan-configuration.yml b/src/install-prerequisites-for-netplan-configuration-fix.yml similarity index 100% rename from src/fix-netplan-configuration.yml rename to src/install-prerequisites-for-netplan-configuration-fix.yml diff --git a/src/playbook.yml b/src/playbook.yml index 5197ff0..4f0d18f 100644 --- a/src/playbook.yml +++ b/src/playbook.yml @@ -2,8 +2,10 @@ - name: Import base image playbook ansible.builtin.import_playbook: base.yml -- name: Import playbook to fix Netplan configuration - ansible.builtin.import_playbook: fix-netplan-configuration.yml +- name: >- + Import playbook to install prerequisites for the Netplan + configuration fix + ansible.builtin.import_playbook: install-prerequisites-for-netplan-configuration-fix.yml - name: Import AWS playbook ansible.builtin.import_playbook: aws.yml From cf34d76fe28b7df6b5b12ae630854d71d6039786 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Sat, 13 Jan 2024 09:24:31 -0500 Subject: [PATCH 4/6] Add comments mentioning cisagov/skeleton-packer#301 These comments remind us to remove the code to fix up the Netplan configuration generated by cloud-init when and if that becomes possible. --- src/install-prerequisites-for-netplan-configuration-fix.yml | 3 +++ src/playbook.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/install-prerequisites-for-netplan-configuration-fix.yml b/src/install-prerequisites-for-netplan-configuration-fix.yml index 1461335..667e6f1 100644 --- a/src/install-prerequisites-for-netplan-configuration-fix.yml +++ b/src/install-prerequisites-for-netplan-configuration-fix.yml @@ -5,6 +5,9 @@ # See these issues for more details: # - cisagov/skeleton-packer#300 # - canonical/cloud-init#4764 +# +# TODO: Remove this playbook when and if that becomes possible. See +# cisagov/skeleton-packer#301 for more details. - hosts: all name: >- Install prerequisites for the script that fixes the Netplan diff --git a/src/playbook.yml b/src/playbook.yml index 4f0d18f..703a7de 100644 --- a/src/playbook.yml +++ b/src/playbook.yml @@ -2,6 +2,8 @@ - name: Import base image playbook ansible.builtin.import_playbook: base.yml +# TODO: Remove this when and if that becomes possible. See +# cisagov/skeleton-packer#301. - name: >- Import playbook to install prerequisites for the Netplan configuration fix From 341e7aff3880556f1bfb227767dcd7e31c019b18 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:39:46 -0500 Subject: [PATCH 5/6] Finalize version from 1.0.0-rc.2 to 1.0.0 --- src/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.txt b/src/version.txt index 1acb7e3..5becc17 100644 --- a/src/version.txt +++ b/src/version.txt @@ -1 +1 @@ -__version__ = "1.0.0-rc.2" +__version__ = "1.0.0" From 41cc1f96822ecf0cf708eace62ec3b314e76f72e Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:18:00 -0500 Subject: [PATCH 6/6] Reorder YAML keys to placate ansible-lint --- src/install-prerequisites-for-netplan-configuration-fix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/install-prerequisites-for-netplan-configuration-fix.yml b/src/install-prerequisites-for-netplan-configuration-fix.yml index 667e6f1..1c86cbc 100644 --- a/src/install-prerequisites-for-netplan-configuration-fix.yml +++ b/src/install-prerequisites-for-netplan-configuration-fix.yml @@ -8,10 +8,10 @@ # # TODO: Remove this playbook when and if that becomes possible. See # cisagov/skeleton-packer#301 for more details. -- hosts: all - name: >- +- name: >- Install prerequisites for the script that fixes the Netplan configuration generated by cloud-init from the instance metadata + hosts: all become: true become_method: ansible.builtin.sudo tasks: