Created
July 22, 2013 14:16
-
-
Save fcharlier/6054145 to your computer and use it in GitHub Desktop.
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
forge "http://forge.puppetlabs.com" | |
mod 'puppetlabs/stdlib' | |
mod 'puppetlabs/apache' | |
mod 'puppetlabs/mysql' | |
mod 'puppetlabs/vcsrepo' |
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
# file { '/etc/apt/apt.conf.d/99_proxy': | |
# owner => 'root', | |
# group => 'root', | |
# mode => '0644', | |
# content => 'Acquire::http::Proxy "http://wheezyj:3142";' | |
# } -> Package <| |> | |
exec { 'apt-get update': | |
path => '/usr/bin', | |
} -> Package <| |> | |
package { 'git': } | |
package { 'ruby-dev': } | |
package { 'build-essential': } | |
package { 'librarian-puppet': | |
provider => gem, | |
require => Package['ruby-dev'] | |
} | |
file { '/etc/puppet/Puppetfile': | |
ensure => '/root/puppet/Puppetfile' | |
} | |
exec { 'librarian-puppet update': | |
path => '/bin:/usr/bin:/usr/local/bin', | |
cwd => '/etc/puppet', | |
environment => 'HOME=/root', | |
require => [ | |
Package['git'], | |
Package['librarian-puppet'], | |
File['/etc/puppet/Puppetfile'] | |
] | |
} |
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
include mysql::php | |
class { 'mysql::server': | |
config_hash => { 'root_password' => 'dummy' } | |
} | |
$oc_adminlogin = 'admin' | |
$oc_adminpass = 'adminpass' | |
$oc_base = '/home/owncloud' | |
$oc_datadirectory = "${oc_base}/data" | |
$oc_dbtype = 'mysql' | |
$oc_dbname = 'owncloud' | |
$oc_dbhost = '127.0.0.1' | |
$oc_dbtableprefix = 'oc_' | |
$oc_dbuser = 'owncloud' | |
$oc_dbpassword = 'ChangeMe' | |
mysql::db { $oc_dbname: | |
user => $oc_dbuser, | |
password => $oc_dbpassword, | |
host => $oc_dbhost | |
} | |
package { [ | |
'php5', | |
'php5-gd', | |
'php-xml-parser', | |
'php5-intl', | |
'curl', | |
'libcurl3', | |
'php5-curl' | |
]: } | |
class { 'apache': | |
mpm_module => 'prefork' | |
} | |
vcsrepo { $oc_base: | |
ensure => latest, | |
provider => git, | |
source => 'git://github.com/enovance/owncloud_core.git', | |
revision => 'swift_auth_v2' | |
} | |
## Uncomment this to use local repo | |
# file { $oc_base: | |
# ensure => symlink, | |
# target => '/vagrant/owncloud_core' | |
# } | |
file { [ | |
"${oc_base}/config", | |
"${oc_base}/apps", | |
$oc_datadirectory, | |
]: | |
owner => $::apache::params::user, | |
group => $::apache::params::group, | |
mode => '0644', | |
require => Vcsrepo[$oc_base] | |
} | |
$autoconfig = inline_template("<?php | |
\\\$AUTOCONFIG = array ( | |
'directory' => '${oc_datadirectory}', | |
'dbtype' => '${oc_dbtype}', | |
'dbname' => '${oc_dbname}', | |
'dbhost' => '${oc_dbhost}', | |
'dbtableprefix' => '${oc_dbtableprefix}', | |
'dbuser' => '${oc_dbuser}', | |
'dbpass' => '${oc_dbpassword}', | |
'adminlogin' => '${oc_adminlogin}', | |
'adminpass' => '${oc_adminpass}' | |
); | |
") | |
exec { 'autoconfig': | |
command => "echo \"${autoconfig}\" > ${oc_base}/config/autoconfig.php", | |
unless => "grep '\\\'installed\\\' => true' ${oc_base}/config/config.php", | |
path => '/bin:/usr/bin' | |
} | |
include apache::mod::php | |
apache::vhost { 'owncloud': | |
port => 80, | |
servername => 'owncloud', | |
default_vhost => true, | |
docroot => '/home/owncloud', | |
docroot_owner => 'www', | |
docroot_group => 'www', | |
directories => [ | |
{ | |
path => '/home/owncloud', | |
allow_override => 'All', | |
}, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment