{% if ansible_os_family == "Debian" %}
apt install nginx
{% elif ansible_os_family == "RedHat" %}
yum install nginx
{% endif %}
{% for user in users %}
- name: {{ user.name }}
uid: {{ user.uid }}
{% endfor %}
- name: Generate Nginx config
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
server {
listen {{ nginx_port | default(80) }};
server_name {{ server_name }};
root {{ web_root }};
}