Remove old WordPress role
This commit is contained in:
parent
671a94063d
commit
34495c80be
@ -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 <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
<VirtualHost *:80>
|
|
||||||
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
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
<Directory {{ wp_dir }}/public_html>
|
|
||||||
Options Indexes FollowSymLinks
|
|
||||||
AllowOverride All
|
|
||||||
Require all granted
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|
@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
define('DB_NAME', '{{ wp_db_name }}');
|
|
||||||
|
|
||||||
/** The name of the database for WordPress */
|
|
||||||
/** MySQL database username */
|
|
||||||
define('DB_USER', '{{ wp_db_user }}');
|
|
||||||
|
|
||||||
/** MySQL database password */
|
|
||||||
define('DB_PASSWORD', '{{ wp_db_pass }}');
|
|
||||||
|
|
||||||
/** MySQL hostname */
|
|
||||||
define('DB_HOST', '{{ wp_db_host }}');
|
|
||||||
|
|
||||||
/** Database Charset to use in creating database tables. */
|
|
||||||
define('DB_CHARSET', 'utf8mb4');
|
|
||||||
|
|
||||||
/** The Database Collate type. Don't change this if in doubt. */
|
|
||||||
define('DB_COLLATE', '');
|
|
||||||
|
|
||||||
/**#@+
|
|
||||||
* Authentication Unique Keys and Salts.
|
|
||||||
*
|
|
||||||
* Change these to different unique phrases!
|
|
||||||
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
|
|
||||||
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
|
|
||||||
*
|
|
||||||
* @since 2.6.0
|
|
||||||
*/
|
|
||||||
{{ salts.content | b64decode }}
|
|
||||||
|
|
||||||
/**#@-*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WordPress Database Table prefix.
|
|
||||||
*
|
|
||||||
* You can have multiple installations in one database if you give each
|
|
||||||
* a unique prefix. Only numbers, letters, and underscores please!
|
|
||||||
*/
|
|
||||||
$table_prefix = '{{ wp_db_table_prefix }}';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* For developers: WordPress debugging mode.
|
|
||||||
*
|
|
||||||
* Change this to true to enable the display of notices during development.
|
|
||||||
* It is strongly recommended that plugin and theme developers use WP_DEBUG
|
|
||||||
* in their development environments.
|
|
||||||
*
|
|
||||||
* For information on other constants that can be used for debugging,
|
|
||||||
* visit the Codex.
|
|
||||||
*
|
|
||||||
* @link https://codex.wordpress.org/Debugging_in_WordPress
|
|
||||||
*/
|
|
||||||
define('WP_DEBUG', false);
|
|
||||||
|
|
||||||
/* That's all, stop editing! Happy blogging. */
|
|
||||||
|
|
||||||
/** Absolute path to the WordPress directory. */
|
|
||||||
if ( !defined('ABSPATH') )
|
|
||||||
define('ABSPATH', dirname(__FILE__) . '/');
|
|
||||||
|
|
||||||
/** Sets up WordPress vars and included files. */
|
|
||||||
require_once(ABSPATH . 'wp-settings.php');
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user