You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
623 B
YAML

2 years ago
---
- name: Install Nginx
apt:
name:
- nginx
state: present
#- name: "create www directory"
# file:
# path: /var/www/{{ domain }}
# state: directory
# mode: '0775'
# owner: "{{ ansible_user }}"
# group: "{{ ansible_user }}"
- name: delete default nginx site
file:
path: /etc/nginx/sites-enabled/default
state: absent
notify: restart nginx
- name: copy nginx site.conf
template:
src: templates/site.conf.j2
dest: /etc/nginx/sites-enabled/{{ domain }}
owner: root
group: root
mode: '0644'
notify: restart nginx