March 22, 2020
Estimated Post Reading Time ~

Automate Adobe Experience Manager (AEM) with Ansible

Purpose
This document specifies the installation of adobe Experience Manager (AEM) on Linux machines using Ansible

Scope
This document only covers AEM installation on On-premise Linux machines.

AEM
Adobe Experience Manager (AEM) is a comprehensive content management solution for building websites and all of their complementary applications, including mobile apps, paperless forms, and online communities.

Manage Your Data More Effectively
AEM simplifies managing the complex environment using a variety of tools that integrate with each other and allow marketers to control all of these pieces from one place.

Ansible

Ansible is software that automates software provisioning, configuration management, and application deployment. Ansible’s main goals are simplicity and ease-of-use. It also has a strong focus on security and reliability, featuring a minimum of moving parts, usage of OpenSSH for transport (with an accelerated socket mode and pull modes as alternatives), and a language that is designed around auditability by humans–even those not familiar with the program.

Minimum requirements for AEM Installation
5 GB of RAM
2 GB of HDD
JDK SE 7, 8 or 9
Installation of AEM using Ansible requires two files
AEMInstallation.yaml
ModifyInstance.sh

Steps to be followed
1. Go to your Ansible directory and modify ‘hosts’ file and add your local Linux machine address(i.e: localhost)
2. Generate the SSH key and copy it to your local Linux machine.
3. Run the AEMInstallation.yaml file with root privileges.
AEMInstallation YAML file:
1. Specify the name of your Linux machine given in Ansible ‘hosts’ file.
2. Add the remote_user as ansible.
3. Become root user using sudo.
4. SSH into your Linux machine.
5. Create a task that installs java in your Linux machine using the yum tool.
6. Create a task that runs a shell command to unpack AEM files to your Linux machine.
7. Choose the directory of your choice where you want to unpack AEM files using chdir.
8. Now you can use a task to modify the AEM start file to configure your AEM instance.
9. ModifyInstance.sh shell script is called using script command.
10. Now a third task can be created which will run the start shell script in AEM crx-quickstart directory.

ModifyInstance shell script

1. Pass the port and runmode values in two variables.
2. Use the sed stream editor to modify the port and runmode values with the values passed in the previous two variables.
3. Specify the file in which the modification is to be made.

AEMInstallation.yaml
#AEM installation using Ansible
– hosts: local
remote_user: ansible
become: yes
become_method: sudo
connection: ssh
tasks:
– name: AEM unpack
shell: “java -jar /home/bhanu/AEM/aem-publish-p4503.jar -unpack”
args:
chdir: /home/bhanu/AEM
– name: AEM instance modification
script: /home/ansible/ansible/playbooks/modifyInstance.sh
– name: Run the AEM instance
command: “/home/bhanu/AEM/crx-quickstart/bin/start”
async: 1
poll: 0

ModifyInstance.sh

#!/bin/bash
port=4503
runmode=”‘publish'”
sed -i -e “s/\(CQ_PORT=\).*/\1$port/” \
-e “s/\(CQ_RUNMODE=\).*/\1$runmode/” \
/home/bhanu/AEM/crx-quickstart/bin/start

Ansible can be used for deployment of AEM on remote machines using with different configurations.Using Ansible make all this process run without much human intervention by automating the whole process.



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.