Changeset View
Changeset View
Standalone View
Standalone View
Vagrantfile
Show All 34 Lines | |||||
ENV_PRODUCTION = "production" | ENV_PRODUCTION = "production" | ||||
ENV_STAGING = "staging" | ENV_STAGING = "staging" | ||||
ENVIRONMENT_FACTS = { | ENVIRONMENT_FACTS = { | ||||
ENV_ADMIN => { | ENV_ADMIN => { | ||||
"vagrant_testing" => "1", | "vagrant_testing" => "1", | ||||
"testing" => "vagrant", | "testing" => "vagrant", | ||||
"deployment" => ENV_ADMIN, | "deployment" => ENV_ADMIN, | ||||
"subnet" => "vagrant" | "subnet" => "vagrant", | ||||
"environment" => ENV_PRODUCTION, | |||||
}, | }, | ||||
ENV_PRODUCTION => { | ENV_PRODUCTION => { | ||||
"vagrant_testing" => "1", | "vagrant_testing" => "1", | ||||
"testing" => "vagrant", | "testing" => "vagrant", | ||||
"deployment" => ENV_PRODUCTION, | "deployment" => ENV_PRODUCTION, | ||||
"subnet" => "vagrant", | "subnet" => "vagrant", | ||||
"puppet_vardir" => "/var/lib/puppet" | "puppet_vardir" => "/var/lib/puppet", | ||||
"environment" => ENV_PRODUCTION, | |||||
}, | }, | ||||
ENV_STAGING => { | ENV_STAGING => { | ||||
"vagrant_testing" => "1", | "vagrant_testing" => "1", | ||||
"testing" => "vagrant", | "testing" => "vagrant", | ||||
"deployment" => ENV_STAGING, | "deployment" => ENV_STAGING, | ||||
"subnet" => "vagrant" | "subnet" => "vagrant", | ||||
"environment" => ENV_STAGING, | |||||
}, | }, | ||||
} | } | ||||
vms = { | vms = { | ||||
################ | ################ | ||||
# STAGING | # STAGING | ||||
################ | ################ | ||||
"staging-webapp" => { | "staging-webapp" => { | ||||
▲ Show 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | vms.each do | vm_name, vm_props | | ||||
end | end | ||||
if vm_props[:type] == TYPE_MASTER | if vm_props[:type] == TYPE_MASTER | ||||
config.vm.provision "file", source: "vagrant/puppet_master/", destination: "/tmp/" | config.vm.provision "file", source: "vagrant/puppet_master/", destination: "/tmp/" | ||||
config.vm.provision :shell, :path => "vagrant/puppet_master/prepare_puppet_master.sh" | config.vm.provision :shell, :path => "vagrant/puppet_master/prepare_puppet_master.sh" | ||||
end | end | ||||
config.vm.provision "puppet" do |puppet| | config.vm.provision "puppet" do |puppet| | ||||
puppet.environment = _environment | puppet.environment = _facts["environment"] | ||||
if vm_props[:type] == TYPE_AGENT | if vm_props[:type] == TYPE_AGENT | ||||
puppet.environment_path = "#{environment_path}" | puppet.environment_path = "#{environment_path}" | ||||
puppet.hiera_config_path = "#{puppet.environment_path}/#{puppet.environment}/hiera.yaml" | puppet.hiera_config_path = "#{puppet.environment_path}/#{puppet.environment}/hiera.yaml" | ||||
end | end | ||||
puppet.manifest_file = "#{manifest_file}" | puppet.manifest_file = "#{manifest_file}" | ||||
puppet.manifests_path = "#{manifests_path}" | puppet.manifests_path = "#{manifests_path}" | ||||
puppet.options = "#{puppet_options}" | puppet.options = "#{puppet_options}" | ||||
puppet.facter = _facts | puppet.facter = _facts | ||||
# Dont use nfs mount as the nfs_version can't be | # Dont use nfs mount as the nfs_version can't be | ||||
# specified. The default is nfsv3 and udp which is not | # specified. The default is nfsv3 and udp which is not | ||||
# supported by the debian 11 kernel | # supported by the debian 11 kernel | ||||
end | end | ||||
end | end | ||||
end | end | ||||
end | end |