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
-
Install Docker 20.x or higher
-
Build controller using command
(cd ../controller && sh build.sh)
-
Set up AWS environment variables
export AWS_ACCESS_KEY_ID=xxx export AWS_SECRET_ACCESS_KEY=yyy
-
Adjust AWS S3 bucket name and dir and upload AEM library files (aem-sdk.jar, cq-quickstart.jar, license.properties, etc)
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
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.
- Comment out line with
strategy_plugins
in ansible.cfg - Comment out line
strategy: mitogen_linear
in playbook aem_single.yml