{"id":19508953,"url":"https://github.com/rhythmictech/packer-generic-images","last_synced_at":"2025-10-29T03:01:56.087Z","repository":{"id":98716539,"uuid":"194132057","full_name":"rhythmictech/packer-generic-images","owner":"rhythmictech","description":"Generic Packer images starting with AWS","archived":false,"fork":false,"pushed_at":"2020-06-10T14:51:45.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-08T11:41:03.452Z","etag":null,"topics":["ami","ansible","builder","packer","packer-generic-images"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhythmictech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-27T16:50:04.000Z","updated_at":"2019-07-29T17:28:51.000Z","dependencies_parsed_at":"2023-05-24T21:45:42.551Z","dependency_job_id":null,"html_url":"https://github.com/rhythmictech/packer-generic-images","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fpacker-generic-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fpacker-generic-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fpacker-generic-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fpacker-generic-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhythmictech","download_url":"https://codeload.github.com/rhythmictech/packer-generic-images/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240761095,"owners_count":19853254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ami","ansible","builder","packer","packer-generic-images"],"created_at":"2024-11-10T23:10:27.140Z","updated_at":"2025-10-29T03:01:55.947Z","avatar_url":"https://github.com/rhythmictech.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# packer-generic-images\nGeneric Packer images starting with AWS\n\n## About \nGeneric [CIS-compliant](https://www.cisecurity.org/cis-benchmarks/) \nbase AMIs in three delicious flavours:\n- Ubuntu Bionic Beaver (v18)\n- Ubuntu Xenial (v16)\n- Amazon Linux 2 \n\n## Getting Started \n1. Install the [prerequisites](#prerequisites) from their website or using your package manager\n1. Add the approprate [user variables](#adding-user-variables) for your circumstance\n1. [Build the AMI](#build-the-ami) in your AWS account with `packer`\n\n### Prerequisites \n- [packer](https://packer.io/)\n- [ansible](https://www.ansible.com/)\n- [aws account](https://aws.amazon.com/)\n\n### Adding user variables \nThere are multiple ways of [authentication with the amazon builder](https://www.packer.io/docs/builders/amazon.html), \nany of which will work. \n\n### Build the AMI \nRunning the below command should produce like output (squashed for readability)\n```\n$ packer build packer.json\namazon-ebs output will be in this color.\n\n==\u003e amazon-ebs: Prevalidating AMI Name: packer_ubuntu_bionic_builder_1563903230\n    amazon-ebs: Found Image ID: ami-026c8acd92718196b\n==\u003e amazon-ebs: Creating temporary keypair: packer_5d3744ff-bb38-668c-6314-ba596b50b246\n==\u003e amazon-ebs: Creating temporary security group for this instance: packer_5d374501-704d-e9ab-ce0e-d61e85d7a198\n==\u003e amazon-ebs: Authorizing access to port 22 from [0.0.0.0/0] in the temporary security groups...\n==\u003e amazon-ebs: Launching a source AWS instance...\n\n...\n\n==\u003e Builds finished. The artifacts of successful builds are:\n--\u003e amazon-ebs: AMIs were created:\nus-east-1: ami-01308454f3364cf58\n\n\n```\n\nThe resulting ami (`ami-01308454f3364cf58` in this case) will be available in your aws account. \nThe default region set in this packer file is `us-east-1`.\n\n\nYou can also specify which images you'd like to build with the `-only` flag,\nusing the builder's `\"name\"` to specify which image to build. \n```\n# i.e. only build Ubuntu v16: \n$ packer build -only xenial-amazon-ebs packer.json\n```\n\n\n## Debugging known issues :heart:\n\nHere are some common errors and their work-arounds \n\n### `fatal: [default]: FAILED! =\u003e {\"changed\": false, \"msg\": \"yum lockfile is held by another process\"}`\nOccasionally ansible will get a little antsy and try to run one command before another has released it's hold on `yum`. \n\nThe work around is to\n- Just run it again (sometimes this will work)\n- Run it with the `-debug` flag. This will give the process time to release `yum`\n\n### `too many authentication failure. Disconnected`\nWhen Ansible connects to the instance Packer is using to build your AMI it uses SSH. \nBy default SSH tries offer all the SSH keys it is aware of. \nThe host will only accept so many failures untill it gets fed up and disallows your connection. \nRead more about [the specific issue with packer](https://github.com/hashicorp/packer/issues/5065) \nor the [more general issue with SSH](https://superuser.com/questions/187779/too-many-authentication-failures-for-username).\n\nThe work-around is to tell packer to tell ansible to only use the specified keys with an environmental variable. \nYou can run the below command: \n```\nANSIBLE_SSH_ARGS=\"-o IdentitiesOnly=yes\" packer build packer.json\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhythmictech%2Fpacker-generic-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhythmictech%2Fpacker-generic-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhythmictech%2Fpacker-generic-images/lists"}