1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

initial checkin -- May 27, 2017

This commit is contained in:
George Hunt 2017-05-27 11:09:50 -07:00
commit 845632d0ac
488 changed files with 41559 additions and 0 deletions

View file

@ -0,0 +1,10 @@
wordpress_src: wordpress-4.7.3.tar.gz
wp_db_name: xsce_wp
wp_db_user: xsce_wp
wp_db_user_password: changeme
wordpress_install: True
wordpress_enabled: True
wp_install_path: /library
wp_abs_path: /library/wordpress
wp_url: /wordpress
wp_full_url: "http://{{ xsce_hostname }}{{ wp_url }}"

View file

@ -0,0 +1,10 @@
<?php
define('AUTH_KEY', 'L0f`R#=aNZqApmM9PB. N}|5Ndk6!@Y2|iH+<#6-<nf0ZwI@UN1-4?Ui|>KjZ?z?');
define('SECURE_AUTH_KEY', 'a*m|a.6+mJItP_-A{hIvuE<zoGK*0F;$5 q(Z%C< ^k%-BbM|E/Y,zf;X++?W;Hs');
define('LOGGED_IN_KEY', 'P%<)zvsAy-`I 5k+6|Ixa%xN#$-mS-P#k+b2`8eQh&B65e>L0QX:j32-T2qM<b/I');
define('NONCE_KEY', 'b)$6#DH j~iD+X~jLC!~7H>$Y5-42j^,O]0Iw2}BMI{%n+v?9J|QguMZqBktspP;');
define('AUTH_SALT', 'U+](-b-),e9S0=-/d:xNO{3Dp47ZE6G|dg[)AjlxQn]!)H~ni|<$:y>}Od@,i&7E');
define('SECURE_AUTH_SALT', '}I%X$L-Pr89=2=)KQ~05#7V%gg;g!;&.O[PIx4QBKq,uF.I35ymf|~iAX|qX+/rm');
define('LOGGED_IN_SALT', 'Qwr|f4|^e+~&0e 31?(dO$P96BqAAw{8RdJ<R7QcOy18NY`-Tt5gnl*s<A8p;u.v');
define('NONCE_SALT', 'f638d_sIUyp9{h<Eq[,q 9nP>0*pd_ 3+7r[LO$.feEa>z^*M+cs$uF@1J6CWkk.');
?>

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: mysql }

View file

@ -0,0 +1,111 @@
- name: Get the WordPress software
get_url: url="{{ xsce_download_url }}/{{ wordpress_src }}" dest={{ downloads_dir}}/
when: not {{ use_cache }} and not {{ no_network }}
tags:
- download2
- name: Copy it to permanent location /library
unarchive: src={{ downloads_dir}}/{{ wordpress_src }} dest=/library
- name: Rename /library/wordpress* to /library/wordpress
shell: if [ ! -d {{ wp_abs_path }} ]; then mv {{ wp_abs_path }}* {{ wp_abs_path }}; fi
# First pass at permissions and ownership
- name: Make apache owner and group
file: path={{ wp_abs_path }}
recurse=yes
owner=root
group={{ apache_data }}
mode=0640
state=directory
- name: Make directories 755 so can traverse
command: "/usr/bin/find {{ wp_abs_path }} -type d -exec chmod 755 {} +"
- name: Copy wp salt values
copy: src=wp-keys.php.BAK
dest={{ wp_abs_path }}/wp-keys.php.BAK
owner=root
group={{ apache_data }}
mode=0640
# Fetch random salts for WordPress config into wp-keys.php file by generating script and running
- name: Create wp salt script
template: src=get-xsce-wp-salts.j2
dest=/tmp/get-xsce-wp-salts
owner=root
group=root
mode=0700
- name: Run wp salt script to create /library/wordpress/wp-keys.php
command: /tmp/get-xsce-wp-salts
- name: Cleanup - remove wp salt script
file: path=/tmp/get-xsce-wp-salts
state=absent
- name: mysql database needs to be running if we are trying to create a new db
service: state=started
name='{{ mysql_service }}'
- name: Create mysql wordpress database
mysql_db: name={{ wp_db_name }}
state=present
- name: Create mysql wordpress database user
mysql_user: name={{ wp_db_user }}
password={{ wp_db_user_password }}
priv={{ wp_db_name }}.*:ALL,GRANT
state=present
- name: Copy WordPress config file
template: src=wp-config.php.j2
dest={{ wp_abs_path }}/wp-config.php
owner=root
group={{ apache_data }}
mode=0640
- name: Copy WordPress httpd conf file
template: src=wordpress.conf.j2
dest=/etc/{{ apache_config_dir }}/wordpress.conf
- name: Enable httpd conf file if we are disabled
file: path=/etc/apache2/sites-enabled/wordpress.conf
src=/etc/apache2/sites-available/wordpress.conf
state=link
when: wordpress_enabled and is_debian
- name: Remove httpd conf file if we are disabled
file: path=/etc/apache2/sites-enabled/wordpress.conf
state=absent
when: not wordpress_enabled and is_debian
- name: Restart apache, so it picks up the new aliases
service: name={{ apache_service }} state=restarted
- name: Add wordpress to service list
ini_file: dest='{{ service_filelist }}'
section=wordpress
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: name
value: wordpress
- option: description
value: '"WordPress is a blog and web site management application."'
- option: wordpress_src
value: "{{ wordpress_src }}"
- option: wp_abs_path
value: "{{ wp_abs_path }}"
- option: wp_db_name
value: "{{ wp_db_name }}"
- option: wp_db_user
value: "{{ wp_db_user }}"
- option: wp_url
value: "{{ wp_url }}"
- option: wp_full_url
value: "{{ wp_full_url }}"
- option: wordpress_enabled
value: "{{ wordpress_enabled }}"

View file

@ -0,0 +1,3 @@
- name: Include the install playbook
include: install.yml
when: wordpress_install

View file

@ -0,0 +1,20 @@
#!/bin/bash
# Get salt constants and write to wp-keys.php
#
# by Tim Moody tim@timmoody.com
DEST=/library/wordpress/wp-keys.php
BACKUP=/library/wordpress/wp-keys.php.BAK
echo '<?php' > $DEST
curl https://api.wordpress.org/secret-key/1.1/salt/ >> $DEST
RC=$?
# if the download of keys failed, revert to previous version
if [ $RC -ne 0 ];then
cp $BACKUP $DEST
else
echo '?>' >> $DEST
chown root:{{ apache_data }} $DEST
chmod 640 $DEST
cp -f $DEST $BACKUP
fi

View file

@ -0,0 +1,8 @@
RewriteEngine on
Alias {{ wp_url }} {{ wp_abs_path }}
<Directory {{ wp_abs_path }}>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

View file

@ -0,0 +1,93 @@
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '{{ wp_db_name }}');
/** MySQL database username */
define('DB_USER', '{{ wp_db_user }}');
/** MySQL database password */
define('DB_PASSWORD', '{{ wp_db_user_password }}');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** 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
*/
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
/**#@-*/
/* Include file with defaults or new values if there was an internet connection to populate it */
include 'wp-keys.php';
/**
* 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_';
/**
* 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');