No Docker? No
Problem
Automating install and config management
with Ansible
Jeff Potts @jeffpotts01
I Docker
Not everyone is ready to run
Docker (and k8s) in production
Can our processes be highly
repeatable without Docker?
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
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
Configuring Alfresco
• Alfresco Global Properties
• Alfresco JMX RMI Password
• JVM Settings
• Tomcat server.xml
• Tomcat web.xml
• Slingshot Application Context
• Share Config Custom
• ActiveMQ ENV
• LDAP Configuration
• SOLR init script
• SOLR Shared Properties
• SOLR Config XML (Alfresco &
Archive)
• SOLR Core Properties (Alfresco &
Archive)
• SOLR SSL Certificates
• Alfresco SSL Certificates
• Proxy/Load-balancer Settings
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?
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
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”
Live Demo!
https://github.com/jpotts/ansible-alfresco
Let’s turn on SSL for ACS
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
• 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

No Docker? No Problem: Automating installation and config with Ansible

  • 1.
    No Docker? No Problem Automatinginstall and config management with Ansible Jeff Potts @jeffpotts01
  • 2.
  • 3.
    Not everyone isready to run Docker (and k8s) in production
  • 4.
    Can our processesbe highly repeatable without Docker?
  • 6.
    Ansible automates repetitivetasks • 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
  • 8.
    Installing Alfresco • Filehandles • 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
  • 9.
    Configuring Alfresco • AlfrescoGlobal Properties • Alfresco JMX RMI Password • JVM Settings • Tomcat server.xml • Tomcat web.xml • Slingshot Application Context • Share Config Custom • ActiveMQ ENV • LDAP Configuration • SOLR init script • SOLR Shared Properties • SOLR Config XML (Alfresco & Archive) • SOLR Core Properties (Alfresco & Archive) • SOLR SSL Certificates • Alfresco SSL Certificates • Proxy/Load-balancer Settings
  • 10.
    How do weguarantee 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. Createan 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 againstone 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”
  • 13.
  • 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 firmfocused 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

Editor's Notes

  • #3 I love Docker. Works great in my developer workflows…
  • #6 Open Source, commercial company owned by Red Hat. Easier learning curve than other tools. No agents to install on any machines. Only requires Python.
  • #8 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
  • #9 Not an exhaustive list. Ignores the all kinds of things like ancillary products, database, proxy and/or load-balancer for clusters
  • #10 Not exhaustive. Ignores the many subsystems you might have enabled as well as the various settings in alfresco-global.properties
  • #11 An Ansible setup deals with these issues
  • #12 I have an example you can refer to on GitHub at https://github.com/jpotts/ansible-alfresco
  • #14 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.