Created
June 8, 2013 03:14
-
-
Save joshbetz/5733861 to your computer and use it in GitHub Desktop.
Puppet script to configure a server to serve WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exec { path => "/bin:/usr/bin:/usr/local/bin:/usr/sbin" } | |
stage { 'pre': before => Stage['main'] } | |
class { 'pre': stage => pre } | |
class pre { | |
exec { 'apt-get update': } | |
} | |
package { 'nginx': ensure => present } | |
package { 'php5-fpm': ensure => present } | |
package { 'php5-mysql': ensure => present } | |
package { 'php5-curl': ensure => present } | |
package { 'php5-xdebug': ensure => present } | |
package { 'mysql-server': ensure => present } | |
package { 'postfix': ensure => present } | |
service { 'nginx': | |
ensure => running, | |
require => Package['nginx'] | |
} | |
service { 'php5-fpm': | |
ensure => running, | |
require => [ | |
Package['php5-fpm'], | |
Package['php5-mysql'], | |
Package['php5-curl'] | |
] | |
} | |
service { 'postfix': | |
ensure => running, | |
require => Package['postfix'], | |
} | |
file { 'vagrant-nginx': | |
path => '/etc/nginx/sites-available/vagrant', | |
ensure => file, | |
require => Package['nginx'], | |
source => 'puppet:///modules/nginx/vagrant', | |
} | |
file { 'default-nginx-disable': | |
path => '/etc/nginx/sites-enabled/default', | |
ensure => absent, | |
require => Package['nginx'], | |
} | |
file { 'vagrant-nginx-enable': | |
path => '/etc/nginx/sites-enabled/vagrant', | |
target => '/etc/nginx/sites-available/vagrant', | |
ensure => link, | |
notify => Service['nginx'], | |
require => [ | |
File['vagrant-nginx'], | |
File['default-nginx-disable'], | |
], | |
} | |
file { 'xdebug-config': | |
path => '/etc/php5/fpm/conf.d/xdebug.ini', | |
ensure => file, | |
notify => Service['nginx'], | |
source => 'puppet:///modules/nginx/xdebug' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment