Skip to content

sanfoobar/windows-packer-build

Repository files navigation

Windows packer build

Example for creating a new windows AMI. Based on this example by hashi corp.

Installation

  1. Packer version 1.6.6

  2. Ansible version 2.9.6

    • The following ansible galaxy collections must be installed:

      ansible-galaxy collection install ansible.windows

      ansible-galaxy collection install chocolatey.chocolatey

  3. Your AWS credentials are configured with correct permissions for EC2

Creating a new server

Run build command:

packer build windows-server.pkr.hcl

This does the following:

  1. Find and lanuches a windows AMI
  2. Bootstrap EC2 with user-data. Our user-data is bootstrap_win.ps1
  3. Run our Ansible playbook the newly created EC2

About

Windows packer example with ansible and chocolatey

Topics

Resources

License

Stars

Watchers

Forks