init
This commit is contained in:
parent
a53d25caa9
commit
2d6606c0a4
6
TODO
Normal file
6
TODO
Normal file
@ -0,0 +1,6 @@
|
||||
Docker
|
||||
Redis
|
||||
Mysql
|
||||
|
||||
integration into wpconf
|
||||
wordpress download and config
|
7
ansible.cfg
Normal file
7
ansible.cfg
Normal file
@ -0,0 +1,7 @@
|
||||
[defaults]
|
||||
host_key_checking = False
|
||||
timeout = 3000
|
||||
roles_path = /roles
|
||||
|
||||
[ssh_connection]
|
||||
retries = 2
|
2
inventory/target.ini
Normal file
2
inventory/target.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[main]
|
||||
xyz.com ansible_connection=ssh ansible_ssh_port=22 ansible_ssh_user=user
|
17
roles/configure-nginx/tasks/main.yml
Normal file
17
roles/configure-nginx/tasks/main.yml
Normal 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
|
1965
roles/configure-php/files/php8.1.ini
Normal file
1965
roles/configure-php/files/php8.1.ini
Normal file
File diff suppressed because it is too large
Load Diff
34
roles/configure-php/tasks/main.yml
Normal file
34
roles/configure-php/tasks/main.yml
Normal 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
|
15
roles/install-nginx/tasks/main.yml
Normal file
15
roles/install-nginx/tasks/main.yml
Normal 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
|
||||
|
26
roles/install-php/tasks/main.yml
Normal file
26
roles/install-php/tasks/main.yml
Normal 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
|
5
roles/update-packages/tasks/main.yml
Normal file
5
roles/update-packages/tasks/main.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Update system packages
|
||||
apt:
|
||||
name: '*'
|
||||
state: latest
|
13
setup_server.yml
Normal file
13
setup_server.yml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
- hosts: all
|
||||
vars_files:
|
||||
- /vars/external.yml
|
||||
become: yes
|
||||
become_user: root
|
||||
gather_facts: true
|
||||
roles:
|
||||
- role: update-packages
|
||||
- role: install-nginx
|
||||
- role: configure-nginx
|
||||
- role: install-php
|
||||
- role: configure-php
|
4
vars/external.yml
Normal file
4
vars/external.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
php_version: 8.1
|
||||
password: magic
|
||||
vhost_name: projectwp
|
Loading…
Reference in New Issue
Block a user