August 2017
Intermediate to advanced
332 pages
9h 16m
English
Finally, we can add the deployment configuration as a new play in the playbook.yml file.
- hosts: web2 become: yes become_method: sudo tasks: - name: ensure Java Runtime Environment is installed apt: name: default-jre state: present - name: create directory for Calculator file: path: /var/calculator state: directory - name: configure Calculator as a service file: path: /etc/init.d/calculator state: link force: yes src: /var/calculator/calculator.jar - name: copy Calculator copy: src: build/libs/calculator-0.0.1-SNAPSHOT.jar dest: /var/calculator/calculator.jar mode: a+x notify: - restart Calculator handlers: - name: restart Calculator service: name: calculator enabled: yes state: restarted
Let's ...
Read now
Unlock full access