Sha256: b3891e6d5aacd335154ecbb701d76f680156fee9137543e7d30fced237af90ed

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

module Vagrant
  module Util
    # Helper methods for inspecting guests to determine if specific services
    # or applications are installed and in use
    module GuestInspection
      # Linux specific inspection helpers
      module Linux

        ## systemd helpers

        # systemd is in used
        #
        # @return [Boolean]
        def systemd?(comm)
          comm.test("systemctl | grep '^-\.mount'")
        end

        # systemd hostname set is via hostnamectl
        #
        # @return [Boolean]
        def hostnamectl?(comm)
          comm.test("hostnamectl")
        end

        ## nmcli helpers

        # nmcli is installed
        #
        # @return [Boolean]
        def nmcli?(comm)
          comm.test("nmcli")
        end

        # NetworkManager currently controls device
        #
        # @param comm [Communicator]
        # @param device_name [String]
        # @return [Boolean]
        def nm_controlled?(comm, device_name)
          comm.test("nmcli d show #{device_name}") &&
            !comm.test("nmcli d show #{device_name} | grep unmanaged")
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
vagrant-unbundled-1.9.8.1 lib/vagrant/util/guest_inspection.rb
vagrant-unbundled-1.9.7.1 lib/vagrant/util/guest_inspection.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/lib/vagrant/util/guest_inspection.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/lib/vagrant/util/guest_inspection.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/lib/vagrant/util/guest_inspection.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/lib/vagrant/util/guest_inspection.rb
vagrant-unbundled-1.9.5.1 lib/vagrant/util/guest_inspection.rb