Created
April 23, 2012 13:04
-
-
Save mpvvliet/2470806 to your computer and use it in GitHub Desktop.
Deployit puppet module sample
This file contains hidden or 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
# 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