useful-scripts-helpdesk/playbook.yml

38 lines
754 B
YAML
Raw Normal View History

---
- hosts: localhost
connection: local
tasks:
- name: Install nginx
become: yes
apt:
name: nginx-light
update_cache: yes
state: latest
- name: Create dir
file:
path: /var/www
state: directory
- name: Copy repo files
become: yes
copy:
src: "{{ item }}"
dest: /var/www
owner: www-data
group: www-data
with_fileglob:
- src/*
- name: Copy config file
become: yes
copy:
src: files/nginx.conf
dest: /etc/nginx/nginx.conf
owner: root
notify:
- Reload nginx
handlers:
- name: Reload nginx
become: yes
service:
name: nginx
state: restarted