Add cowboy_website to hedwig.

This commit is contained in:
Jim Hague 2023-05-11 14:21:11 +01:00
parent 59d8ebe3ad
commit e44a12557a
6 changed files with 89 additions and 2 deletions

View File

@ -1,3 +1,5 @@
mariadb:
root_pw: 'havoc'
havoc_pw: 'mNa4dkxs'
root_pw: 'root'
havoc_pw: 'havoc'
woody_pw: 'woody'

View File

@ -0,0 +1,3 @@
wordpress:
havoc_key: 'havoc_key'
woody_key: 'woody_key'

View File

@ -0,0 +1,13 @@
<?php
# Created by setup-mysql
define('DB_NAME', 'woody');
define('DB_USER', 'woody');
define('DB_PASSWORD', '{{ pillar['mariadb']['woody_pw'] }}');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('SECRET_KEY', '{{ pillar['wordpress']['woody_key'] }}');
define('WP_CONTENT_DIR', '/var/lib/wordpress/wp-content-cowboybuilder');
define( 'FS_METHOD', 'direct' );
define('WPLANG', 'en_GB');
?>

View File

@ -0,0 +1,35 @@
<VirtualHost *:80>
ServerName www.cowboybuilder.org.uk
ServerAlias cowboybuilder.org.uk
ErrorLog /var/log/apache2/cowboybuilder-error.log
CustomLog /var/log/apache2/cowboybuilder-access.log combined
RemoteIPProxyProtocol On
DocumentRoot /usr/share/wordpress
Alias /wp-content /var/lib/wordpress/wp-content-cowboybuilder
<Directory /var/lib/wordpress/wp-content-cowboybuilder>
Order deny,allow
Allow from all
Require all granted
</Directory>
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
Order allow,deny
Allow from all
Require all granted
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</Directory>
</VirtualHost>

View File

@ -0,0 +1,33 @@
cowboy_wordpress:
pkg.installed:
- name: wordpress
mysql_user.present:
- name: woody
- password: '{{ salt['pillar.get']('mariadb:woody_pw', '') }}'
mysql_database.present:
- name: woody
mysql_grants.present:
- grant: all privileges
- database: woody.*
- user: woody
file.managed:
- name: /etc/wordpress/config-www.cowboybuilder.org.uk.php
- source: salt://cowboy_website/config-www.cowboybuilder.org.uk.php
- template: jinja
cowboy_website:
file.managed:
- require:
- sls: apache
- names:
- /etc/apache2/sites-available/www.cowboybuilder.org.uk.conf:
- source: salt://cowboy_website/cowboybuilder.org.uk.conf
apache_site.enabled:
- require:
- file: /etc/apache2/sites-available/www.cowboybuilder.org.uk.conf
- name: www.cowboybuilder.org.uk
service.running:
- name: apache2
- reload: true
- watch:
- file: /etc/apache2/sites-available/www.cowboybuilder.org.uk.conf

View File

@ -13,6 +13,7 @@ base:
- firewalls/hedwig
- lunch_website
- havoc_website
- cowboy_website
'scabbers.lunch.org.uk':
- debian