Module: VagrantPlugins::Ansible::Cap::Guest::Fedora::AnsibleInstall

Defined in:
lib/cap/guest/fedora/ansible_install.rb

Class Method Summary collapse

Class Method Details

.ansible_install(machine) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/cap/guest/fedora/ansible_install.rb', line 9

def self.ansible_install(machine)
  if dnf?(machine)
    machine.communicate.sudo("dnf -y install ansible")
  else
    machine.communicate.sudo("yum -y install ansible")
  end
end

.dnf?(machine) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/cap/guest/fedora/ansible_install.rb', line 17

def self.dnf?(machine)
  machine.communicate.test("/usr/bin/which -s dnf")
end