Selenium grid deployment by CloudFormation+Ansible



  • Safari
  • Opera
  • Chrome
  • Firefox
  • IE


Deployment diagram

Deployment steps

CloudFormation Actions:

  • create instances (EC2 with proper role, security groups)
  • upload ansible playbooks to the EC2 from S3
  • update instances
  • deploy software using ansible
/usr/bin/ansible-playbook -i /opt/ansible/hosts /opt/ansible/docker.yml
  • create AWS ALB
  • create target groups and assign to the EC2
  • create Route53 record - Firefox Selenium Node - VNC port (default password is 'secret')

Ansible provisioning actions:

  • aws-asg-lb-status (checks Autoscaling group)
  • docker-config (configure docker service: enables socket, adds private docker registry)
  • portainer (deploys — WEB UI for docker cluster, creates docker swarm cluster)
  • selenium (deploys Selenuim Cluster)
  • selenium-debug (deploys Selenuim Node with VNC access)
  • docker-node-config (adds node to the Docker Cluster if it is new node)

Selenium cluster schema

WebDriver driver = new RemoteWebDriver(new URL(“"), capabilities);





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store