Skip to content

Latest commit

 

History

History

packer

AEM Compose Logo WTT Logo

Apache License, Version 2.0, January 2004

AEM Compose - Packer Example

Set up AEM instances on AWS EC2 with RHEL using AEM Compose Ansible Modules.

Packer tool used in this example allows to:

  • launch & terminate automatically machine for tests using skip_create_ami = true option.
  • allows to bake machine image when skip_create_ami = false

Example result

Packer Result

Prerequisites

  1. Install Docker 20.x or higher

  2. Build controller using command

    (cd ../controller && sh build.sh)
  3. Set up AWS environment variables

    export AWS_ACCESS_KEY_ID=xxx
    export AWS_SECRET_ACCESS_KEY=yyy
  4. Adjust AWS S3 bucket name and dir and upload AEM library files (aem-sdk.jar, cq-quickstart.jar, license.properties, etc)

    S3 Files Structure

Building

Running this command will launch AWS EC2 Machine, invoke Ansible playbook, then terminate machine.

Whole process takes for:

  • AEM classic 6.5.x (with SP installation): about 20-25 minutes,
  • AEM cloud 202x.yy: 10-15 minutes.
sh build.sh test classic
sh build.sh test cloud

To debug build process e.g do not terminate machine too quickly, run:

sh build.sh debug classic
sh build.sh debug cloud

Known issues

Mitogen

This project is using Ansible Mitogen which seriously improves Ansible execution time. However, Mitogen comes with a little trade-off. It's not being updated regularly and sticks to a particular, not always up-to-date Ansible version. In other words, Mitogen disallows to use of the most recent Ansible version so using it should be considered with care. But still, in most cases using it could be very valuable.

Disabling Mitogen

  1. Comment out line with strategy_plugins in ansible.cfg
  2. Comment out line strategy: mitogen_linear in playbook aem_single.yml