Sha256: 7cc282ba3499e6aa41c1a7d39ee27d4400b413565ffb10247fbb45ac572565d3

Contents?: true

Size: 1.7 KB

Versions: 36

Compression:

Stored size: 1.7 KB

Contents

require_relative "base"

module VagrantPlugins
  module Ansible
    module Config
      class Host < Base

        attr_accessor :ask_become_pass
        attr_accessor :ask_vault_pass
        attr_accessor :force_remote_user
        attr_accessor :host_key_checking
        attr_accessor :raw_ssh_args

        #
        # Deprecated options
        #
        alias :ask_sudo_pass :ask_become_pass
        def ask_sudo_pass=(value)
          show_deprecation_info 'ask_sudo_pass', 'ask_become_pass'
          @ask_become_pass = value
        end

        def initialize
          super

          @ask_become_pass     = false
          @ask_vault_pass      = false
          @force_remote_user   = true
          @host_key_checking   = false
          @raw_ssh_args        = UNSET_VALUE
        end

        def finalize!
          super

          @ask_become_pass     = false if @ask_become_pass   != true
          @ask_vault_pass      = false if @ask_vault_pass    != true
          @force_remote_user   = true  if @force_remote_user != false
          @host_key_checking   = false if @host_key_checking != true
          @raw_ssh_args        = nil   if @raw_ssh_args      == UNSET_VALUE
        end

        def validate(machine)
          super

          if raw_ssh_args
            if raw_ssh_args.kind_of?(String)
              @raw_ssh_args = [raw_ssh_args]
            elsif !raw_ssh_args.kind_of?(Array)
              @errors << I18n.t(
                "vagrant.provisioners.ansible.errors.raw_ssh_args_invalid",
                type:  raw_ssh_args.class.to_s,
                value: raw_ssh_args.to_s)
            end
          end

          { "ansible remote provisioner" => @errors }
        end

      end
    end
  end
end

Version data entries

36 entries across 32 versions & 5 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/provisioners/ansible/config/host.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.3.3.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.3.2.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.19.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.18.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.16.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.14.0 plugins/provisioners/ansible/config/host.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.10.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.9.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.8.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.7.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.6.2 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.6.1 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.6.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.5.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.4.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.3.0 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-2.2.2.0 plugins/provisioners/ansible/config/host.rb