Deploy SEA from github via puppet

From DISI
Jump to navigation Jump to search

This is a mockup of how the puppetlabs vcsrepo module can be used to automate the deployment of something like sea16 via puppet

You'll need to

a) Install puppetlabs-vcsrepo on alpha
b) Create a puppet module for application(s) you want to deploy
c) Write manifest(s) (below) in the module for the application(s) you wish to deploy
d) Install the module on alpha
e) Register it with puppet
f) Assign the module to any servers you wish to use as web app servers

Example:

class SEA16Server {
  $SEA_REPO = 'git://git@github.com:docking-org/seaware-academic.git'
  $SEA_ROOT = '/nfs/soft/www/apps/sea/conda_sea16'
  file { $SEA_ROOT:
    ensure => directory,
    recursive => true,
  }
  vcsrepo { $SEA_ROOT:
    ensure   => latest,
    provider => git,
    source   => $SEA_REPO,
    user     => 'www',
    require  => File['/nfs/home/www/.ssh/id_rsa'],
    revision => 'production',
    notify   => [
      Exec['sea16-vcs-make'],
      Exec['run-sea-server'],
    ]   
  }
  exec { 'sea16-vcf-make-all':
    command           => '/usr/bin/make -C $SEA_ROOT all',
    user              => 'www',
    notifyonly        => true,
  }
  exec { 'sea16-vcf-make-restart':
    command    => '/usr/bin/make -C $SEA_ROOT SEAserver-start',
    user       => 'www',
    notifyonly => true,
    require    => Exec['sea16-vcf-make-all'],
  }
}