This commit is contained in:
2024-11-24 19:58:14 +03:00
parent 5bc41c853f
commit bb79295969
4 changed files with 56 additions and 46 deletions

View File

@ -5,11 +5,27 @@
notify:
- Restart Nginx
- name: Ensure Nginx is enabled and started
systemd:
name: nginx
enabled: yes
state: started
- name: Deploy Main Nginx Configuration
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
mode: '0644'
notify:
- Restart Nginx
- name: Deploy SiteA Configuration
template:
src: siteA.conf.j2
dest: /etc/nginx/conf.d/siteA.conf
when: "'SiteA' in group_names"
notify:
- Restart Nginx
- name: Deploy SiteB Configuration
template:
src: siteB.conf.j2
dest: /etc/nginx/conf.d/siteB.conf
when: "'SiteB' in group_names"
notify:
- Restart Nginx
@ -35,22 +51,6 @@
notify:
- Restart Nginx
- name: Deploy SiteA Configuration
template:
src: siteA.conf.j2
dest: /etc/nginx/conf.d/siteA.conf
when: "'SiteA' in group_names"
notify:
- Restart Nginx
- name: Deploy SiteB Configuration
template:
src: siteB.conf.j2
dest: /etc/nginx/conf.d/siteB.conf
when: "'SiteB' in group_names"
notify:
- Restart Nginx
- name: Deploy SiteA HTML
template:
src: index.html.j2
@ -77,10 +77,10 @@
notify:
- Restart Nginx
- name: Deploy Main Nginx Configuration
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
mode: '0644'
- name: Ensure Nginx is enabled and started
systemd:
name: nginx
enabled: yes
state: started
notify:
- Restart Nginx