wordpress
wordpress
Set up (multiple) wordpress installations in Debian-like systems (using wp-cli
).
Requirements
php
(5.3.2+)mysql
(5.0+)apache2
(withmod_rewrite
enabled)
This role assumes a working virtual host (that handles wordpress_url
).
Variables
wordpress_wp_cli_install_dir
[default:/usr/local/bin
]: Install directory forwp-cli
wordpress_installs
: [default:[]
]: Installation declarationswordpress_installs.{n}.name
: [required]: Install name (not used for anything, just an identifier)wordpress_installs.{n}.dbname
: [required]: Database namewordpress_installs.{n}.dbuser
: [required]: Database usernamewordpress_installs.{n}.dbpass
: [required]: Database password (make sure to change)wordpress_installs.{n}.dbhost
: [default:localhost
, optional]: Database hostwordpress_installs.{n}.dbprefix
: [default:wp_
, optional]: Prefix for database tableswordpress_installs.{n}.path
: [required]: Install directory for wordpresswordpress_installs.{n}.locale
: [default:en_US
, optional]: Language of the downloaded Wordpresswordpress_installs.{n}.owner
: [default:www-data
]: The name of the user that should own the installwordpress_installs.{n}.group
: [default:owner
,www-data
]: The name of the group that should own the installwordpress_installs.{n}.url
: [required]: Wordpress urlwordpress_installs.{n}.title
: [required]: Wordpress titlewordpress_installs.{n}.admin_name
: [default:admin
, optional]: Wordpress admin (user)namewordpress_installs.{n}.admin_email
: [required]: Wordpress admin email addresswordpress_installs.{n}.admin_password
: [required]: Wordpress admin password (make sure to change)wordpress_installs.{n}.cron
: [optional]: Cron declarationwordpress_installs.{n}.cron.use_crond
: [default:false
]: Whether or not to usecrond
instead of wp-cronwordpress_installs.{n}.cron.user
: [default:www-data
]: User to run job aswordpress_installs.{n}.cron.schedule
: [optional]: Cron schedule declarationwordpress_installs.{n}.cron.schedule.day
: [default:*
]: Day when the job should runwordpress_installs.{n}.cron.schedule.hour
: [default:*
]: Hour when the job should runwordpress_installs.{n}.cron.schedule.minute
: [default:*
]: Minute when the job should runwordpress_installs.{n}.cron.schedule.month
: [default:*
]: Month when the job should runwordpress_installs.{n}.cron.schedule.weekday
: [default:*
]: Weekday when the job should runwordpress_installs.{n}.themes
: [required]: (Additional) themes to install (and activate)wordpress_installs.{n}.themes.{n}.name
: [required]: Name of the themewordpress_installs.{n}.themes.{n}.activate
: [default:false
, optional]: Whether or not to activate the themewordpress_installs.{n}.plugins
: [required]: (Additional) plugins to install (and activate)wordpress_installs.{n}.plugins.{n}.name
: [required]: Name of the pluginwordpress_installs.{n}.plugins.{n}.zip
: [optional]: Zip of the pluginwordpress_installs.{n}.plugins.{n}.url
: [optional]: Url of the pluginwordpress_installs.{n}.plugins.{n}.activate
: [default:true
, optional]: Whether to activate or to deactivate the pluginwordpress_installs.{n}.plugins.{n}.force
: [default:false
, optional]: Whether or not to add the--force
option during installwordpress_installs.{n}.users
: [optional]: User declarationswordpress_installs.{n}.users.src
: [required]: The local path of the csv file to import, can be absolute or relative (e.g.../../../files/wordpress/users.csv
)wordpress_installs.{n}.users.skip_update
: [default:true
, optional]: Whether or not to update users that already existwordpress_installs.{n}.options
: [required]: Options to add, update or deletewordpress_installs.{n}.options.{n}.command
: [required]: Add, update or deletewordpress_installs.{n}.options.{n}.name
: [required]: Name of the optionwordpress_installs.{n}.options.{n}.value
: [required]: Value of the optionwordpress_installs.{n}.options.{n}.autoload
: [default:true
, optional]: Whether this option should be automatically loaded (only supported for add command)wordpress_installs.{n}.queries
: [default:[]
, optional]: A list of queries to execute
Dependencies
None
Examples
Quickstart
---
- hosts: all
roles:
- wordpress
vars:
wordpress_installs:
- name: wordpress
dbname: wordpress
dbuser: wordpress
dbpass: 'heCrE7*d2KEs'
dbhost: localhost
path: /var/www
url: http://localhost
title: wordpress
admin_name: admin
admin_email: [email protected]
admin_password: 'tuFr8=aPra@a'
themes:
- name: twentytwelve
activate: true
- name: twentythirteen
plugins:
- name: contact-form-7
activate: false
- name: simple-fields
users: {}
options: []
queries: []
Using options:
---
- hosts: all
roles:
- wordpress
vars:
wordpress_installs:
- name: wordpress
dbname: wordpress
dbuser: wordpress
dbpass: 'heCrE7*d2KEs'
dbhost: localhost
path: /var/www
url: http://localhost
title: wordpress
admin_name: admin
admin_email: [email protected]
admin_password: 'tuFr8=aPra@a'
themes:
- name: twentytwelve
activate: true
- name: twentythirteen
plugins:
- name: contact-form-7
activate: false
- name: simple-fields
users: {}
options:
- name: woocommerce_api_enabled
command: update
value: yes
- name: swoocommerce_email_from_name
command: update
vakue: [email protected]
- name: woocommerce_currency
command: update
vakue: MXN
queries: []
License
MIT
Author Information
Mischa ter Smitten
Feedback, bug-reports, requests, ...
Are welcome!