22 lines
511 B
YAML
22 lines
511 B
YAML
---
|
|
- name: Install nginx
|
|
ansible.builtin.apt:
|
|
name: nginx
|
|
state: present
|
|
|
|
- name: Ensure nginx is running and enabled
|
|
ansible.builtin.service:
|
|
name: nginx
|
|
state: started
|
|
enabled: true
|
|
|
|
# TODO: template out vhosts from the `nginx_sites` var defined in
|
|
# group_vars/webservers.yml, e.g.:
|
|
#
|
|
# - name: Deploy vhost configs
|
|
# ansible.builtin.template:
|
|
# src: vhost.conf.j2
|
|
# dest: "/etc/nginx/sites-available/{{ item.name }}"
|
|
# loop: "{{ nginx_sites }}"
|
|
# notify: Reload nginx
|