Deployment with Ansible
We have covered the most fundamental features of Ansible. Now, let's forget, just for a little while, about Docker, Kubernetes, and most of the things we've learned so far. Let's configure a complete deployment step by only using Ansible. We will run the calculator service on one server and the Hazelcast service on the second server.
Installing Hazelcast
We can specify a play in the new playbook. Let's create the playbook.yml
file, with the following content:
--- - hosts: web1 become: yes become_method: sudo tasks: - name: ensure Java Runtime Environment is installed apt: name: default-jre state: present update_cache: yes - name: create Hazelcast directory file: ...