Skip to content

Ansible playbook for setting up WordPress, Apache, PHP + Zend OpCache, MySQL, Auto MySQL Backup, Memcached, Monit, Git, UFW.

License

Notifications You must be signed in to change notification settings

devil1991/ansible-wordpress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Playbook: WordPress

Build Status MIT License Gittip [Flattr this git repo](https://flattr.com/submit/auto?user_id=darthwade&url=https://github.com/darthwade/ansible-wordpress&title=Ansible Role: WordPress Apache&language=&tags=github&category=software)

Ansible playbook for setting up WordPress, Apache, PHP + Zend OpCache, MySQL, Auto MySQL Backup, Memcached, Monit, Git, UFW.

Features include:

  • Installation of any WordPress version
  • Configuration of wp-config.php
  • Fetch random salts for wp-config.php (https://api.wordpress.org/secret-key/1.1/salt/)
  • Configuration of Apache virtual host
  • Creation of MySQL database and user
  • Installation of monit system
  • Configuring firewall

Installation

Using git:

$ git clone https://github.com/darthwade/ansible-wordpress.git

Usage

Run machine locally:

$ vagrant up

Run production machine:

  • Update production inventory (./production)
$ INVENTORY='production' REMOTE_USER='ubuntu' CONNECTION='smart' PLAYBOOK='site.yml' vagrant up

Default env arguments:

INVENTORY='stage'
PLAYBOOK='site.yml'
REMOTE_USER='vagrant'
CONNECTION='local'

Requirements & Dependencies

  • Vagrant 1.6.5 or higher
  • VirtualBox

Variables

Here is a list of all the default variables for this role, which are also available in host_vars/example.com.

# Timezone
timezone: UTC

# WordPress
wp_version: 4.0
wp_install_dir: '/var/sites/expamle.com'
wp_db_name: 'expamledb'
wp_db_user: 'expamleuser'
wp_db_password: 'expamle2014password'
wp_db_host: 'localhost'

wp_apache_hostname: 'expamle.com'
wp_apache_alias: 'www.expamle.com'
wp_apache_admin_email: 'admin@expamle.com'

# MySQL
mysql_port: 3306
# mysql_bind_address: 'localhost'
mysql_root_password: 'p_cd&u8bO1Ce_|O#|,&~oA}tDY!,$^!3wkmw*ZQ`6HTV'
mysql_databases:
  - name: '{{wp_db_name}}'
    encoding: 'utf8'
    collation: 'utf8_general_ci'
mysql_users:
  - name: '{{wp_db_user}}'
    host: '%'
    password: '{{wp_db_password}}'
    priv: '{{wp_db_name}}.*:ALL'

# Monit
monit_notify_email: 'admin@expamle.com'

monit_mailserver_host: 'localhost'
# monit_mailserver_port:
# monit_mailserver_username:
# monit_mailserver_password:
# monit_mailserver_encryption:
monit_mailserver_timeout: 60

monit_port: 3737
monit_address: 'expamle.com'
monit_allow: ['expamle.com', 'localhost']
monit_username: 'admin'
monit_password: 'expamle2014password'

Testing

$ git clone https://github.com/darthwade/ansible-wordpress.git
$ cd ansible-wordpress
$ vagrant up

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Licensed under the MIT License. See the LICENSE file for details.

Copyright (c) 2014 Vadym Petrychenko

About

Ansible playbook for setting up WordPress, Apache, PHP + Zend OpCache, MySQL, Auto MySQL Backup, Memcached, Monit, Git, UFW.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 53.2%
  • DIGITAL Command Language 46.8%