Chapter 3

This commit is contained in:
Tim Schilling
2024-11-19 09:21:31 +01:00
parent f4324b427d
commit 8c09466663
5 changed files with 161 additions and 21 deletions
+22 -21
View File
@@ -2,30 +2,31 @@
- name: Configure webserver with nginx
hosts: webservers
become: true
vars:
tasks:
- name: Ensure nginx is installed
package:
name: nginx
update_cache: yes
- name: Ensure nginx is installed
package:
name: nginx
update_cache: true
- name: Copy nginx config file
copy:
src: nginx.conf
dest: /etc/nginx/sites-available/default
- name: Copy nginx config file
copy:
src: nginx.conf
dest: /etc/nginx/sites-available/default
- name: Enable Configuration
file:
src: /etc/nginx/sites-available/default
dest: /etc/nginx/sites-enabled/default
state: link
- name: Enable Configuration
file:
src: /etc/nginx/sites-available/default
dest: /etc/nginx/sites-enabled/default
state: link
- name: Copy index.html
template:
src: index.html.j2
dest: /usr/share/nginx/html/index.html
- name: Copy index.html
template:
src: index.html.j2
dest: /usr/share/nginx/html/index.html
- name: Restart nginx
service:
name: nginx
state: restarted
- name: Restart nginx
service:
name: nginx
state: restarted
...