"Fossies" - the Fresh Open Source Software Archive

Member "vagrant-2.2.14/plugins/provisioners/ansible/cap/guest/arch/ansible_install.rb" (20 Nov 2020, 1202 Bytes) of package /linux/misc/vagrant-2.2.14.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 require_relative "../../../errors"
    2 require_relative "../pip/pip"
    3 
    4 module VagrantPlugins
    5   module Ansible
    6     module Cap
    7       module Guest
    8         module Arch
    9           module AnsibleInstall
   10 
   11             def self.ansible_install(machine, install_mode, ansible_version, pip_args, pip_install_cmd = "")
   12               case install_mode
   13               when :pip
   14                 pip_setup machine, pip_install_cmd
   15                 Pip::pip_install machine, "ansible", ansible_version, pip_args, true
   16 
   17               when :pip_args_only
   18                 pip_setup machine, pip_install_cmd
   19                 Pip::pip_install machine, "", "", pip_args, false
   20 
   21               else
   22                 machine.communicate.sudo "pacman -Syy --noconfirm"
   23                 machine.communicate.sudo "pacman -S --noconfirm ansible"
   24               end
   25             end
   26 
   27             private
   28 
   29             def self.pip_setup(machine, pip_install_cmd = "")
   30               machine.communicate.sudo "pacman -Syy --noconfirm"
   31               machine.communicate.sudo "pacman -S --noconfirm base-devel curl git python"
   32 
   33               Pip::get_pip machine, pip_install_cmd
   34             end
   35 
   36           end
   37         end
   38       end
   39     end
   40   end
   41 end