coursework/ansible/roles/site_setup/tasks/configure.yml
2024-11-11 13:48:06 +03:00

26 lines
550 B
YAML

---
- name: Create site directories
file:
path: "/var/www/html/{{ site_name }}"
state: directory
mode: '0755'
tags: configure
- name: Deploy site content
template:
src: site_index.html.j2
dest: "/var/www/html/{{ site_name }}/index.html"
tags: configure
- name: Configure Nginx for {{ site_name }}
template:
src: nginx_site.conf.j2
dest: "/etc/nginx/conf.d/{{ site_name }}.conf"
tags: configure
- name: Restart Nginx
service:
name: nginx
state: restarted
tags: configure