2013-03-20 14:41:21 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module Ansible
|
|
|
|
class Plugin < Vagrant.plugin("2")
|
2015-02-10 14:28:00 +00:00
|
|
|
|
2013-03-20 14:41:21 +00:00
|
|
|
name "ansible"
|
|
|
|
description <<-DESC
|
2015-02-10 14:28:00 +00:00
|
|
|
Provides support for provisioning your virtual machines with Ansible
|
|
|
|
from the Vagrant host (`ansible`) or from the guests (`ansible_local`).
|
2013-03-20 14:41:21 +00:00
|
|
|
DESC
|
|
|
|
|
2015-02-10 14:28:00 +00:00
|
|
|
config("ansible", :provisioner) do
|
|
|
|
require_relative "config/host"
|
|
|
|
Config::Host
|
|
|
|
end
|
|
|
|
|
|
|
|
config("ansible_local", :provisioner) do
|
|
|
|
require_relative "config/guest"
|
|
|
|
Config::Guest
|
|
|
|
end
|
|
|
|
|
|
|
|
provisioner("ansible") do
|
|
|
|
require_relative "provisioner/host"
|
|
|
|
Provisioner::Host
|
|
|
|
end
|
|
|
|
|
|
|
|
provisioner("ansible_local") do
|
|
|
|
require_relative "provisioner/guest"
|
|
|
|
Provisioner::Guest
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:linux, :ansible_installed) do
|
|
|
|
require_relative "cap/guest/posix/ansible_installed"
|
|
|
|
Cap::Guest::POSIX::AnsibleInstalled
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:freebsd, :ansible_installed) do
|
|
|
|
require_relative "cap/guest/posix/ansible_installed"
|
|
|
|
Cap::Guest::POSIX::AnsibleInstalled
|
2013-03-20 14:41:21 +00:00
|
|
|
end
|
|
|
|
|
2015-02-10 14:28:00 +00:00
|
|
|
guest_capability(:arch, :ansible_install) do
|
|
|
|
require_relative "cap/guest/arch/ansible_install"
|
|
|
|
Cap::Guest::Arch::AnsibleInstall
|
2013-03-20 14:41:21 +00:00
|
|
|
end
|
2015-02-10 14:28:00 +00:00
|
|
|
|
|
|
|
guest_capability(:debian, :ansible_install) do
|
|
|
|
require_relative "cap/guest/debian/ansible_install"
|
|
|
|
Cap::Guest::Debian::AnsibleInstall
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:ubuntu, :ansible_install) do
|
|
|
|
require_relative "cap/guest/ubuntu/ansible_install"
|
|
|
|
Cap::Guest::Ubuntu::AnsibleInstall
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:redhat, :ansible_install) do
|
|
|
|
require_relative "cap/guest/epel/ansible_install"
|
|
|
|
Cap::Guest::EPEL::AnsibleInstall
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:suse, :ansible_install) do
|
|
|
|
require_relative "cap/guest/suse/ansible_install"
|
|
|
|
Cap::Guest::SUSE::AnsibleInstall
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:freebsd, :ansible_install) do
|
|
|
|
require_relative "cap/guest/freebsd/ansible_install"
|
|
|
|
Cap::Guest::FreeBSD::AnsibleInstall
|
|
|
|
end
|
|
|
|
|
2013-03-20 14:41:21 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|