Sha256: 7d82b16dcc79820b73e11e1141bcb715f10e0fb1ca0e31dfd5fad72f6e9f6f8e

Contents?: true

Size: 1.63 KB

Versions: 3

Compression:

Stored size: 1.63 KB

Contents

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

<% if config[:provisioners].include? 'shell' -%>
<% config[:shell_paths].each do |path| -%>
  config.vm.provision 'shell', path: '<%= path %>'
<% end -%>
<% end -%>
<% if config[:provisioners].include? 'puppet' -%>
  config.vm.provision 'puppet' do |puppet|
<% if config[:puppet_hiera] -%>
    puppet.hiera_config_path = 'hiera.yaml'
<% end -%>
<% if config[:puppet_librarian_puppet] -%>
    puppet.module_path = 'modules'
<% end -%>
  end
<% end -%>
<% if config[:communicator] == 'winrm' -%>
  config.vm.communicator = '<%= config[:communicator] %>'
<% end -%>

<% if config[:local] -%>
  config.vm.define 'local' do |local|
    local.vm.box = "<%= config[:local_box] %>"
<% if config[:local_box_url] -%>
    local.vm.box_url = "<%= config[:local_box_url] %>"
<% end -%>
  end
<% end -%>

<% if config[:managed] -%>
  if File.exist?('Catfishfile.lock')
    instances = File.readlines('Catfishfile.lock').map(&:chomp)
    instances.each do |instance|
      config.vm.define "managed-#{instance}" do |box|
        box.vm.box = "tknerr/managed-server-dummy"
        box.vm.provider :managed do |managed, override|
          managed.server = instance
<% if config[:communicator] == 'ssh' -%>
          override.ssh.username = '<%= config[:ssh_username] %>'
          override.ssh.private_key_path = '<%= config[:ssh_private_key_path] %>'
<% end -%>
<% if config[:communicator] == 'winrm' -%>
          instance.vm.winrm.username = '<%= config[:winrm_username] %>'
          instance.vm.winrm.password = '<%= config[:winrm_password] %>'
<% end -%>
        end
      end
    end
  end
<% end -%>
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
catfish-0.0.8 lib/catfish/templates/Vagrantfile.tt
catfish-0.0.7 lib/catfish/templates/Vagrantfile.tt
catfish-0.0.6 lib/catfish/templates/Vagrantfile.tt