In this talk I show how to bring stability and repeatability to your Alfresco installation by automating install and config management with Ansible.
This talk was originally given at Alfresco DevCon 2020 (virtual edition).
6. Ansible automates repetitive tasks
• In a nutshell:
• Ansible pushes and runs modules on remote machines
• Copy a file
• Install a package
• Create a user
• Ansible knows about the machines in your stack and the roles they play
• Forgiving learning curve
• No agents to install…Python is the only requirement
• Lots of helpful documentation at https://docs.ansible.com
7.
8. Installing Alfresco
• File handles
• Java, LibreOffice, Image Magick
• Apache Tomcat
• Alfresco WAR, Share WAR, VTI_BIN WAR
• Alfresco MMT JAR and Scripts
• AOS and Shared Services AMPs
• Custom and/or Third-Party AMPs
• Apache ActiveMQ
• Alfresco PDF Renderer
• Alfresco Search Services
x Number of
Environments
= Lots of work,
potential for
inconsistency
x Number of
Servers in the
Cluster
10. How do we guarantee that the configuration is the same on every
server in our cluster?
How do we handle configuration differences between environments?
What if we wanted to rollback to last month’s configuration?
How can we enable an ops team, unfamiliar with Alfresco, to
manage all of this?
11. Implementation Steps
1. Create an Ansible inventory file
2. Create Ansible playbooks
• Install Alfresco (and dependencies)
• Install SOLR
• Copy configuration
3. Create Ansible templates for non-static config files
• E.g., alfresco-global.properties
4. Use Ansible group variables to control settings by environment
5. Put everything in source code control
12. Run playbooks against one or more
environments
• Install/Upgrade Alfresco Content Services
ansible-playbook installAlfresco.yml --extra-
vars=“hosts=alfresco_dev”
• Copy Alfresco configuration
ansible-playbook copyAllAlfrescoConfig.yml --extra-
vars=“hosts=alfresco_dev:alfresco_test:alfresco_prod”
• Install/Upgrade Alfresco Search Services
ansible-playbook installSearch.yml --extra-
vars=“hosts=solr_dev”
• Copy Alfresco Search Services configuration
ansible-playbook copySolrCoreConfig.yml --extra-
vars=“hosts=solr_dev”
14. Tips & Tricks
• Stop editing files on the server—do it locally, then push with Ansible
• Playbooks should be idempotent
• Use Ansible Vault to encrypt sensitive variables
• Create an Ansible module that downloads installers, AMPs
• Use local Vagrant boxes to test playbooks
• Use --diff and --check to validate environments
• Git branch workflows are helpful
• Example: Prepare for upgrades on a release branch
15. • Consulting firm focused on solving business problems with open source
Content Management, Workflow, & Search technology
• Founded in 2010
• Clients all over the world in a variety of industries, including:
• Airlines & Aerospace
• Manufacturing
• Construction
• Financial Services
• Higher Education
• Life Sciences
• Professional Services
https://www.metaversant.com
Notes de l'éditeur
I love Docker. Works great in my developer workflows…
Open Source, commercial company owned by Red Hat. Easier learning curve than other tools. No agents to install on any machines. Only requires Python.
Starting with 6.0, Alfresco ships Docker containers. Or install manually from a zip. But there is no more installer.
Even in earlier versions, many people disliked the installer anyway, opting instead for manual or scripted installs.
Use Ansible to automate Alfresco install and to manage config for any Alfresco version, community or Enterprise, on-prem or in the cloud.
1 server or 10 servers, it does not matter
Not an exhaustive list. Ignores the all kinds of things like ancillary products, database, proxy and/or load-balancer for clusters
Not exhaustive. Ignores the many subsystems you might have enabled as well as the various settings in alfresco-global.properties
An Ansible setup deals with these issues
I have an example you can refer to on GitHub at https://github.com/jpotts/ansible-alfresco
Inventory, playbook, task, all/vars, alfresco_dev/vars, SWITCH branch to enable-ssl, run playbook
Sample code includes playbooks to install ACS & search as well as to copy config.
Demo just shows a small example.