Ansible playbook za instalaciju Nginx servera na Ubuntu kontejner
U prvom tasku smo ažurirali cache.
U drugom tasku smo instalirali zadnji nginx server preko apt modula.
U tečem tasku smo dodali Hello World file u nginx direktori iz kojeg vuče fajle
- hosts: svc_prodmachines
tasks:
- name: apt-get update
apt:
update_cache: yes
- name: install nginx
apt:
name: ['nginx']
state: latest
- name: copy index.html
ansible.builtin.copy:
src: ../files/index.html
dest: /var/www/html/