Sha256: 81a37fefc427f1f170c9283fcd79276bc0d07cc208a7377f8fd43e6d59d2d7f7

Contents?: true

Size: 1.46 KB

Versions: 16

Compression:

Stored size: 1.46 KB

Contents

require_relative "base"

module VagrantPlugins
  module Ansible
    module Config
      class Host < Base

        attr_accessor :ask_sudo_pass
        attr_accessor :ask_vault_pass
        attr_accessor :force_remote_user
        attr_accessor :host_key_checking
        attr_accessor :raw_ssh_args

        def initialize
          super

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

        def finalize!
          super

          @ask_sudo_pass       = false if @ask_sudo_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

16 entries across 16 versions & 3 rubygems

Version Path
vagrant-unbundled-1.9.8.1 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.9.7.1 plugins/provisioners/ansible/config/host.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/ansible/config/host.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/ansible/config/host.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/ansible/config/host.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.9.5.1 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.9.1.1 plugins/provisioners/ansible/config/host.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/ansible/config/host.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/ansible/config/host.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/ansible/config/host.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.8.5.2 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.8.5.1 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.8.4.2 plugins/provisioners/ansible/config/host.rb
vagrant-unbundled-1.8.4.1 plugins/provisioners/ansible/config/host.rb