Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------
- # Example base manifest
- #----------------------------------------
- # Set up provisioning stages. I usually keep this to three:
- #
- # pre for apt configuration, apt update/upgrade, and base packages
- # main for most of the work
- # last for final stage things like creating DB schemas
- # Used as a directory reference in user module
- # A basic class which represents stuff for my pre phase
- Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
- # Assign classes to phases
- include apt
- apt::ppa { 'ppa:ondrej/php5':
- before => Exec["update_apt"]
- }
- apt::key { 'couchbase':
- key => 'A3FAA648D9223EDA',
- key_source => 'https://gist.githubusercontent.com/ShubhamAdpushup/fb4ae32189fc0a88de5f/raw/61f662d23100aefb0e0214a593b2c40024145364/gistfile1.txt',
- }
- apt::source { 'couchbase':
- location => 'http://packages.couchbase.com/ubuntu',
- repos => 'precise/main',
- release => 'precise',
- key => 'A3FAA648D9223EDA',
- require => Apt::Key['couchbase'],
- before => Exec["update_apt"]
- }
- exec { "update_apt":
- command => "apt-get update"
- }
- package { "build-essential":
- ensure => latest,
- require => Exec["update_apt"]
- }
- package { [
- "python-software-properties",
- "tmux",
- "vim",
- "curl",
- "git",
- "memcached",
- "php-pear",
- "php5-dev",
- "libcouchbase2-core",
- "libcouchbase2-libevent",
- "libcouchbase2-bin",
- "libcouchbase-dev"
- ]:
- ensure => latest,
- require => Exec["update_apt"]
- }
- package { ['php5', 'php5-fpm']:
- ensure => latest,
- require => Apt::Ppa["ppa:ondrej/php5"]
- }
- exec { "fetch_couchbase":
- command => "wget http://packages.couchbase.com/releases/3.0.1/couchbase-server-community_3.0.1-ubuntu12.04_amd64.deb",
- creates => "/opt/couchbase"
- } -> exec { "install_couchbase":
- command => "sudo dpkg --install couchbase-server-community_3.0.1-ubuntu12.04_amd64.deb",
- creates => "/opt/couchbase",
- require => Exec["fetch_couchbase"]
- }
- include php
- vcsrepo { "/home/vagrant/php-couchbase/":
- ensure => present,
- provider => git,
- source => 'https://github.com/couchbaselabs/php-couchbase.git',
- revision => 'master'
- }
- exec { "install_couchbase_ext":
- command => "phpize && ./configure && make && make install",
- cwd => "/home/vagrant/php-couchbase/",
- creates => "/usr/lib/php5/20121212/couchbase.so",
- require => Vcsrepo["/home/vagrant/php-couchbase/"]
- }
- file { "/etc/php5/mods-available/zzcouchbase.ini":
- ensure => present,
- content => "extension=couchbase.so",
- require => Exec["install_couchbase_ext"]
- }
- exec {"enable_mod":
- command => "php5enmod zzcouchbase",
- require => File["/etc/php5/mods-available/zzcouchbase.ini"]
- }
- service { 'php5-fpm':
- ensure => running,
- enable => true,
- require => Package["php5-fpm"]
- }
- php::config { 'display_errors=On':
- file => "/etc/php5/fpm/php.ini",
- section => "PHP"
- }
- php::config { 'error_reporting=E_ALL':
- file => "/etc/php5/fpm/php.ini",
- section => "PHP"
- }
- php::extension{'curl':
- ensure => installed,
- package => "php5-curl"
- }
- php::fpm::config {'fpm-listen':
- setting => "listen",
- value => "127.0.0.1:9000",
- file => "/etc/php5/fpm/pool.d/www.conf",
- section => "www",
- }
- class {'nginx':
- sendfile => 'off'
- }
- nginx::resource::vhost { 'adpushup.com':
- www_root => '/var/www/adpushup.com',
- try_files => [ '$uri $uri/ /index.php$is_args$args' ]
- }
- nginx::resource::location { "adpushup_root":
- ensure => present,
- www_root => '/var/www/adpushup.com',
- vhost => "adpushup.com",
- location => '~ \.php$',
- index_files => ['index.php', 'index.html', 'index.htm'],
- fastcgi => "127.0.0.1:9000",
- location_cfg_append => {
- fastcgi_connect_timeout => '3m',
- fastcgi_read_timeout => '3m',
- fastcgi_send_timeout => '3m',
- fastcgi_param => ['SCRIPT_FILENAME $document_root$fastcgi_script_name'],
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement