Skip to content

Instantly share code, notes, and snippets.

View marcioviegas's full-sized avatar
👨‍🎓
Learning Javascript

Márcio Viegas marcioviegas

👨‍🎓
Learning Javascript
View GitHub Profile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.define :db do |db_config|
db_config.vm.network :private_network, :ip => "192.168.33.10"
db_config.vm.provision "puppet" do |puppet|
puppet.manifest_file = "db.pp"
end
[mysqld]
bind-address = 9.9.9.9
<!-- The contents of this file will be loaded for each web application -->
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource name="jdbc/web" auth="Container" type="javax.sql.DataSource" maxActive="100"
maxIdle="30" maxWait="10000" username="<%= db_user %>" password="<%= db_password %>" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://<%= db_host %>:3306/<%= db_schema %>"/>
define hostgroup {
hostgroup_name db-servers
alias Database Servers
}
define hostgroup {
hostgroup_name web-servers
alias Web Servers
}
@marcioviegas
marcioviegas / db.pp
Last active September 17, 2015 16:35
exec { "apt-update":
command => "/usr/bin/apt-get update"
}
package { "mysql-server":
ensure => installed,
require => Exec["apt-update"],
}
file { "/etc/mysql/conf.d/allow_external.cnf":
@marcioviegas
marcioviegas / web.pp
Last active September 17, 2015 18:25
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"]: