From 34495c80be22fe91e0f1813c0358eb366ef70fb6 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Sun, 20 Nov 2022 05:11:43 -0500 Subject: [PATCH] Remove old WordPress role --- roles/wordpress/tasks/main.yml | 100 -------------------- roles/wordpress/templates/wordpress.conf.j2 | 17 ---- roles/wordpress/templates/wp-config.php.j2 | 64 ------------- 3 files changed, 181 deletions(-) delete mode 100644 roles/wordpress/tasks/main.yml delete mode 100644 roles/wordpress/templates/wordpress.conf.j2 delete mode 100644 roles/wordpress/templates/wp-config.php.j2 diff --git a/roles/wordpress/tasks/main.yml b/roles/wordpress/tasks/main.yml deleted file mode 100644 index d614065..0000000 --- a/roles/wordpress/tasks/main.yml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (C) 2019 Free I.T. Athens -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# PyMySQL or MySQL-python is required for database tasks -- name: Install MySQL Support for Python - apt: - name: python-pymysql - state: present - -- name: Create Database - mysql_db: - name: "{{ wp_db_name }}" - state: present - login_unix_socket: /var/run/mysqld/mysqld.sock - -- name: Create Database User - mysql_user: - name: "{{ wp_db_user }}" - password: "{{ wp_db_pass }}" - priv: "{{ wp_db_name }}.*:ALL,GRANT" - state: present - login_unix_socket: /var/run/mysqld/mysqld.sock - -- name: Create Public HTML Directory - file: - path: "{{ wp_dir }}/public_html" - state: directory - -- name: Create Logs Directory - file: - path: "{{ wp_dir }}/logs" - state: directory - -- name: Download WordPress - get_url: - url: https://wordpress.org/wordpress-{{ wp_version }}.tar.gz - dest: /tmp/wordpress-{{ wp_version }}.tar.gz - checksum: sha1:{{ wp_sha1_hash }} - -- name: Extract WordPress - unarchive: - src: /tmp/wordpress-{{ wp_version }}.tar.gz - dest: "{{ wp_dir }}/public_html" - extra_opts: [--strip-components=1] - owner: "www-data" - group: "www-data" - remote_src: yes - -- name: Stat WordPress Salts - stat: - path: "{{ wp_dir }}/salts.txt" - register: salts - -- name: Generate Keys and Salts - get_url: - url: https://api.wordpress.org/secret-key/1.1/salt/ - dest: "{{ wp_dir }}/salts.txt" - when: not salts.stat.exists - -- name: Grab Keys and Salts - slurp: src="{{ wp_dir }}/salts.txt" - register: salts - -- name: Apply WordPress Configuration - template: - src: wp-config.php.j2 - dest: "{{ wp_dir }}/public_html/wp-config.php" - owner: "www-data" - group: "www-data" - -- name: Apply Apache Configuration - template: - src: wordpress.conf.j2 - dest: /etc/apache2/sites-available/{{ wp_domain }}.conf - notify: Reload Apache2 - -- name: Enable Apache Module rewrite - apache2_module: - state: present - name: rewrite - notify: Reload Apache2 - -- name: Enable Apache Website - shell: a2ensite {{ wp_domain }} - args: - creates: /etc/apache2/sites-enabled/{{ wp_domain }}.conf - notify: Reload Apache2 - diff --git a/roles/wordpress/templates/wordpress.conf.j2 b/roles/wordpress/templates/wordpress.conf.j2 deleted file mode 100644 index 5cee139..0000000 --- a/roles/wordpress/templates/wordpress.conf.j2 +++ /dev/null @@ -1,17 +0,0 @@ - - ServerName {{ wp_domain }} - - ServerAdmin {{ wp_admin_email }} - DocumentRoot {{ wp_dir }}/public_html - - ErrorLog {{ wp_dir }}/logs/error.log - CustomLog {{ wp_dir }}/logs/access.log combined - - - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/roles/wordpress/templates/wp-config.php.j2 b/roles/wordpress/templates/wp-config.php.j2 deleted file mode 100644 index ea06e70..0000000 --- a/roles/wordpress/templates/wp-config.php.j2 +++ /dev/null @@ -1,64 +0,0 @@ -