Skip to content

Instantly share code, notes, and snippets.

@mpvvliet
Created April 23, 2012 13:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpvvliet/2470806 to your computer and use it in GitHub Desktop.
Save mpvvliet/2470806 to your computer and use it in GitHub Desktop.
Deployit puppet module sample
# Puppet manifest
$DEPLOYIT_VERSION = '3.7.0'
#
# Install the latest Apache webserver
#
exec { "apt-update":
command => "/usr/bin/apt-get update",
}
package { 'apache2':
ensure => present,
}
service { 'apache2':
ensure => running,
}
Exec["apt-update"] -> Package <| |>
#
# Install Deployit CLI
#
class { 'deployit':
host => "deployit.acme.com",
}
deployit::cli { 'install-cli':
destinationDir => '/home/vagrant',
cliArchive => "/download-cache/deployit-${DEPLOYIT_VERSION}-cli.zip",
ensure => present,
}
#
# Register webserver in Deployit
#
# Register remote host
deployit::ci { "apache2-host":
ciId => "Infrastructure/webserver-$::ipaddress_eth1",
ciType => 'overthere.SshHost',
ciValues => { os => UNIX, connectionType => SUDO, username => 'vagrant', password => 'vagrant',
sudoUsername => 'root', address => "$::ipaddress_eth1" },
ensure => present,
}
# Register Apache webserver on the host
deployit::ci { 'apache2-server':
ciId => "Infrastructure/webserver-$::ipaddress_eth1/apache2",
ciType => 'www.ApacheHttpdServer',
ciValues => { startCommand => '/usr/sbin/apache2ctl start', stopCommand => '/usr/sbin/apache2ctl stop',
restartCommand => '/usr/sbin/apache2ctl restart',
defaultDocumentRoot => '/var/www', configurationFragmentDirectory => '/etc/apache2/conf.d',
startWaitTime => 1, stopWaitTime => 1, restartWaitTime => 1 },
ciEnvironments => [ 'Environments/TEST-Website' ],
ensure => present,
}
#
# Dependencies
#
Deployit::Cli["install-cli"] -> Package["apache2"] -> Service["apache2"]
-> Deployit::Ci["apache2-host"] -> Deployit::Ci["apache2-server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment