Skip to content

Instantly share code, notes, and snippets.

@marcioviegas
Last active September 17, 2015 18:25
Show Gist options
  • Save marcioviegas/5f4060b6dc5a560c2928 to your computer and use it in GitHub Desktop.
Save marcioviegas/5f4060b6dc5a560c2928 to your computer and use it in GitHub Desktop.
web.pp
$db_host = "192.168.33.10"
$db_schema = "loja_schema"
$db_user = "loja"
$db_password = "lojasecret"
exec { "apt-update":
command => "/usr/bin/apt-get update"
}
package {["mysql-client", "tomcat7"]:
ensure => installed,
require => Exec["apt-update"],
}
file { "/var/lib/tomcat7/conf/.keystore":
owner => root,
group => tomcat7,
mode => 0640,
source => "/vagrant/manifests/.keystore",
require => Package["tomcat7"],
notify => Service["tomcat7"],
}
file { "/var/lib/tomcat7/conf/server.xml":
owner => root,
group => tomcat7,
mode => 0644,
source => "/vagrant/manifests/server.xml",
require => Package["tomcat7"],
notify => Service["tomcat7"],
}
file { "/etc/default/tomcat7":
owner => root,
group => root,
mode => 0644,
source => "/vagrant/manifests/tomcat7",
}
service { "tomcat7":
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
require => Package["tomcat7"],
}
file { "/var/lib/tomcat7/conf/context.xml":
owner => root,
group => tomcat7,
mode => 0644,
content => template("/vagrant/manifests/context.xml"),
require => Package["tomcat7"],
notify => Service["tomcat7"],
}
file { "/var/lib/tomcat7/webapps/devopsnapratica.war":
owner => root,
group => tomcat7,
mode => 0644,
source => "/vagrant/manifests/devopsnapratica.war",
require => Package["tomcat7"],
notify => Service["tomcat7"],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment