2016-06-08 20:59:47 +00:00
|
|
|
require_relative "../facts"
|
|
|
|
require_relative "../pip/pip"
|
2015-12-07 14:44:20 +00:00
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module Ansible
|
|
|
|
module Cap
|
|
|
|
module Guest
|
|
|
|
module Fedora
|
|
|
|
module AnsibleInstall
|
|
|
|
|
2016-06-08 20:59:47 +00:00
|
|
|
def self.ansible_install(machine, install_mode, ansible_version)
|
2016-06-09 17:16:47 +00:00
|
|
|
rpm_package_manager = Facts::rpm_package_manager(machine)
|
|
|
|
|
2016-06-08 20:59:47 +00:00
|
|
|
if install_mode == :pip
|
|
|
|
pip_setup machine
|
|
|
|
Pip::pip_install machine, "ansible", ansible_version
|
2015-12-07 14:44:20 +00:00
|
|
|
else
|
2016-06-09 17:16:47 +00:00
|
|
|
machine.communicate.sudo "#{rpm_package_manager} -y install ansible"
|
2015-12-07 14:44:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-08 20:59:47 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def self.pip_setup(machine)
|
2016-06-09 17:16:47 +00:00
|
|
|
rpm_package_manager = Facts::rpm_package_manager(machine)
|
|
|
|
|
|
|
|
machine.communicate.sudo "#{rpm_package_manager} install -y curl gcc gmp-devel libffi-devel openssl-devel python-crypto python-devel python-dnf python-setuptools redhat-rpm-config"
|
2016-06-08 20:59:47 +00:00
|
|
|
Pip::get_pip machine
|
2015-12-07 14:44:20 +00:00
|
|
|
end
|
2015-12-07 21:30:13 +00:00
|
|
|
|
2015-12-07 14:44:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|