Created
July 15, 2014 00:17
-
-
Save diginc/90ba9ff5f63a972323b1 to your computer and use it in GitHub Desktop.
puppet workshop
This file contains 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
# Requires modules: puppetlabs-apache, puppetlabs-mysql | |
exec { 'apt_get_update': | |
command => '/usr/bin/apt-get update', | |
} | |
-> | |
Package <| |> | |
# Default | |
Exec { | |
path => '/bin:/sbin:/usr/bin:/usr/sbin' | |
} | |
class mediawiki_prereq_installs { | |
class { '::mysql::server' : } | |
class { 'apache' : | |
mpm_module => 'prefork', | |
} | |
class { 'apache::mod::php': } | |
package { 'php5': | |
ensure => installed | |
} | |
# deploy mediawiki | |
exec { '/usr/bin/wget -O mediawiki.tar.gz http://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.1.tar.gz': | |
cwd => '/opt', | |
unless => 'test -d /opt/mediawiki-1.23.1', | |
} | |
-> | |
exec { '/bin/tar xvf mediawiki.tar.gz': | |
cwd => '/opt', | |
unless => 'test -d /opt/mediawiki-1.23.1', | |
} | |
} | |
class mediawiki_prereq_configuration { | |
mysql::db { 'mediawiki': | |
user => 'myuser', | |
password => 'mypass', | |
host => 'localhost', | |
grant => ['SELECT', 'UPDATE'], | |
} | |
# apache vhost | |
apache::vhost { 'localhost': | |
port => '80', | |
docroot => '/opt/mediawiki-1.23.1', | |
} | |
} | |
include mediawiki_prereq_installs | |
include mediawiki_prereq_configuration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment