Olá Wanderson!
Sim, eu tenho a pasta criada.
Vagranfile:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.define :web do |web_config|
web_config.vm.network "private_network", ip: "192.168.50.10"
web_config.vm.provision "puppet" do |puppet|
puppet.manifest_file = "web.pp"
end
end
config.vm.provision "shell", inline: "apt-get update && apt-get install -y puppet"
end
e dentro do subdir manifest:
web.pp:
exec { "apt-update":
command => "/usr/bin/apt-get update"
}
package { ["openjdk-8-jre", "tomcat8", "mysql-server", "htop"]:
ensure => installed,
require => Exec["apt-update"]
}
service { "tomcat8":
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
require => Package["tomcat8"]
}
file { "/var/lib/tomcat8/webapps/vraptor-musicjungle.war":
source => "/vagrant/manifests/vraptor-musicjungle.war",
owner => tomcat8,
group => tomcat8,
mode => 0644,
require => Package["tomcat8"],
notify => Service["tomcat8"]
}
service { "mysql":
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
require => Package["mysql-server"]
}
exec { "musicjungle":
command => "mysqladmin -uroot create musicjungle",
unless => "mysql -u root musicjungle",
path => "/usr/bin",
require => Service["mysql"]
}
exec { "mysql-password" :
command => "mysql -uroot -e \"GRANT ALL PRIVILEGES ON * TO 'musicjungle'@'%' IDENTIFIED BY 'minha-senha';\" musicjungle",
unless => "mysql -umusicjungle -pminha-senha musicjungle",
path => "/usr/bin",
require => Exec["musicjungle"]
}
define file_line($file, $line) {
exec { "/bin/echo '${line}' >> '${file}'":
unless => "/bin/grep -qFx '${line}' '${file}'"
}
}
file_line { "production":
file => "/etc/default/tomcat8",
line => "JAVA_OPTS=\"\$JAVA_OPTS -Dbr.com.caelum.vraptor.environment=production\"",
require => Package["tomcat8"],
notify => Service["tomcat8"]
}
e o bootstrap.sh:
#!/bin/sh
set -e -x
if which puppet > /dev/null ; then
echo "Puppet is already installed"
exit 0
fi
apt-get update
apt-get install -y aptitude
export DEBIAN_FRONTEND=noninteractive
wget -qO /tmp/puppetlabs-release-precise.deb https://apt.puppetlabs.com/puppetlabs-release-precise.deb
dpkg -i /tmp/puppetlabs-release-precise.deb
rm /tmp/puppetlabs-release-precise.deb
aptitude update
echo Installing puppet
aptitude install -y puppet
echo "Puppet installed!"
Obrigado pela atencao