Module: VagrantPlugins::Ansible::Cap::Guest::POSIX::AnsibleInstalled
- Defined in:
- lib/cap/guest/posix/ansible_installed.rb
Class Method Summary collapse
-
.ansible_installed(machine, version) ⇒ true, false
Check if Ansible is installed (at the given version).
Class Method Details
.ansible_installed(machine, version) ⇒ true, false
Check if Ansible is installed (at the given version).
10 11 12 13 14 15 16 17 18 |
# File 'lib/cap/guest/posix/ansible_installed.rb', line 10 def self.ansible_installed(machine, version) command = 'test -x "$(command -v ansible)"' if !version.empty? command << "&& ansible --version | grep 'ansible #{version}'" end machine.communicate.test(command, sudo: false) end |