"Fossies" - the Fresh Open Source Software Archive

Member "vagrant-2.2.14/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install.rb" (20 Nov 2020, 1338 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 "../debian/ansible_install"
    2 
    3 module VagrantPlugins
    4   module Ansible
    5     module Cap
    6       module Guest
    7         module Ubuntu
    8           module AnsibleInstall
    9 
   10             def self.ansible_install(machine, install_mode, ansible_version, pip_args, pip_install_cmd = "")
   11               if install_mode != :default
   12                 Debian::AnsibleInstall::ansible_install machine, install_mode, ansible_version, pip_args, pip_install_cmd
   13               else
   14                 ansible_apt_install machine
   15               end
   16             end
   17 
   18             private
   19 
   20             def self.ansible_apt_install(machine)
   21               unless machine.communicate.test("test -x \"$(which add-apt-repository)\"")
   22                 machine.communicate.sudo """
   23                   apt-get update -y -qq && \
   24                   DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common --option \"Dpkg::Options::=--force-confold\"
   25                 """
   26               end
   27               machine.communicate.sudo """
   28                 add-apt-repository ppa:ansible/ansible -y && \
   29                 apt-get update -y -qq && \
   30                 DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ansible --option \"Dpkg::Options::=--force-confold\"
   31               """
   32             end
   33 
   34           end
   35         end
   36       end
   37     end
   38   end
   39 end