Skip to content

Instantly share code, notes, and snippets.

@pmgarman
Created July 30, 2013 17:35

Revisions

  1. Patrick Garman revised this gist Jul 30, 2013. 1 changed file with 43 additions and 17 deletions.
    60 changes: 43 additions & 17 deletions site.pp
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,45 @@
    node 'domain.com' {
    include 'nginx'
    class do-stuff {
    include apt
    include nginx

    nginx::resource::vhost { 'domain.com':
    ensure => present,
    proxy => 'http://127.0.0.1:2368',
    }
    exec { 'first update':
    command => '/usr/bin/apt-get update'
    }

    apt::ppa { 'ppa:chris-lea/node.js':
    require => Exec['first update'],
    }

    nginx::resource::location { 'ghost':
    ensure => present,
    proxy => 'http://127.0.0.1:2368',
    location => '/ghost',
    vhost => 'domain.com',
    location_cfg_append => {
    'allow' => 'youriphere',
    'deny' => 'all'
    }
    }
    }
    exec { 'second update':
    command => '/usr/bin/apt-get update',
    require => Apt::Ppa['ppa:chris-lea/node.js'],
    }

    package { [ 'build-essential', 'git', 'nodejs', 'zip', 'unzip' ]:
    ensure => latest,
    require => Exec['second update'],
    }

    user { 'nodejs':
    ensure => present,
    managehome => true
    }

    nginx::resource::vhost { 'domain.com':
    ensure => present,
    proxy => 'http://127.0.0.1:2368',
    }

    nginx::resource::location { 'ghost':
    ensure => present,
    proxy => 'http://127.0.0.1:2368',
    location => '/ghost',
    vhost => 'domain.com',
    location_cfg_append => {
    'allow' => 'youriphere',
    'deny' => 'all'
    }
    }

    }
    include do-stuff
  2. Patrick Garman renamed this gist Jul 30, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Patrick Garman created this gist Jul 30, 2013.
    19 changes: 19 additions & 0 deletions new_gist_file
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    node 'domain.com' {
    include 'nginx'

    nginx::resource::vhost { 'domain.com':
    ensure => present,
    proxy => 'http://127.0.0.1:2368',
    }

    nginx::resource::location { 'ghost':
    ensure => present,
    proxy => 'http://127.0.0.1:2368',
    location => '/ghost',
    vhost => 'domain.com',
    location_cfg_append => {
    'allow' => 'youriphere',
    'deny' => 'all'
    }
    }
    }