This commit is contained in:
David Petric
2023-03-27 16:13:41 +02:00
parent a53d25caa9
commit 2d6606c0a4
11 changed files with 2094 additions and 0 deletions

View File

@ -0,0 +1,17 @@
---
- name: Prepare config file
copy:
src: files/web-{{ vhost_name }}.conf
dest: /etc/nginx/sites-available/web-{{ vhost_name }}.conf
- name: Create a symbolic link
file:
src: /etc/nginx/sites-available/web-{{ vhost_name }}.conf
dest: /etc/nginx/sites-enabled/web-{{ vhost_name }}.conf
- name: Restart Nginx
systemd:
name: nginx
daemon_reload: yes
enabled: yes
state: started

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
---
- name: PHP ini setup
copy:
src: files/php{{ php_version }}.ini
dest: /etc/php/{{ php_version }}/cli/php.ini
- name: Increase PHP memory limit
become: true
lineinfile:
dest: /etc/php/{{ php_version }}/cli/php.ini
regexp: "memory_limit ="
line: "memory_limit = 512M"
- name: Increase PHP upload time
become: true
lineinfile:
dest: /etc/php/{{ php_version }}/cli/php.ini
regexp: "max_input_time ="
line: "max_input_time = 120"
- name: Increase PHP post size
become: true
lineinfile:
dest: /etc/php/{{ php_version }}/cli/php.ini
regexp: "post_max_size ="
line: "post_max_size = 20M"
- name: Start PHP
systemd:
name: "{{ item }}"
daemon_reload: yes
enabled: yes
state: started

View File

@ -0,0 +1,15 @@
---
- name: Install Nginx
apt:
pkg:
- nginx
- certbot
- python3-certbot-nginx
- name: Enable Nginx service
systemd:
name: nginx
daemon_reload: yes
enabled: yes
state: started

View File

@ -0,0 +1,26 @@
---
- name: Install prerequisites
apt:
pkg:
- lsb-release
- ca-certificates
- apt-transport-https
- software-properties-common
- name: Add repository
shell: add-apt-repository ppa:ondrej/php -y
- name: Install PHP
apt:
pkg:
- php{{ php_version }}
- php{{ php_version }}-cli
- php{{ php_version }}-curl
- php{{ php_version }}-mysql
- php{{ php_version }}-fpm
- php{{ php_version }}-gd
- php{{ php_version }}-xml
- php{{ php_version }}-mbstring
- php{{ php_version }}-zip
- php{{ php_version }}-soap
- php{{ php_version }}-dev

View File

@ -0,0 +1,5 @@
---
- name: Update system packages
apt:
name: '*'
state: latest