Łukasz Budnik
Cloud Architect
exec { 'web autodeploy setup':
environment => ["SMART_TOOL_HOME=$smart_tool_home"],
cwd => '/smart/config/prod/services/',
command => '/bin/bash setup-webapp-autodeploy-user-and-service.sh',
unless => '/usr/bin/test -f /etc/init.d/smart-tool-webapp-autodeploy',
timeout => 1800,
}
node default, 'web' {
user { "smart":
ensure => "present",
managehome => true,
} ->
class { 'smart-sbt':
user => 'smart',
home => '/home/smart'
}
include 'smart-nginx'
include 'smart-env'
include 'smart-proserv-autodeploy'
include 'smart-logstashforwarder'
include 'smart-java8'
}
Vagrant.configure("2") do |config|
config.vm.box = "cloud-precise64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/
precise-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.network :forwarded_port, guest: 443, host: 4567
["db", "web", "worker", "nat", "proserv", "restapi", "teamcity", "buildagent"]
.each do |machinename|
config.vm.define "#{machinename}" do |machine|
machine.vm.host_name = "#{machinename}"
machine.vm.provision :shell, :path => "main.sh"
machine.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.options = "--modulepath
/vagrant/puppet/modules/:/home/vagrant/.puppet/modules:/usr/share/puppet/modules"
puppet.manifest_file = "#{machinename}-server.pp"
puppet.hiera_config_path = "puppet/config/hiera.yaml"
puppet.working_directory = "/vagrant/puppet/config/"
end
machine.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
end
end
{
"type": "shell",
"script": "security-hardening.sh",
"execute_command": "{{ .Vars }} sudo -E sh '{{ .Path }}'
{{ user `root_password` }} /tmp/{{ user `key_file_name` }}"
}
By Łukasz Budnik
Automating Infrastructure In The Cloud. Coverts puppet, puppet modules, vagrant, packer, and AWS cloud formation.