Remove all trailing spaces from playbook files to fix linting errors
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
- name: WordPress mit offiziellem WP-CLI installieren
|
- name: WordPress mit offiziellem WP-CLI installieren
|
||||||
hosts: testservers
|
hosts: testservers
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: WP-CLI von wp-cli.org herunterladen (offizielle Methode)
|
- name: WP-CLI von wp-cli.org herunterladen (offizielle Methode)
|
||||||
shell: |
|
shell: |
|
||||||
@@ -10,17 +10,17 @@
|
|||||||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||||
chmod +x wp-cli.phar
|
chmod +x wp-cli.phar
|
||||||
mv wp-cli.phar /usr/local/bin/wp
|
mv wp-cli.phar /usr/local/bin/wp
|
||||||
|
|
||||||
- name: WP-CLI testen
|
- name: WP-CLI testen
|
||||||
shell: wp --info --allow-root
|
shell: wp --info --allow-root
|
||||||
register: wp_cli_test
|
register: wp_cli_test
|
||||||
environment:
|
environment:
|
||||||
WP_CLI_ALLOW_ROOT: 1
|
WP_CLI_ALLOW_ROOT: 1
|
||||||
|
|
||||||
- name: WP-CLI Info
|
- name: WP-CLI Info
|
||||||
debug:
|
debug:
|
||||||
var: wp_cli_test.stdout_lines
|
var: wp_cli_test.stdout_lines
|
||||||
|
|
||||||
- name: WordPress-Datenbank für WP-CLI vorbereiten
|
- name: WordPress-Datenbank für WP-CLI vorbereiten
|
||||||
shell: |
|
shell: |
|
||||||
mysql -h 127.0.0.1 -P 3306 -u root -psecure_root_pass_123 -e "
|
mysql -h 127.0.0.1 -P 3306 -u root -psecure_root_pass_123 -e "
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
"
|
"
|
||||||
|
|
||||||
- name: Alte WordPress-Dateien entfernen (außer wp-content)
|
- name: Alte WordPress-Dateien entfernen (außer wp-content)
|
||||||
shell: |
|
shell: |
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@@ -38,11 +38,11 @@
|
|||||||
rm -rf wp-admin wp-includes
|
rm -rf wp-admin wp-includes
|
||||||
ls -la
|
ls -la
|
||||||
register: cleanup
|
register: cleanup
|
||||||
|
|
||||||
- name: Cleanup-Ergebnis
|
- name: Cleanup-Ergebnis
|
||||||
debug:
|
debug:
|
||||||
var: cleanup.stdout_lines
|
var: cleanup.stdout_lines
|
||||||
|
|
||||||
- name: WordPress-Core mit WP-CLI herunterladen
|
- name: WordPress-Core mit WP-CLI herunterladen
|
||||||
shell: |
|
shell: |
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@@ -50,11 +50,11 @@
|
|||||||
register: wp_download
|
register: wp_download
|
||||||
environment:
|
environment:
|
||||||
WP_CLI_ALLOW_ROOT: 1
|
WP_CLI_ALLOW_ROOT: 1
|
||||||
|
|
||||||
- name: WordPress-Download Ergebnis
|
- name: WordPress-Download Ergebnis
|
||||||
debug:
|
debug:
|
||||||
var: wp_download.stdout_lines
|
var: wp_download.stdout_lines
|
||||||
|
|
||||||
- name: wp-config.php mit WP-CLI erstellen
|
- name: wp-config.php mit WP-CLI erstellen
|
||||||
shell: |
|
shell: |
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@@ -69,11 +69,11 @@
|
|||||||
register: wp_config
|
register: wp_config
|
||||||
environment:
|
environment:
|
||||||
WP_CLI_ALLOW_ROOT: 1
|
WP_CLI_ALLOW_ROOT: 1
|
||||||
|
|
||||||
- name: wp-config Ergebnis
|
- name: wp-config Ergebnis
|
||||||
debug:
|
debug:
|
||||||
var: wp_config.stdout_lines
|
var: wp_config.stdout_lines
|
||||||
|
|
||||||
- name: WordPress mit WP-CLI installieren
|
- name: WordPress mit WP-CLI installieren
|
||||||
shell: |
|
shell: |
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@@ -87,11 +87,11 @@
|
|||||||
register: wp_install
|
register: wp_install
|
||||||
environment:
|
environment:
|
||||||
WP_CLI_ALLOW_ROOT: 1
|
WP_CLI_ALLOW_ROOT: 1
|
||||||
|
|
||||||
- name: WordPress-Installation Ergebnis
|
- name: WordPress-Installation Ergebnis
|
||||||
debug:
|
debug:
|
||||||
var: wp_install.stdout_lines
|
var: wp_install.stdout_lines
|
||||||
|
|
||||||
- name: WordPress-Berechtigungen korrekt setzen
|
- name: WordPress-Berechtigungen korrekt setzen
|
||||||
shell: |
|
shell: |
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
find . -type d -exec chmod 755 {} \;
|
find . -type d -exec chmod 755 {} \;
|
||||||
find . -type f -exec chmod 644 {} \;
|
find . -type f -exec chmod 644 {} \;
|
||||||
chmod 600 wp-config.php
|
chmod 600 wp-config.php
|
||||||
|
|
||||||
- name: WordPress-Status mit WP-CLI prüfen
|
- name: WordPress-Status mit WP-CLI prüfen
|
||||||
shell: |
|
shell: |
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@@ -117,16 +117,16 @@
|
|||||||
register: wp_status
|
register: wp_status
|
||||||
environment:
|
environment:
|
||||||
WP_CLI_ALLOW_ROOT: 1
|
WP_CLI_ALLOW_ROOT: 1
|
||||||
|
|
||||||
- name: WordPress-Status
|
- name: WordPress-Status
|
||||||
debug:
|
debug:
|
||||||
var: wp_status.stdout_lines
|
var: wp_status.stdout_lines
|
||||||
|
|
||||||
- name: Services neustarten
|
- name: Services neustarten
|
||||||
shell: |
|
shell: |
|
||||||
service php8.3-fpm restart
|
service php8.3-fpm restart
|
||||||
service nginx restart
|
service nginx restart
|
||||||
|
|
||||||
- name: WordPress-Homepage testen
|
- name: WordPress-Homepage testen
|
||||||
uri:
|
uri:
|
||||||
url: http://localhost
|
url: http://localhost
|
||||||
@@ -134,27 +134,27 @@
|
|||||||
return_content: yes
|
return_content: yes
|
||||||
register: homepage_test
|
register: homepage_test
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Homepage-Inhalt prüfen
|
- name: Homepage-Inhalt prüfen
|
||||||
debug:
|
debug:
|
||||||
msg: |
|
msg: |
|
||||||
Status: {{ homepage_test.status | default('Fehler') }}
|
Status: {{ homepage_test.status | default('Fehler') }}
|
||||||
Content-Length: {{ homepage_test.content | length if homepage_test.content is defined else 0 }}
|
Content-Length: {{ homepage_test.content | length if homepage_test.content is defined else 0 }}
|
||||||
Enthält WordPress: {{ 'Ja' if homepage_test.content is defined and
|
Enthält WordPress: {{ 'Ja' if homepage_test.content is defined and
|
||||||
'WordPress' in homepage_test.content else 'Nein' }}
|
'WordPress' in homepage_test.content else 'Nein' }}
|
||||||
|
|
||||||
- name: Erfolgreiche Installation
|
- name: Erfolgreiche Installation
|
||||||
debug:
|
debug:
|
||||||
msg: |
|
msg: |
|
||||||
🎉 WordPress erfolgreich installiert!
|
🎉 WordPress erfolgreich installiert!
|
||||||
|
|
||||||
📱 URLs:
|
📱 URLs:
|
||||||
- Homepage: http://localhost:8080
|
- Homepage: http://localhost:8080
|
||||||
- Admin: http://localhost:8080/wp-admin
|
- Admin: http://localhost:8080/wp-admin
|
||||||
|
|
||||||
🔑 Login-Daten:
|
🔑 Login-Daten:
|
||||||
- Benutzername: admin
|
- Benutzername: admin
|
||||||
- Passwort: admin123
|
- Passwort: admin123
|
||||||
- E-Mail: admin@example.com
|
- E-Mail: admin@example.com
|
||||||
|
|
||||||
🛠 WP-CLI verfügbar unter: wp --allow-root
|
🛠 WP-CLI verfügbar unter: wp --allow-root
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
- name: Install LEMP stack with WordPress (Multi-OS Support)
|
- name: Install LEMP stack with WordPress (Multi-OS Support)
|
||||||
hosts: all
|
hosts: all
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Gather OS facts
|
- name: Gather OS facts
|
||||||
setup:
|
setup:
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
- 'distribution'
|
- 'distribution'
|
||||||
- 'distribution_version'
|
- 'distribution_version'
|
||||||
- 'os_family'
|
- 'os_family'
|
||||||
|
|
||||||
- name: Load OS-specific variables
|
- name: Load OS-specific variables
|
||||||
include_vars: "../vars/{{ ansible_os_family | lower }}.yml"
|
include_vars: "../vars/{{ ansible_os_family | lower }}.yml"
|
||||||
|
|
||||||
- name: Debug OS information
|
- name: Debug OS information
|
||||||
debug:
|
debug:
|
||||||
msg: |
|
msg: |
|
||||||
@@ -29,13 +29,13 @@
|
|||||||
# WordPress Configuration
|
# WordPress Configuration
|
||||||
wordpress_path: "{{ web_root }}"
|
wordpress_path: "{{ web_root }}"
|
||||||
wordpress_url: "http://{{ ansible_default_ipv4.address | default('localhost') }}"
|
wordpress_url: "http://{{ ansible_default_ipv4.address | default('localhost') }}"
|
||||||
|
|
||||||
# Database Configuration
|
# Database Configuration
|
||||||
mysql_root_password: "{{ mysql_root_password | default('secure_root_password_' + ansible_date_time.epoch) }}"
|
mysql_root_password: "{{ mysql_root_password | default('secure_root_password_' + ansible_date_time.epoch) }}"
|
||||||
wordpress_db_name: "{{ wordpress_db_name | default('wordpress_db') }}"
|
wordpress_db_name: "{{ wordpress_db_name | default('wordpress_db') }}"
|
||||||
wordpress_db_user: "{{ wordpress_db_user | default('wordpress_user') }}"
|
wordpress_db_user: "{{ wordpress_db_user | default('wordpress_user') }}"
|
||||||
wordpress_db_password: "{{ wordpress_db_password | default('secure_wp_password_' + ansible_date_time.epoch) }}"
|
wordpress_db_password: "{{ wordpress_db_password | default('secure_wp_password_' + ansible_date_time.epoch) }}"
|
||||||
|
|
||||||
# WordPress Admin
|
# WordPress Admin
|
||||||
wp_admin_user: "{{ wp_admin_user | default('admin') }}"
|
wp_admin_user: "{{ wp_admin_user | default('admin') }}"
|
||||||
wp_admin_password: "{{ wp_admin_password | default('secure_admin_password_' + ansible_date_time.epoch) }}"
|
wp_admin_password: "{{ wp_admin_password | default('secure_admin_password_' + ansible_date_time.epoch) }}"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
become: yes
|
become: yes
|
||||||
vars_files:
|
vars_files:
|
||||||
- "../vars/{{ ansible_os_family | lower }}.yml"
|
- "../vars/{{ ansible_os_family | lower }}.yml"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
# SSL Configuration
|
# SSL Configuration
|
||||||
enable_ssl: "{{ enable_ssl | default(false) }}"
|
enable_ssl: "{{ enable_ssl | default(false) }}"
|
||||||
@@ -14,17 +14,17 @@
|
|||||||
ssl_certificate_path: "{{ ssl_certificate_path | default('/etc/ssl/certs/' + domain_name + '.crt') }}"
|
ssl_certificate_path: "{{ ssl_certificate_path | default('/etc/ssl/certs/' + domain_name + '.crt') }}"
|
||||||
ssl_certificate_key_path: "{{ ssl_certificate_key_path | default('/etc/ssl/private/' + domain_name + '.key') }}"
|
ssl_certificate_key_path: "{{ ssl_certificate_key_path | default('/etc/ssl/private/' + domain_name + '.key') }}"
|
||||||
letsencrypt_email: "{{ letsencrypt_email | default('admin@' + domain_name) }}"
|
letsencrypt_email: "{{ letsencrypt_email | default('admin@' + domain_name) }}"
|
||||||
|
|
||||||
# WordPress Configuration
|
# WordPress Configuration
|
||||||
wordpress_path: /var/www/html
|
wordpress_path: /var/www/html
|
||||||
wordpress_url: "{{ 'https://' + domain_name if enable_ssl else 'http://' + domain_name }}"
|
wordpress_url: "{{ 'https://' + domain_name if enable_ssl else 'http://' + domain_name }}"
|
||||||
|
|
||||||
# Database Configuration
|
# Database Configuration
|
||||||
mysql_root_password: "{{ mysql_root_password | default('secure_root_password_' + ansible_date_time.epoch) }}"
|
mysql_root_password: "{{ mysql_root_password | default('secure_root_password_' + ansible_date_time.epoch) }}"
|
||||||
wordpress_db_name: "{{ wordpress_db_name | default('wordpress_db') }}"
|
wordpress_db_name: "{{ wordpress_db_name | default('wordpress_db') }}"
|
||||||
wordpress_db_user: "{{ wordpress_db_user | default('wordpress_user') }}"
|
wordpress_db_user: "{{ wordpress_db_user | default('wordpress_user') }}"
|
||||||
wordpress_db_password: "{{ wordpress_db_password | default('secure_wp_password_' + ansible_date_time.epoch) }}"
|
wordpress_db_password: "{{ wordpress_db_password | default('secure_wp_password_' + ansible_date_time.epoch) }}"
|
||||||
|
|
||||||
# WordPress Admin
|
# WordPress Admin
|
||||||
wp_admin_user: "{{ wp_admin_user | default('admin') }}"
|
wp_admin_user: "{{ wp_admin_user | default('admin') }}"
|
||||||
wp_admin_password: "{{ wp_admin_password | default('secure_admin_password_' + ansible_date_time.epoch) }}"
|
wp_admin_password: "{{ wp_admin_password | default('secure_admin_password_' + ansible_date_time.epoch) }}"
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
# Include base LEMP installation
|
# Include base LEMP installation
|
||||||
- name: Include base LEMP installation tasks
|
- name: Include base LEMP installation tasks
|
||||||
include_tasks: lemp-base-tasks.yml
|
include_tasks: lemp-base-tasks.yml
|
||||||
|
|
||||||
# SSL Certificate Management
|
# SSL Certificate Management
|
||||||
- name: Install Certbot for Let's Encrypt
|
- name: Install Certbot for Let's Encrypt
|
||||||
apt:
|
apt:
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
update_cache: yes
|
update_cache: yes
|
||||||
when: enable_ssl and ansible_os_family == "Debian"
|
when: enable_ssl and ansible_os_family == "Debian"
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
- name: Install Certbot for Let's Encrypt (CentOS/RHEL)
|
- name: Install Certbot for Let's Encrypt (CentOS/RHEL)
|
||||||
yum:
|
yum:
|
||||||
name:
|
name:
|
||||||
@@ -55,14 +55,14 @@
|
|||||||
state: present
|
state: present
|
||||||
when: enable_ssl and ansible_os_family == "RedHat"
|
when: enable_ssl and ansible_os_family == "RedHat"
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
- name: Check if SSL certificate exists
|
- name: Check if SSL certificate exists
|
||||||
stat:
|
stat:
|
||||||
path: "{{ ssl_certificate_path }}"
|
path: "{{ ssl_certificate_path }}"
|
||||||
register: ssl_cert_exists
|
register: ssl_cert_exists
|
||||||
when: enable_ssl
|
when: enable_ssl
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
- name: Create temporary HTTP Nginx config for Let's Encrypt
|
- name: Create temporary HTTP Nginx config for Let's Encrypt
|
||||||
template:
|
template:
|
||||||
src: ../templates/wordpress.nginx.j2
|
src: ../templates/wordpress.nginx.j2
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
when: enable_ssl and not ssl_cert_exists.stat.exists
|
when: enable_ssl and not ssl_cert_exists.stat.exists
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
- name: Enable temporary site
|
- name: Enable temporary site
|
||||||
file:
|
file:
|
||||||
src: /etc/nginx/sites-available/wordpress
|
src: /etc/nginx/sites-available/wordpress
|
||||||
@@ -79,11 +79,11 @@
|
|||||||
when: enable_ssl and not ssl_cert_exists.stat.exists
|
when: enable_ssl and not ssl_cert_exists.stat.exists
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
- name: Flush handlers to ensure Nginx is running
|
- name: Flush handlers to ensure Nginx is running
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
when: enable_ssl and not ssl_cert_exists.stat.exists
|
when: enable_ssl and not ssl_cert_exists.stat.exists
|
||||||
|
|
||||||
- name: Generate Let's Encrypt certificate
|
- name: Generate Let's Encrypt certificate
|
||||||
command: >
|
command: >
|
||||||
certbot --nginx --non-interactive --agree-tos
|
certbot --nginx --non-interactive --agree-tos
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
--redirect
|
--redirect
|
||||||
when: enable_ssl and not ssl_cert_exists.stat.exists and domain_name != 'localhost'
|
when: enable_ssl and not ssl_cert_exists.stat.exists and domain_name != 'localhost'
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
- name: Create self-signed certificate for localhost/testing
|
- name: Create self-signed certificate for localhost/testing
|
||||||
block:
|
block:
|
||||||
- name: Create SSL directory
|
- name: Create SSL directory
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
path: /etc/ssl/private
|
path: /etc/ssl/private
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0700'
|
mode: '0700'
|
||||||
|
|
||||||
- name: Generate self-signed certificate
|
- name: Generate self-signed certificate
|
||||||
command: >
|
command: >
|
||||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048
|
openssl req -x509 -nodes -days 365 -newkey rsa:2048
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
creates: "{{ ssl_certificate_path }}"
|
creates: "{{ ssl_certificate_path }}"
|
||||||
when: enable_ssl and not ssl_cert_exists.stat.exists and domain_name == 'localhost'
|
when: enable_ssl and not ssl_cert_exists.stat.exists and domain_name == 'localhost'
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
# Nginx Configuration
|
# Nginx Configuration
|
||||||
- name: Configure Nginx for WordPress with SSL
|
- name: Configure Nginx for WordPress with SSL
|
||||||
template:
|
template:
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
when: enable_ssl
|
when: enable_ssl
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: nginx
|
tags: nginx
|
||||||
|
|
||||||
- name: Configure Nginx for WordPress without SSL
|
- name: Configure Nginx for WordPress without SSL
|
||||||
template:
|
template:
|
||||||
src: ../templates/wordpress.nginx.j2
|
src: ../templates/wordpress.nginx.j2
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
when: not enable_ssl
|
when: not enable_ssl
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: nginx
|
tags: nginx
|
||||||
|
|
||||||
- name: Enable WordPress site
|
- name: Enable WordPress site
|
||||||
file:
|
file:
|
||||||
src: /etc/nginx/sites-available/wordpress
|
src: /etc/nginx/sites-available/wordpress
|
||||||
@@ -139,14 +139,14 @@
|
|||||||
state: link
|
state: link
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: nginx
|
tags: nginx
|
||||||
|
|
||||||
- name: Remove default Nginx site
|
- name: Remove default Nginx site
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/sites-enabled/default
|
path: /etc/nginx/sites-enabled/default
|
||||||
state: absent
|
state: absent
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: nginx
|
tags: nginx
|
||||||
|
|
||||||
# Rate limiting configuration
|
# Rate limiting configuration
|
||||||
- name: Configure Nginx rate limiting
|
- name: Configure Nginx rate limiting
|
||||||
blockinfile:
|
blockinfile:
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/m;
|
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/m;
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags: nginx
|
tags: nginx
|
||||||
|
|
||||||
# WordPress Configuration
|
# WordPress Configuration
|
||||||
- name: Configure WordPress with SSL settings
|
- name: Configure WordPress with SSL settings
|
||||||
template:
|
template:
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
group: www-data
|
group: www-data
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
tags: wordpress
|
tags: wordpress
|
||||||
|
|
||||||
# SSL Auto-renewal
|
# SSL Auto-renewal
|
||||||
- name: Set up Let's Encrypt auto-renewal
|
- name: Set up Let's Encrypt auto-renewal
|
||||||
cron:
|
cron:
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
job: "/usr/bin/certbot renew --quiet"
|
job: "/usr/bin/certbot renew --quiet"
|
||||||
when: enable_ssl and domain_name != 'localhost'
|
when: enable_ssl and domain_name != 'localhost'
|
||||||
tags: ssl
|
tags: ssl
|
||||||
|
|
||||||
# Firewall Configuration
|
# Firewall Configuration
|
||||||
- name: Configure UFW for HTTP and HTTPS
|
- name: Configure UFW for HTTP and HTTPS
|
||||||
ufw:
|
ufw:
|
||||||
@@ -191,18 +191,18 @@
|
|||||||
- "443"
|
- "443"
|
||||||
when: enable_ssl
|
when: enable_ssl
|
||||||
tags: firewall
|
tags: firewall
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart nginx
|
- name: restart nginx
|
||||||
service:
|
service:
|
||||||
name: nginx
|
name: nginx
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: restart php-fpm
|
- name: restart php-fpm
|
||||||
service:
|
service:
|
||||||
name: "php{{ php_version }}-fpm"
|
name: "php{{ php_version }}-fpm"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: restart mysql
|
- name: restart mysql
|
||||||
service:
|
service:
|
||||||
name: "{{ mysql_service }}"
|
name: "{{ mysql_service }}"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
wordpress_admin_password: "admin_secure_pass_123"
|
wordpress_admin_password: "admin_secure_pass_123"
|
||||||
wordpress_admin_email: "admin@example.com"
|
wordpress_admin_email: "admin@example.com"
|
||||||
domain_name: "localhost"
|
domain_name: "localhost"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: System aktualisieren
|
- name: System aktualisieren
|
||||||
apt:
|
apt:
|
||||||
|
|||||||
@@ -5,26 +5,26 @@
|
|||||||
become: yes
|
become: yes
|
||||||
vars_files:
|
vars_files:
|
||||||
- "../vars/{{ ansible_os_family | lower }}.yml"
|
- "../vars/{{ ansible_os_family | lower }}.yml"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
# Backup Configuration
|
# Backup Configuration
|
||||||
enable_backups: "{{ enable_backups | default(true) }}"
|
enable_backups: "{{ enable_backups | default(true) }}"
|
||||||
backup_schedule: "{{ backup_schedule | default('0 2 * * *') }}" # Daily at 2 AM
|
backup_schedule: "{{ backup_schedule | default('0 2 * * *') }}" # Daily at 2 AM
|
||||||
backup_retention_days: "{{ backup_retention_days | default(7) }}"
|
backup_retention_days: "{{ backup_retention_days | default(7) }}"
|
||||||
backup_destination: "{{ backup_destination | default('/var/backups/wordpress') }}"
|
backup_destination: "{{ backup_destination | default('/var/backups/wordpress') }}"
|
||||||
|
|
||||||
# Performance Configuration
|
# Performance Configuration
|
||||||
enable_redis: "{{ enable_redis | default(false) }}"
|
enable_redis: "{{ enable_redis | default(false) }}"
|
||||||
enable_memcached: "{{ enable_memcached | default(false) }}"
|
enable_memcached: "{{ enable_memcached | default(false) }}"
|
||||||
enable_opcache: "{{ enable_opcache | default(true) }}"
|
enable_opcache: "{{ enable_opcache | default(true) }}"
|
||||||
|
|
||||||
# Security Configuration
|
# Security Configuration
|
||||||
enable_fail2ban: "{{ enable_fail2ban | default(true) }}"
|
enable_fail2ban: "{{ enable_fail2ban | default(true) }}"
|
||||||
enable_modsecurity: "{{ enable_modsecurity | default(false) }}"
|
enable_modsecurity: "{{ enable_modsecurity | default(false) }}"
|
||||||
|
|
||||||
# Monitoring Configuration
|
# Monitoring Configuration
|
||||||
enable_monitoring: "{{ enable_monitoring | default(false) }}"
|
enable_monitoring: "{{ enable_monitoring | default(false) }}"
|
||||||
|
|
||||||
# WordPress Multisite
|
# WordPress Multisite
|
||||||
enable_multisite: "{{ enable_multisite | default(false) }}"
|
enable_multisite: "{{ enable_multisite | default(false) }}"
|
||||||
multisite_type: "{{ multisite_type | default('subdirectory') }}" # subdirectory or subdomain
|
multisite_type: "{{ multisite_type | default('subdirectory') }}" # subdirectory or subdomain
|
||||||
|
|||||||
Reference in New Issue
Block a user