Eureka Ansible Playbook and AMIs
Eureka is a service registry for resilient mid-tier load balancing and failover. Before running the playbook, there are a few things we need to do:
Launch EC2 instance for Eureka
- Create a Eureka security group
- Allow port 22 for SSH
- Allow port 80 for HTTP
If you don't already have one, create a new Key Pair, and add it to your keychain or SSH agent so you don't need to specify it later:
$ ssh-add mykey.pem
Launch a new EC2 instance using the above Security Group and key pair. This time, we will use Amazon Linux.
- Set the
Nametag of the instance to
- Confirm you can see the instance using the Ansible EC2 inventory
$ /etc/ansible/hosts | grep 'Eureka'
Run Ansible playbook
Now you can run the playbook
$ ansible-playbook playbooks/eureka-amazon-linux.yml -l 'tag_Name_Eureka'
This will configure the instance to be running the latest snapshot build of Eureka. If you prefer to build your own WAR file yourself, just specify the path to the WAR file:
$ ansible-playbook playbooks/eureka-amazon-linux.yml -l 'tag_Name_Eureka' -e "local_war=/path/to/eureka-server.war"
Once the playbook is finished, you will have Eureka Server running inside Tomcat on your EC2 instance. You can access it via HTTP. Example:
You can find the list of pre-built AMIs here:
This playbook does nothing for security. It is highly recommended that you put some kind of restrictions on who can access Eureka.
If you have feedback, comments or suggestions, please feel free to contact Peter at Answers for AWS, create an Issue, or submit a pull request.