vagrant-unbundled 1.9.7.1 → 1.9.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/Gemfile.lock +10 -6
- data/contrib/bash/completion.sh +1 -1
- data/contrib/sudoers/linux-ubuntu +3 -4
- data/lib/vagrant/errors.rb +8 -0
- data/lib/vagrant/machine.rb +2 -0
- data/lib/vagrant/util/platform.rb +1 -1
- data/lib/vagrant/util/powershell.rb +42 -13
- data/lib/vagrant/util/safe_exec.rb +13 -2
- data/lib/vagrant/util/ssh.rb +11 -1
- data/plugins/commands/box/command/update.rb +12 -7
- data/plugins/commands/login/client.rb +15 -6
- data/plugins/commands/login/command.rb +13 -3
- data/plugins/commands/up/command.rb +9 -0
- data/plugins/commands/validate/command.rb +4 -4
- data/plugins/guests/darwin/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/freebsd/cap/configure_networks.rb +1 -1
- data/plugins/guests/freebsd/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/linux/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/netbsd/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/openbsd/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/windows/cap/public_key.rb +21 -45
- data/plugins/kernel_v2/config/ssh_connect.rb +3 -0
- data/plugins/providers/docker/config.rb +4 -0
- data/plugins/providers/docker/driver/compose.rb +11 -4
- data/plugins/providers/hyperv/action/wait_for_ip_address.rb +15 -11
- data/plugins/providers/hyperv/scripts/get_network_config.ps1 +24 -9
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +18 -0
- data/plugins/provisioners/ansible/provisioner/host.rb +1 -1
- data/plugins/provisioners/chef/cap/debian/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/freebsd/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/omnios/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/redhat/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/suse/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/windows/chef_install.rb +2 -2
- data/plugins/provisioners/chef/config/base.rb +17 -0
- data/plugins/provisioners/chef/config/chef_zero.rb +7 -0
- data/plugins/provisioners/chef/installer.rb +8 -7
- data/plugins/provisioners/chef/omnibus.rb +4 -6
- data/plugins/provisioners/chef/provisioner/base.rb +1 -0
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +2 -1
- data/plugins/provisioners/file/provisioner.rb +18 -2
- data/plugins/provisioners/puppet/provisioner/puppet.rb +0 -2
- data/plugins/provisioners/salt/bootstrap-salt.sh +9 -5
- data/plugins/provisioners/shell/provisioner.rb +1 -1
- data/plugins/synced_folders/rsync/command/rsync_auto.rb +6 -1
- data/plugins/synced_folders/rsync/helper.rb +10 -0
- data/templates/locales/en.yml +27 -1
- data/templates/locales/providers_docker.yml +2 -0
- data/test/unit/base.rb +1 -3
- data/test/unit/plugins/commands/box/command/add_test.rb +3 -3
- data/test/unit/plugins/commands/box/command/remove_test.rb +6 -6
- data/test/unit/plugins/commands/box/command/repackage_test.rb +2 -4
- data/test/unit/plugins/commands/box/command/update_test.rb +36 -14
- data/test/unit/plugins/commands/init/command_test.rb +1 -1
- data/test/unit/plugins/commands/list-commands/command_test.rb +2 -2
- data/test/unit/plugins/commands/login/client_test.rb +5 -1
- data/test/unit/plugins/commands/package/command_test.rb +1 -1
- data/test/unit/plugins/commands/plugin/action/expunge_plugins_test.rb +1 -1
- data/test/unit/plugins/commands/plugin/action/install_gem_test.rb +3 -3
- data/test/unit/plugins/commands/plugin/action/plugin_exists_check_test.rb +3 -3
- data/test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb +1 -1
- data/test/unit/plugins/commands/plugin/action/update_gems_test.rb +2 -2
- data/test/unit/plugins/commands/port/command_test.rb +3 -3
- data/test/unit/plugins/commands/push/command_test.rb +1 -1
- data/test/unit/plugins/commands/snapshot/command/list_test.rb +2 -3
- data/test/unit/plugins/commands/ssh_config/command_test.rb +1 -1
- data/test/unit/plugins/commands/up/command_test.rb +69 -2
- data/test/unit/plugins/commands/validate/command_test.rb +47 -1
- data/test/unit/plugins/communicators/ssh/communicator_test.rb +5 -5
- data/test/unit/plugins/communicators/winrm/communicator_test.rb +6 -6
- data/test/unit/plugins/communicators/winrm/helper_test.rb +24 -23
- data/test/unit/plugins/communicators/winssh/communicator_test.rb +5 -5
- data/test/unit/plugins/guests/darwin/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb +1 -1
- data/test/unit/plugins/guests/freebsd/cap/shell_expand_guest_path_test.rb +44 -0
- data/test/unit/plugins/guests/linux/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/netbsd/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/omnios/cap/mount_nfs_folder_test.rb +1 -3
- data/test/unit/plugins/guests/openbsd/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/smartos/cap/change_host_name_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/configure_networks_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/halt_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/insert_public_key_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/rsync_test.rb +2 -2
- data/test/unit/plugins/guests/windows/cap/insert_public_key_test.rb +2 -2
- data/test/unit/plugins/guests/windows/cap/remove_public_key_test.rb +4 -3
- data/test/unit/plugins/guests/windows/config_test.rb +1 -1
- data/test/unit/plugins/guests/windows/guest_network_test.rb +2 -2
- data/test/unit/plugins/hosts/linux/cap/nfs_test.rb +2 -0
- data/test/unit/plugins/kernel_v2/config/push_test.rb +1 -1
- data/test/unit/plugins/kernel_v2/config/vm_test.rb +7 -7
- data/test/unit/plugins/providers/docker/action/create_test.rb +1 -1
- data/test/unit/plugins/providers/docker/command/exec_test.rb +1 -1
- data/test/unit/plugins/providers/docker/config_test.rb +23 -4
- data/test/unit/plugins/providers/docker/driver_compose_test.rb +60 -30
- data/test/unit/plugins/providers/docker/driver_test.rb +31 -31
- data/test/unit/plugins/providers/docker/synced_folder_test.rb +3 -3
- data/test/unit/plugins/providers/hyperv/provider_test.rb +19 -19
- data/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb +2 -2
- data/test/unit/plugins/providers/virtualbox/action/network_test.rb +1 -1
- data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +34 -8
- data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb +3 -3
- data/test/unit/plugins/providers/virtualbox/cap_test.rb +2 -2
- data/test/unit/plugins/providers/virtualbox/config_test.rb +6 -6
- data/test/unit/plugins/providers/virtualbox/synced_folder_test.rb +6 -8
- data/test/unit/plugins/provisioners/ansible/config/guest_test.rb +1 -1
- data/test/unit/plugins/provisioners/ansible/config/host_test.rb +4 -4
- data/test/unit/plugins/provisioners/ansible/config/shared.rb +2 -2
- data/test/unit/plugins/provisioners/ansible/provisioner_test.rb +165 -157
- data/test/unit/plugins/provisioners/chef/command_builder_test.rb +2 -2
- data/test/unit/plugins/provisioners/chef/config/base_test.rb +13 -0
- data/test/unit/plugins/provisioners/chef/config/chef_zero_test.rb +11 -0
- data/test/unit/plugins/provisioners/chef/omnibus_test.rb +17 -7
- data/test/unit/plugins/provisioners/docker/config_test.rb +2 -1
- data/test/unit/plugins/provisioners/docker/provisioner_test.rb +13 -13
- data/test/unit/plugins/provisioners/file/provisioner_test.rb +32 -14
- data/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb +51 -0
- data/test/unit/plugins/provisioners/salt/provisioner_test.rb +5 -5
- data/test/unit/plugins/provisioners/shell/provisioner_test.rb +35 -4
- data/test/unit/plugins/pushes/ftp/adapter_test.rb +1 -0
- data/test/unit/plugins/synced_folders/nfs/action_cleanup_test.rb +1 -1
- data/test/unit/plugins/synced_folders/nfs/config_test.rb +1 -1
- data/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb +44 -12
- data/test/unit/plugins/synced_folders/rsync/command/rsync_test.rb +5 -5
- data/test/unit/plugins/synced_folders/rsync/helper_test.rb +47 -29
- data/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb +5 -5
- data/test/unit/vagrant/action/builtin/box_add_test.rb +27 -27
- data/test/unit/vagrant/action/builtin/box_check_outdated_test.rb +10 -10
- data/test/unit/vagrant/action/builtin/box_remove_test.rb +15 -15
- data/test/unit/vagrant/action/builtin/confirm_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/graceful_halt_test.rb +2 -2
- data/test/unit/vagrant/action/builtin/handle_box_test.rb +8 -8
- data/test/unit/vagrant/action/builtin/handle_forwarded_port_collisions_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/is_env_set_test.rb +2 -2
- data/test/unit/vagrant/action/builtin/is_state_test.rb +6 -6
- data/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb +6 -6
- data/test/unit/vagrant/action/builtin/provision_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/provisioner_cleanup_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb +6 -6
- data/test/unit/vagrant/action/builtin/synced_folders_test.rb +3 -3
- data/test/unit/vagrant/batch_action_test.rb +2 -2
- data/test/unit/vagrant/box_collection_test.rb +1 -1
- data/test/unit/vagrant/box_test.rb +6 -6
- data/test/unit/vagrant/capability_host_test.rb +3 -3
- data/test/unit/vagrant/cli_test.rb +3 -3
- data/test/unit/vagrant/environment_test.rb +21 -20
- data/test/unit/vagrant/guest_test.rb +7 -7
- data/test/unit/vagrant/machine_index_test.rb +4 -4
- data/test/unit/vagrant/machine_test.rb +28 -17
- data/test/unit/vagrant/plugin/manager_test.rb +12 -12
- data/test/unit/vagrant/plugin/state_file_test.rb +2 -2
- data/test/unit/vagrant/plugin/v1/command_test.rb +9 -8
- data/test/unit/vagrant/plugin/v2/command_test.rb +54 -43
- data/test/unit/vagrant/plugin/v2/plugin_test.rb +4 -3
- data/test/unit/vagrant/plugin/v2/provider_test.rb +3 -3
- data/test/unit/vagrant/shared_helpers_test.rb +6 -6
- data/test/unit/vagrant/ui_test.rb +21 -21
- data/test/unit/vagrant/util/downloader_test.rb +7 -7
- data/test/unit/vagrant/util/ssh_test.rb +41 -5
- data/test/unit/vagrant/util/subprocess_test.rb +7 -7
- data/test/unit/vagrant_test.rb +9 -9
- data/vagrant.gemspec +3 -2
- data/vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/vagrant-spec.gemspec +1 -1
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.gitignore +7 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.rspec +2 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.travis.yml +5 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/CONTRIBUTORS.md +19 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Gemfile +12 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Gemfile.lock +44 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Guardfile +10 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/README.md +134 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Rakefile +10 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/fake_ftp.gemspec +22 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp.rb +5 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/file.rb +34 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/server.rb +340 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/version.rb +3 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/fixtures/invisible_bike.jpg +0 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/fixtures/text_file.txt +1 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/functional/server_spec.rb +468 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/integration/server_spec.rb +81 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/models/fake_ftp/file_spec.rb +102 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/models/fake_ftp/server_spec.rb +76 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/spec_helper.rb +18 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.gitignore +14 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.rubocop.yml +57 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.travis.yml +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/CONTRIBUTING.rdoc +36 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/Gemfile +3 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/History.rdoc +2247 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/README.rdoc +156 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/Rakefile +38 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/appveyor.yml +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/bin/console +7 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/bin/setup +6 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rake.1 +156 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rakefile.rdoc +622 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake +27 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake.rb +70 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/application.rb +785 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/backtrace.rb +23 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/clean.rb +77 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/cpu_counter.rb +106 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/default_loader.rb +14 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/dsl_definition.rb +194 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/early_time.rb +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/ext/core.rb +25 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/ext/string.rb +175 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_list.rb +434 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_task.rb +46 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb +136 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_utils_ext.rb +144 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/invocation_chain.rb +56 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/late_time.rb +17 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/linked_list.rb +111 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/loaders/makefile.rb +53 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/multi_task.rb +49 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/name_space.rb +37 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/packagetask.rb +210 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/phony.rb +15 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/promise.rb +99 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/pseudo_status.rb +29 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rake_module.rb +38 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rule_recursion_overflow_error.rb +19 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/scope.rb +42 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb +390 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_arguments.rb +108 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_manager.rb +303 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/tasklib.rb +11 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/testtask.rb +222 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/thread_pool.rb +162 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/trace_output.rb +22 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/version.rb +9 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/win32.rb +50 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/rake.gemspec +39 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.gitignore +19 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.rspec +3 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.travis.yml +24 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Changelog.md +49 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Gemfile +26 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/README.md +72 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Rakefile +16 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/cucumber.yml +2 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/its.feature +125 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/step_definitions/additional_cli_steps.rb +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/support/env.rb +23 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/lib/rspec/its.rb +149 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/lib/rspec/its/version.rb +5 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/rspec-its.gemspec +28 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/script/test_all +20 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/spec/rspec/its_spec.rb +237 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/spec/spec_helper.rb +15 -0
- data/vendor/bundle/ruby/2.4.0/specifications/fake_ftp-0.1.1.gemspec +20 -0
- data/vendor/bundle/ruby/2.4.0/specifications/rake-12.0.0.gemspec +43 -0
- data/vendor/bundle/ruby/2.4.0/specifications/rspec-its-1.2.0.gemspec +47 -0
- data/version.txt +1 -1
- metadata +137 -7
- data/2.14.0 +0 -5
@@ -7,8 +7,8 @@ require Vagrant.source_root.join("plugins/providers/virtualbox/synced_folder")
|
|
7
7
|
describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do
|
8
8
|
let(:machine) do
|
9
9
|
double("machine").tap do |m|
|
10
|
-
m.
|
11
|
-
m.
|
10
|
+
allow(m).to receive(:provider_config).and_return(VagrantPlugins::ProviderVirtualBox::Config.new)
|
11
|
+
allow(m).to receive(:provider_name).and_return(:virtualbox)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -20,12 +20,12 @@ describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do
|
|
20
20
|
|
21
21
|
describe "usable" do
|
22
22
|
it "should be with virtualbox provider" do
|
23
|
-
machine.
|
23
|
+
allow(machine).to receive(:provider_name).and_return(:virtualbox)
|
24
24
|
expect(subject).to be_usable(machine)
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should not be with another provider" do
|
28
|
-
machine.
|
28
|
+
allow(machine).to receive(:provider_name).and_return(:vmware_fusion)
|
29
29
|
expect(subject).not_to be_usable(machine)
|
30
30
|
end
|
31
31
|
|
@@ -39,11 +39,9 @@ describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do
|
|
39
39
|
let(:driver) { double("driver") }
|
40
40
|
|
41
41
|
before do
|
42
|
-
machine.
|
42
|
+
allow(machine).to receive(:driver).and_return(driver)
|
43
43
|
end
|
44
44
|
|
45
|
-
it "should share the folders"
|
46
|
-
pending
|
47
|
-
end
|
45
|
+
it "should share the folders"
|
48
46
|
end
|
49
47
|
end
|
@@ -51,7 +51,7 @@ describe VagrantPlugins::Ansible::Config::Guest do
|
|
51
51
|
it "assigns default values to unset guest-specific options" do
|
52
52
|
subject.finalize!
|
53
53
|
|
54
|
-
expect(subject.install).to
|
54
|
+
expect(subject.install).to be(true)
|
55
55
|
expect(subject.install_mode).to eql(:default)
|
56
56
|
expect(subject.provisioning_path).to eql("/vagrant")
|
57
57
|
expect(subject.tmp_path).to eql("/tmp/vagrant-ansible")
|
@@ -47,10 +47,10 @@ describe VagrantPlugins::Ansible::Config::Host, :skip_windows => true do
|
|
47
47
|
it "assigns default values to unset host-specific options" do
|
48
48
|
subject.finalize!
|
49
49
|
|
50
|
-
expect(subject.ask_sudo_pass).to
|
51
|
-
expect(subject.ask_vault_pass).to
|
52
|
-
expect(subject.force_remote_user).to
|
53
|
-
expect(subject.host_key_checking).to
|
50
|
+
expect(subject.ask_sudo_pass).to be(false)
|
51
|
+
expect(subject.ask_vault_pass).to be(false)
|
52
|
+
expect(subject.force_remote_user).to be(true)
|
53
|
+
expect(subject.host_key_checking).to be(false)
|
54
54
|
expect(subject.raw_ssh_args).to be_nil
|
55
55
|
end
|
56
56
|
end
|
@@ -17,11 +17,11 @@ shared_examples_for 'options shared by both Ansible provisioners' do
|
|
17
17
|
expect(subject.raw_arguments).to be_nil
|
18
18
|
expect(subject.skip_tags).to be_nil
|
19
19
|
expect(subject.start_at_task).to be_nil
|
20
|
-
expect(subject.sudo).to
|
20
|
+
expect(subject.sudo).to be(false)
|
21
21
|
expect(subject.sudo_user).to be_nil
|
22
22
|
expect(subject.tags).to be_nil
|
23
23
|
expect(subject.vault_password_file).to be_nil
|
24
|
-
expect(subject.verbose).to
|
24
|
+
expect(subject.verbose).to be(false)
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
@@ -45,20 +45,22 @@ VF
|
|
45
45
|
host: '127.0.0.1',
|
46
46
|
port: 2223
|
47
47
|
}}
|
48
|
+
let(:default_execute_result) { Vagrant::Util::Subprocess::Result.new(0, "", "") }
|
48
49
|
|
49
50
|
let(:existing_file) { File.expand_path(__FILE__) }
|
50
51
|
let(:generated_inventory_dir) { File.join(machine.env.local_data_path, %w(provisioners ansible inventory)) }
|
51
52
|
let(:generated_inventory_file) { File.join(generated_inventory_dir, 'vagrant_ansible_inventory') }
|
52
53
|
|
53
54
|
before do
|
54
|
-
Vagrant::Util::Platform.
|
55
|
+
allow(Vagrant::Util::Platform).to receive(:solaris?).and_return(false)
|
55
56
|
|
56
|
-
machine.
|
57
|
-
machine.env.
|
57
|
+
allow(machine).to receive(:ssh_info).and_return(ssh_info)
|
58
|
+
allow(machine.env).to receive(:active_machines)
|
59
|
+
.and_return([[iso_env.machine_names[0], :dummy], [iso_env.machine_names[1], :dummy]])
|
58
60
|
|
59
61
|
stubbed_ui = Vagrant::UI::Colored.new
|
60
|
-
stubbed_ui.
|
61
|
-
machine.env.
|
62
|
+
allow(stubbed_ui).to receive(:detail).and_return("")
|
63
|
+
allow(machine.env).to receive(:ui).and_return(stubbed_ui)
|
62
64
|
|
63
65
|
config.playbook = 'playbook.yml'
|
64
66
|
end
|
@@ -74,7 +76,7 @@ VF
|
|
74
76
|
expected_transport_mode = "ssh")
|
75
77
|
|
76
78
|
it "sets implicit arguments in a specific order" do
|
77
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
79
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
78
80
|
|
79
81
|
expect(args[0]).to eq("ansible-playbook")
|
80
82
|
expect(args[1]).to eq("--connection=ssh")
|
@@ -84,11 +86,11 @@ VF
|
|
84
86
|
expect(inventory_count).to be > 0
|
85
87
|
|
86
88
|
expect(args[args.length-2]).to eq("playbook.yml")
|
87
|
-
}
|
89
|
+
}.and_return(default_execute_result)
|
88
90
|
end
|
89
91
|
|
90
92
|
it "sets --limit argument" do
|
91
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
93
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
92
94
|
all_limits = args.select { |x| x =~ /^(--limit=|-l)/ }
|
93
95
|
if config.raw_arguments
|
94
96
|
raw_limits = config.raw_arguments.select { |x| x =~ /^(--limit=|-l)/ }
|
@@ -102,11 +104,11 @@ VF
|
|
102
104
|
expect(all_limits.first).to eq("--limit=#{machine.name}")
|
103
105
|
end
|
104
106
|
end
|
105
|
-
}
|
107
|
+
}.and_return(default_execute_result)
|
106
108
|
end
|
107
109
|
|
108
110
|
it "exports environment variables" do
|
109
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
111
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
110
112
|
cmd_opts = args.last
|
111
113
|
|
112
114
|
if expected_host_key_checking
|
@@ -119,30 +121,30 @@ VF
|
|
119
121
|
expect(cmd_opts[:env]).to_not include("ANSIBLE_NOCOLOR")
|
120
122
|
expect(cmd_opts[:env]['ANSIBLE_HOST_KEY_CHECKING']).to eql(expected_host_key_checking.to_s)
|
121
123
|
expect(cmd_opts[:env]['PYTHONUNBUFFERED']).to eql(1)
|
122
|
-
}
|
124
|
+
}.and_return(default_execute_result)
|
123
125
|
end
|
124
126
|
|
125
127
|
# "roughly" verify that only expected args/vars have been defined by the provisioner
|
126
128
|
it "sets the expected number of arguments and environment variables" do
|
127
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
129
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
128
130
|
expect(args.length-2).to eq(expected_args_count)
|
129
131
|
expect(args.last[:env].length).to eq(expected_vars_count)
|
130
|
-
}
|
132
|
+
}.and_return(default_execute_result)
|
131
133
|
end
|
132
134
|
|
133
135
|
it "enables '#{expected_transport_mode}' as default transport mode" do
|
134
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
136
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
135
137
|
index = args.rindex("--connection=#{expected_transport_mode}")
|
136
138
|
expect(index).to be > 0
|
137
|
-
expect(find_last_argument_after(index, args, /--connection=\w+/)).to
|
138
|
-
}
|
139
|
+
expect(find_last_argument_after(index, args, /--connection=\w+/)).to be(false)
|
140
|
+
}.and_return(default_execute_result)
|
139
141
|
end
|
140
142
|
|
141
143
|
end
|
142
144
|
|
143
145
|
def self.it_should_set_optional_arguments(arg_map)
|
144
146
|
it "sets optional arguments" do
|
145
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
147
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
146
148
|
arg_map.each_pair do |vagrant_option, ansible_argument|
|
147
149
|
index = args.index(ansible_argument)
|
148
150
|
if config.send(vagrant_option)
|
@@ -151,25 +153,25 @@ VF
|
|
151
153
|
expect(index).to be_nil
|
152
154
|
end
|
153
155
|
end
|
154
|
-
}
|
156
|
+
}.and_return(default_execute_result)
|
155
157
|
end
|
156
158
|
end
|
157
159
|
|
158
160
|
def self.it_should_explicitly_enable_ansible_ssh_control_persist_defaults
|
159
161
|
it "configures ControlPersist (like Ansible defaults) via ANSIBLE_SSH_ARGS" do
|
160
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
162
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
161
163
|
cmd_opts = args.last
|
162
164
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o ControlMaster=auto")
|
163
165
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o ControlPersist=60s")
|
164
|
-
}
|
166
|
+
}.and_return(default_execute_result)
|
165
167
|
end
|
166
168
|
end
|
167
169
|
|
168
170
|
def self.it_should_create_and_use_generated_inventory(with_ssh_user = true)
|
169
171
|
it "generates an inventory with all active machines" do
|
170
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
172
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
171
173
|
expect(config.inventory_path).to be_nil
|
172
|
-
expect(File.exists?(generated_inventory_file)).to
|
174
|
+
expect(File.exists?(generated_inventory_file)).to be(true)
|
173
175
|
inventory_content = File.read(generated_inventory_file)
|
174
176
|
if with_ssh_user
|
175
177
|
expect(inventory_content).to include("#{machine.name} ansible_ssh_host=#{machine.ssh_info[:host]} ansible_ssh_port=#{machine.ssh_info[:port]} ansible_ssh_user='#{machine.ssh_info[:username]}' ansible_ssh_private_key_file='#{machine.ssh_info[:private_key_path][0]}'\n")
|
@@ -177,31 +179,32 @@ VF
|
|
177
179
|
expect(inventory_content).to include("#{machine.name} ansible_ssh_host=#{machine.ssh_info[:host]} ansible_ssh_port=#{machine.ssh_info[:port]} ansible_ssh_private_key_file='#{machine.ssh_info[:private_key_path][0]}'\n")
|
178
180
|
end
|
179
181
|
expect(inventory_content).to include("# MISSING: '#{iso_env.machine_names[1]}' machine was probably removed without using Vagrant. This machine should be recreated.\n")
|
180
|
-
}
|
182
|
+
}.and_return(default_execute_result)
|
181
183
|
end
|
182
184
|
|
183
185
|
it "sets as ansible inventory the directory containing the auto-generated inventory file" do
|
184
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
186
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
185
187
|
inventory_index = args.rindex("--inventory-file=#{generated_inventory_dir}")
|
186
188
|
expect(inventory_index).to be > 0
|
187
|
-
expect(find_last_argument_after(inventory_index, args, /--inventory-file=\w+/)).to
|
188
|
-
}
|
189
|
+
expect(find_last_argument_after(inventory_index, args, /--inventory-file=\w+/)).to be(false)
|
190
|
+
}.and_return(default_execute_result)
|
189
191
|
end
|
190
192
|
end
|
191
193
|
|
192
194
|
describe "#provision" do
|
193
195
|
|
194
196
|
before do
|
195
|
-
unless
|
197
|
+
unless RSpec.current_example.metadata[:skip_before]
|
196
198
|
config.finalize!
|
197
199
|
|
198
|
-
Vagrant::Util::Subprocess.
|
199
|
-
|
200
|
+
allow(Vagrant::Util::Subprocess).to receive(:execute)
|
201
|
+
.and_return(Vagrant::Util::Subprocess::Result.new(0, "", ""))
|
202
|
+
allow(subject).to receive(:check_path)
|
200
203
|
end
|
201
204
|
end
|
202
205
|
|
203
206
|
after do
|
204
|
-
unless
|
207
|
+
unless RSpec.current_example.metadata[:skip_after]
|
205
208
|
subject.provision
|
206
209
|
end
|
207
210
|
end
|
@@ -211,7 +214,7 @@ VF
|
|
211
214
|
STUBBED_INVALID_PATH = "/test/239nfmd/invalid_path".freeze
|
212
215
|
|
213
216
|
it 'raises an error when the `playbook` file does not exist', skip_before: true, skip_after: true do
|
214
|
-
subject.
|
217
|
+
allow(subject).to receive(:check_path).and_raise(VagrantPlugins::Ansible::Errors::AnsibleError,
|
215
218
|
_key: :config_file_not_found,
|
216
219
|
config_option: "playbook",
|
217
220
|
path: STUBBED_INVALID_PATH,
|
@@ -226,7 +229,8 @@ VF
|
|
226
229
|
|
227
230
|
%w(config_file extra_vars inventory_path galaxy_role_file vault_password_file).each do |option_name|
|
228
231
|
it "raises an error when the '#{option_name}' does not exist", skip_before: true, skip_after: true do
|
229
|
-
|
232
|
+
allow(Vagrant::Util::Subprocess).to receive(:execute)
|
233
|
+
.and_return( Vagrant::Util::Subprocess::Result.new(0, "", ""))
|
230
234
|
|
231
235
|
config.playbook = existing_file
|
232
236
|
config.send(option_name + '=', STUBBED_INVALID_PATH)
|
@@ -247,8 +251,9 @@ VF
|
|
247
251
|
it "raises an error", skip_before: true, skip_after: true do
|
248
252
|
config.finalize!
|
249
253
|
|
250
|
-
subject.
|
251
|
-
Vagrant::Util::Subprocess.
|
254
|
+
allow(subject).to receive(:check_path)
|
255
|
+
allow(Vagrant::Util::Subprocess).to receive(:execute)
|
256
|
+
.and_return(Vagrant::Util::Subprocess::Result.new(1, "", ""))
|
252
257
|
|
253
258
|
expect {subject.provision}.to raise_error(VagrantPlugins::Ansible::Errors::AnsibleCommandFailed)
|
254
259
|
end
|
@@ -259,20 +264,14 @@ VF
|
|
259
264
|
it_should_create_and_use_generated_inventory
|
260
265
|
|
261
266
|
it "does not add any group section to the generated inventory" do
|
262
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with {
|
267
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) {
|
263
268
|
inventory_content = File.read(generated_inventory_file)
|
264
269
|
expect(inventory_content).to_not match(/^\s*\[^\\+\]\s*$/)
|
265
|
-
|
266
|
-
# Ending this block with a negative expectation (to_not / not_to)
|
267
|
-
# would lead to a failure of the above expectation.
|
268
|
-
true
|
269
|
-
}
|
270
|
+
}.and_return(default_execute_result)
|
270
271
|
end
|
271
272
|
|
272
273
|
it "doesn't show the ansible-playbook command" do
|
273
|
-
expect(machine.env.ui).
|
274
|
-
expect(full_command).to include("ansible-playbook")
|
275
|
-
}
|
274
|
+
expect(machine.env.ui).to_not receive(:detail).with(/ansible-playbook/)
|
276
275
|
end
|
277
276
|
end
|
278
277
|
|
@@ -282,9 +281,8 @@ VF
|
|
282
281
|
end
|
283
282
|
|
284
283
|
it "uses custom playbook_command to run playbooks" do
|
285
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute)
|
286
|
-
|
287
|
-
}
|
284
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute)
|
285
|
+
.with("custom-ansible-playbook", any_args)
|
288
286
|
end
|
289
287
|
end
|
290
288
|
|
@@ -295,40 +293,40 @@ VF
|
|
295
293
|
config.host_vars = {
|
296
294
|
machine1: {"http_port" => 80, "comments" => "'some text with spaces'"}
|
297
295
|
}
|
298
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with {
|
296
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) {
|
299
297
|
inventory_content = File.read(generated_inventory_file)
|
300
298
|
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 comments='some text with spaces'$")
|
301
|
-
}
|
299
|
+
}.and_return(default_execute_result)
|
302
300
|
end
|
303
301
|
|
304
302
|
it "adds host variables (given in Array format) to the generated inventory" do
|
305
303
|
config.host_vars = {
|
306
304
|
machine1: ["http_port=80", "maxRequestsPerChild=808"]
|
307
305
|
}
|
308
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with {
|
306
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) {
|
309
307
|
inventory_content = File.read(generated_inventory_file)
|
310
308
|
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 maxRequestsPerChild=808")
|
311
|
-
}
|
309
|
+
}.and_return(default_execute_result)
|
312
310
|
end
|
313
311
|
|
314
312
|
it "adds host variables (given in String format) to the generated inventory " do
|
315
313
|
config.host_vars = {
|
316
314
|
:machine1 => "http_port=80 maxRequestsPerChild=808"
|
317
315
|
}
|
318
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with {
|
316
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) {
|
319
317
|
inventory_content = File.read(generated_inventory_file)
|
320
318
|
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 maxRequestsPerChild=808")
|
321
|
-
}
|
319
|
+
}.and_return(default_execute_result)
|
322
320
|
end
|
323
321
|
|
324
322
|
it "retrieves the host variables by machine name, also in String format" do
|
325
323
|
config.host_vars = {
|
326
324
|
"machine1" => "http_port=80 maxRequestsPerChild=808"
|
327
325
|
}
|
328
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
326
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
329
327
|
inventory_content = File.read(generated_inventory_file)
|
330
328
|
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 maxRequestsPerChild=808")
|
331
|
-
}
|
329
|
+
}.and_return(default_execute_result)
|
332
330
|
end
|
333
331
|
end
|
334
332
|
|
@@ -347,7 +345,7 @@ VF
|
|
347
345
|
"bar:children" => ["group1", "group2", "group3", "group5"],
|
348
346
|
}
|
349
347
|
|
350
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
348
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
351
349
|
inventory_content = File.read(generated_inventory_file)
|
352
350
|
|
353
351
|
# Accept String instead of Array for group member list
|
@@ -372,7 +370,7 @@ VF
|
|
372
370
|
# A group of groups only includes declared groups
|
373
371
|
expect(inventory_content).not_to include("group5")
|
374
372
|
expect(inventory_content).to match(Regexp.quote("[bar:children]\ngroup1\ngroup2\ngroup3\n") + "$")
|
375
|
-
}
|
373
|
+
}.and_return(default_execute_result)
|
376
374
|
end
|
377
375
|
|
378
376
|
it "adds group vars to the generated inventory" do
|
@@ -385,7 +383,7 @@ VF
|
|
385
383
|
"group3:vars" => "stringvar1=stringvalue1 stringvar2=stringvalue2",
|
386
384
|
}
|
387
385
|
|
388
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
386
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
389
387
|
inventory_content = File.read(generated_inventory_file)
|
390
388
|
|
391
389
|
# Hash syntax
|
@@ -396,7 +394,7 @@ VF
|
|
396
394
|
|
397
395
|
# Single string syntax
|
398
396
|
expect(inventory_content).to include("[group3:vars]\nstringvar1=stringvalue1\nstringvar2=stringvalue2\n")
|
399
|
-
}
|
397
|
+
}.and_return(default_execute_result)
|
400
398
|
end
|
401
399
|
end
|
402
400
|
|
@@ -421,11 +419,11 @@ VF
|
|
421
419
|
it_should_set_optional_arguments({ "sudo_user" => "--sudo-user=root" })
|
422
420
|
|
423
421
|
it "it does not set boolean flag when corresponding option is set to false" do
|
424
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
422
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
425
423
|
expect(args.index("--sudo")).to be_nil
|
426
424
|
expect(args.index("--ask-sudo-pass")).to be_nil
|
427
425
|
expect(args.index("--ask-vault-pass")).to be_nil
|
428
|
-
}
|
426
|
+
}.and_return(default_execute_result)
|
429
427
|
end
|
430
428
|
end
|
431
429
|
|
@@ -450,26 +448,26 @@ VF
|
|
450
448
|
it_should_set_arguments_and_environment_variables 17, 4, false, "paramiko"
|
451
449
|
|
452
450
|
it "sets all raw arguments" do
|
453
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
451
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
454
452
|
config.raw_arguments.each do |raw_arg|
|
455
453
|
expect(args).to include(raw_arg)
|
456
454
|
end
|
457
|
-
}
|
455
|
+
}.and_return(default_execute_result)
|
458
456
|
end
|
459
457
|
|
460
458
|
it "sets raw arguments after arguments related to supported options" do
|
461
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
459
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
462
460
|
expect(args.index("--user=lion")).to be > args.index("--user=testuser")
|
463
461
|
expect(args.index("--inventory-file=/forget/it/my/friend")).to be > args.index("--inventory-file=#{generated_inventory_dir}")
|
464
462
|
expect(args.index("--limit=bar")).to be > args.index("--limit=all")
|
465
463
|
expect(args.index("--skip-tags=ignored")).to be > args.index("--skip-tags=foo,bar")
|
466
|
-
}
|
464
|
+
}.and_return(default_execute_result)
|
467
465
|
end
|
468
466
|
|
469
467
|
it "sets boolean flag (e.g. --sudo) defined in raw_arguments, even if corresponding option is set to false" do
|
470
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
468
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
471
469
|
expect(args).to include('--sudo')
|
472
|
-
}
|
470
|
+
}.and_return(default_execute_result)
|
473
471
|
end
|
474
472
|
|
475
473
|
end
|
@@ -492,10 +490,10 @@ VF
|
|
492
490
|
it_should_set_arguments_and_environment_variables 6
|
493
491
|
|
494
492
|
it "uses a --user argument to set a default remote user" do
|
495
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
493
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
496
494
|
expect(args).not_to include("--extra-vars=ansible_ssh_user='#{machine.ssh_info[:username]}'")
|
497
495
|
expect(args).to include("--user=#{machine.ssh_info[:username]}")
|
498
|
-
}
|
496
|
+
}.and_return(default_execute_result)
|
499
497
|
end
|
500
498
|
end
|
501
499
|
|
@@ -524,13 +522,13 @@ VF
|
|
524
522
|
|
525
523
|
it "generates an inventory with winrm connection settings" do
|
526
524
|
|
527
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
525
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
528
526
|
expect(config.inventory_path).to be_nil
|
529
|
-
expect(File.exists?(generated_inventory_file)).to
|
527
|
+
expect(File.exists?(generated_inventory_file)).to be(true)
|
530
528
|
inventory_content = File.read(generated_inventory_file)
|
531
529
|
|
532
530
|
expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_user='winner' ansible_ssh_pass='winword'\n")
|
533
|
-
}
|
531
|
+
}.and_return(default_execute_result)
|
534
532
|
end
|
535
533
|
|
536
534
|
describe "with force_remote_user option disabled" do
|
@@ -539,12 +537,12 @@ VF
|
|
539
537
|
end
|
540
538
|
|
541
539
|
it "doesn't set the ansible remote user in inventory and use '--user' argument with the vagrant ssh username" do
|
542
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
540
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
543
541
|
inventory_content = File.read(generated_inventory_file)
|
544
542
|
|
545
543
|
expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_pass='winword'\n")
|
546
544
|
expect(args).to include("--user=testuser")
|
547
|
-
}
|
545
|
+
}.and_return(default_execute_result)
|
548
546
|
end
|
549
547
|
end
|
550
548
|
end
|
@@ -557,18 +555,18 @@ VF
|
|
557
555
|
it_should_set_arguments_and_environment_variables 6
|
558
556
|
|
559
557
|
it "does not generate the inventory and uses given inventory path instead" do
|
560
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
558
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
561
559
|
expect(args).to include("--inventory-file=#{existing_file}")
|
562
560
|
expect(args).not_to include("--inventory-file=#{generated_inventory_file}")
|
563
|
-
expect(File.exists?(generated_inventory_file)).to
|
564
|
-
}
|
561
|
+
expect(File.exists?(generated_inventory_file)).to be(false)
|
562
|
+
}.and_return(default_execute_result)
|
565
563
|
end
|
566
564
|
|
567
565
|
it "uses an --extra-vars argument to force ansible_ssh_user parameter" do
|
568
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
566
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
569
567
|
expect(args).not_to include("--user=#{machine.ssh_info[:username]}")
|
570
568
|
expect(args).to include("--extra-vars=ansible_ssh_user='#{machine.ssh_info[:username]}'")
|
571
|
-
}
|
569
|
+
}.and_return(default_execute_result)
|
572
570
|
end
|
573
571
|
|
574
572
|
describe "with force_remote_user option disabled" do
|
@@ -577,10 +575,10 @@ VF
|
|
577
575
|
end
|
578
576
|
|
579
577
|
it "uses a --user argument to set a default remote user" do
|
580
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
578
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
581
579
|
expect(args).not_to include("--extra-vars=ansible_ssh_user='#{machine.ssh_info[:username]}'")
|
582
580
|
expect(args).to include("--user=#{machine.ssh_info[:username]}")
|
583
|
-
}
|
581
|
+
}.and_return(default_execute_result)
|
584
582
|
end
|
585
583
|
end
|
586
584
|
end
|
@@ -591,11 +589,11 @@ VF
|
|
591
589
|
end
|
592
590
|
|
593
591
|
it "sets ANSIBLE_CONFIG environment variable" do
|
594
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
592
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
595
593
|
cmd_opts = args.last
|
596
594
|
expect(cmd_opts[:env]).to include("ANSIBLE_CONFIG")
|
597
595
|
expect(cmd_opts[:env]['ANSIBLE_CONFIG']).to eql(existing_file)
|
598
|
-
}
|
596
|
+
}.and_return(default_execute_result)
|
599
597
|
end
|
600
598
|
end
|
601
599
|
|
@@ -607,9 +605,9 @@ VF
|
|
607
605
|
it_should_set_arguments_and_environment_variables 6
|
608
606
|
|
609
607
|
it "should ask the vault password" do
|
610
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
608
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
611
609
|
expect(args).to include("--ask-vault-pass")
|
612
|
-
}
|
610
|
+
}.and_return(default_execute_result)
|
613
611
|
end
|
614
612
|
end
|
615
613
|
|
@@ -621,9 +619,9 @@ VF
|
|
621
619
|
it_should_set_arguments_and_environment_variables 6
|
622
620
|
|
623
621
|
it "uses the given vault password file" do
|
624
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
622
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
625
623
|
expect(args).to include("--vault-password-file=#{existing_file}")
|
626
|
-
}
|
624
|
+
}.and_return(default_execute_result)
|
627
625
|
end
|
628
626
|
end
|
629
627
|
|
@@ -636,12 +634,12 @@ VF
|
|
636
634
|
it_should_explicitly_enable_ansible_ssh_control_persist_defaults
|
637
635
|
|
638
636
|
it "passes custom SSH options via ANSIBLE_SSH_ARGS with the highest priority" do
|
639
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
637
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
640
638
|
cmd_opts = args.last
|
641
639
|
raw_opt_index = cmd_opts[:env]['ANSIBLE_SSH_ARGS'].index("-o ControlMaster=no")
|
642
640
|
default_opt_index = cmd_opts[:env]['ANSIBLE_SSH_ARGS'].index("-o ControlMaster=auto")
|
643
641
|
expect(raw_opt_index).to be < default_opt_index
|
644
|
-
}
|
642
|
+
}.and_return(default_execute_result)
|
645
643
|
end
|
646
644
|
|
647
645
|
describe "and with ssh forwarding enabled" do
|
@@ -650,12 +648,12 @@ VF
|
|
650
648
|
end
|
651
649
|
|
652
650
|
it "sets '-o ForwardAgent=yes' via ANSIBLE_SSH_ARGS with higher priority than raw_ssh_args values" do
|
653
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
651
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
654
652
|
cmd_opts = args.last
|
655
653
|
forwardAgentYes = cmd_opts[:env]['ANSIBLE_SSH_ARGS'].index("-o ForwardAgent=yes")
|
656
654
|
forwardAgentNo = cmd_opts[:env]['ANSIBLE_SSH_ARGS'].index("-o ForwardAgent=no")
|
657
655
|
expect(forwardAgentYes).to be < forwardAgentNo
|
658
|
-
}
|
656
|
+
}.and_return(default_execute_result)
|
659
657
|
end
|
660
658
|
end
|
661
659
|
|
@@ -670,11 +668,25 @@ VF
|
|
670
668
|
it_should_explicitly_enable_ansible_ssh_control_persist_defaults
|
671
669
|
|
672
670
|
it "passes additional Identity Files via ANSIBLE_SSH_ARGS" do
|
673
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
671
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
674
672
|
cmd_opts = args.last
|
675
|
-
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-
|
676
|
-
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-
|
677
|
-
}
|
673
|
+
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o IdentityFile=/an/other/identity")
|
674
|
+
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o IdentityFile=/yet/an/other/key")
|
675
|
+
}.and_return(default_execute_result)
|
676
|
+
end
|
677
|
+
end
|
678
|
+
|
679
|
+
describe "with an identity file containing `%`" do
|
680
|
+
before do
|
681
|
+
ssh_info[:private_key_path] = ['/foo%bar/key', '/bar%%buz/key']
|
682
|
+
end
|
683
|
+
|
684
|
+
it "replaces `%` with `%%`" do
|
685
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
686
|
+
cmd_opts = args.last
|
687
|
+
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o IdentityFile=/foo%%bar/key")
|
688
|
+
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o IdentityFile=/bar%%%%buz/key")
|
689
|
+
}.and_return(default_execute_result)
|
678
690
|
end
|
679
691
|
end
|
680
692
|
|
@@ -687,10 +699,10 @@ VF
|
|
687
699
|
it_should_explicitly_enable_ansible_ssh_control_persist_defaults
|
688
700
|
|
689
701
|
it "enables SSH-Forwarding via ANSIBLE_SSH_ARGS" do
|
690
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
702
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
691
703
|
cmd_opts = args.last
|
692
704
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o ForwardAgent=yes")
|
693
|
-
}
|
705
|
+
}.and_return(default_execute_result)
|
694
706
|
end
|
695
707
|
end
|
696
708
|
|
@@ -700,10 +712,10 @@ VF
|
|
700
712
|
end
|
701
713
|
|
702
714
|
it "sets '-o ProxyCommand' via ANSIBLE_SSH_ARGS" do
|
703
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
715
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
704
716
|
cmd_opts = args.last
|
705
717
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o ProxyCommand='ssh -W %h:%p -q user@remote_libvirt_host'")
|
706
|
-
}
|
718
|
+
}.and_return(default_execute_result)
|
707
719
|
end
|
708
720
|
end
|
709
721
|
|
@@ -719,9 +731,8 @@ VF
|
|
719
731
|
it_should_set_optional_arguments({ "verbose" => "-#{verbose_option}" })
|
720
732
|
|
721
733
|
it "shows the ansible-playbook command and set verbosity to '-#{verbose_option}' level" do
|
722
|
-
expect(machine.env.ui).to receive(:detail)
|
723
|
-
|
724
|
-
}
|
734
|
+
expect(machine.env.ui).to receive(:detail)
|
735
|
+
.with("PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\"machine1\" --inventory-file=#{generated_inventory_dir} -#{verbose_option} playbook.yml")
|
725
736
|
end
|
726
737
|
end
|
727
738
|
|
@@ -734,9 +745,8 @@ VF
|
|
734
745
|
it_should_set_optional_arguments({ "verbose" => "-#{verbose_option}" })
|
735
746
|
|
736
747
|
it "shows the ansible-playbook command and set verbosity to '-#{verbose_option}' level" do
|
737
|
-
expect(machine.env.ui).to receive(:detail)
|
738
|
-
|
739
|
-
}
|
748
|
+
expect(machine.env.ui).to receive(:detail)
|
749
|
+
.with("PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\"machine1\" --inventory-file=#{generated_inventory_dir} -#{verbose_option} playbook.yml")
|
740
750
|
end
|
741
751
|
end
|
742
752
|
end
|
@@ -750,9 +760,8 @@ VF
|
|
750
760
|
it_should_set_optional_arguments({ "verbose" => "-v" })
|
751
761
|
|
752
762
|
it "shows the ansible-playbook command and set verbosity to '-v' level" do
|
753
|
-
expect(machine.env.ui).to receive(:detail)
|
754
|
-
|
755
|
-
}
|
763
|
+
expect(machine.env.ui).to receive(:detail)
|
764
|
+
.with("PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\"machine1\" --inventory-file=#{generated_inventory_dir} -v playbook.yml")
|
756
765
|
end
|
757
766
|
end
|
758
767
|
|
@@ -764,9 +773,7 @@ VF
|
|
764
773
|
it_should_set_arguments_and_environment_variables
|
765
774
|
|
766
775
|
it "doesn't show the ansible-playbook command" do
|
767
|
-
expect(machine.env.ui).
|
768
|
-
expect(full_command).to include("ansible-playbook")
|
769
|
-
}
|
776
|
+
expect(machine.env.ui).to_not receive(:detail).with(/ansible-playbook/)
|
770
777
|
end
|
771
778
|
end
|
772
779
|
|
@@ -774,15 +781,15 @@ VF
|
|
774
781
|
|
775
782
|
describe "without colorized output" do
|
776
783
|
before do
|
777
|
-
machine.env.
|
784
|
+
allow(machine.env).to receive(:ui).and_return(Vagrant::UI::Basic.new)
|
778
785
|
end
|
779
786
|
|
780
787
|
it "disables ansible-playbook colored output" do
|
781
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
788
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
782
789
|
cmd_opts = args.last
|
783
790
|
expect(cmd_opts[:env]).to_not include("ANSIBLE_FORCE_COLOR")
|
784
791
|
expect(cmd_opts[:env]['ANSIBLE_NOCOLOR']).to eql("true")
|
785
|
-
}
|
792
|
+
}.and_return(default_execute_result)
|
786
793
|
end
|
787
794
|
end
|
788
795
|
|
@@ -795,23 +802,38 @@ VF
|
|
795
802
|
it "raises an error when ansible-galaxy command fails", skip_before: true, skip_after: true do
|
796
803
|
config.finalize!
|
797
804
|
|
798
|
-
subject.
|
799
|
-
Vagrant::Util::Subprocess.
|
805
|
+
allow(subject).to receive(:check_path)
|
806
|
+
allow(Vagrant::Util::Subprocess).to receive(:execute)
|
807
|
+
.and_return(Vagrant::Util::Subprocess::Result.new(1, "", ""))
|
800
808
|
|
801
809
|
expect {subject.provision}.to raise_error(VagrantPlugins::Ansible::Errors::AnsibleCommandFailed)
|
802
810
|
end
|
803
811
|
|
804
|
-
it "execute ansible-galaxy and ansible-playbook" do
|
805
|
-
|
806
|
-
|
812
|
+
it "execute ansible-galaxy, and then ansible-playbook" do
|
813
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute)
|
814
|
+
.once
|
815
|
+
.with('ansible-galaxy', any_args)
|
816
|
+
.and_return(default_execute_result)
|
817
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute)
|
818
|
+
.once
|
819
|
+
.with('ansible-playbook', any_args)
|
820
|
+
.and_return(default_execute_result)
|
821
|
+
end
|
822
|
+
|
823
|
+
it "doesn't show the ansible-galaxy command" do
|
824
|
+
expect(machine.env.ui).to_not receive(:detail).with(/ansible-galaxy/)
|
807
825
|
end
|
808
826
|
|
809
827
|
describe "with verbose option enabled" do
|
810
828
|
before do
|
829
|
+
config.galaxy_roles_path = "/tmp/roles"
|
811
830
|
config.verbose = true
|
812
831
|
end
|
813
832
|
|
814
|
-
|
833
|
+
it "shows the ansible-galaxy command in use" do
|
834
|
+
expect(machine.env.ui).to receive(:detail)
|
835
|
+
.with(%Q(ansible-galaxy install --role-file='#{existing_file}' --roles-path='/tmp/roles' --force))
|
836
|
+
end
|
815
837
|
end
|
816
838
|
end
|
817
839
|
|
@@ -821,11 +843,11 @@ VF
|
|
821
843
|
end
|
822
844
|
|
823
845
|
it "sets ANSIBLE_ROLES_PATH with corresponding absolute path" do
|
824
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
846
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
825
847
|
cmd_opts = args.last
|
826
848
|
expect(cmd_opts[:env]).to include("ANSIBLE_ROLES_PATH")
|
827
849
|
expect(cmd_opts[:env]['ANSIBLE_ROLES_PATH']).to eql(File.join(machine.env.root_path, "my-roles"))
|
828
|
-
}
|
850
|
+
}.and_return(default_execute_result)
|
829
851
|
end
|
830
852
|
end
|
831
853
|
|
@@ -848,7 +870,7 @@ VF
|
|
848
870
|
end
|
849
871
|
|
850
872
|
# The Vagrant Ansible provisioner does not validate the coherency of
|
851
|
-
# argument combinations, and
|
873
|
+
# argument combinations, and lets ansible-playbook complain.
|
852
874
|
describe "with a maximum of options" do
|
853
875
|
before do
|
854
876
|
# vagrant general options
|
@@ -892,19 +914,18 @@ VF
|
|
892
914
|
})
|
893
915
|
|
894
916
|
it "also includes given raw arguments" do
|
895
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
917
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
896
918
|
expect(args).to include("--why-not")
|
897
919
|
expect(args).to include("--su-user=foot")
|
898
920
|
expect(args).to include("--ask-su-pass")
|
899
921
|
expect(args).to include("--limit=all")
|
900
922
|
expect(args).to include("--private-key=./myself.key")
|
901
|
-
}
|
923
|
+
}.and_return(default_execute_result)
|
902
924
|
end
|
903
925
|
|
904
926
|
it "shows the ansible-playbook command, with additional quotes when required" do
|
905
|
-
expect(machine.env.ui).to receive(:detail)
|
906
|
-
|
907
|
-
}
|
927
|
+
expect(machine.env.ui).to receive(:detail)
|
928
|
+
.with(%Q(PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_ROLES_PATH='/up/to the stars' ANSIBLE_CONFIG='#{existing_file}' ANSIBLE_HOST_KEY_CHECKING=true ANSIBLE_SSH_ARGS='-o IdentitiesOnly=yes -o IdentityFile=/my/key1 -o IdentityFile=/my/key2 -o ForwardAgent=yes -o ControlMaster=no -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --ask-sudo-pass --ask-vault-pass --limit="machine*:&vagrant:!that_one" --inventory-file=#{generated_inventory_dir} --extra-vars="{\\"var1\\":\\"string with 'apostrophes', \\\\\\\\, \\\\\\" and =\\",\\"var2\\":{\\"x\\":42}}" --sudo --sudo-user=deployer -vvv --vault-password-file=#{existing_file} --tags=db,www --skip-tags=foo,bar --start-at-task="joe's awesome task" --why-not --su-user=foot --ask-su-pass --limit=all --private-key=./myself.key --extra-vars='{\"var3\":\"foo\"}' playbook.yml))
|
908
929
|
end
|
909
930
|
end
|
910
931
|
|
@@ -922,21 +943,21 @@ VF
|
|
922
943
|
}}
|
923
944
|
let(:fake_host_vm) {
|
924
945
|
double("host_vm").tap do |h|
|
925
|
-
h.
|
946
|
+
allow(h).to receive(:ssh_info).and_return(fake_host_ssh_info)
|
926
947
|
end
|
927
948
|
}
|
928
949
|
|
929
950
|
before do
|
930
|
-
machine.
|
931
|
-
machine.provider.
|
932
|
-
machine.provider.
|
951
|
+
allow(machine).to receive(:provider_name).and_return(:docker)
|
952
|
+
allow(machine.provider).to receive(:host_vm?).and_return(true)
|
953
|
+
allow(machine.provider).to receive(:host_vm).and_return(fake_host_vm)
|
933
954
|
end
|
934
955
|
|
935
956
|
it "uses an SSH ProxyCommand to reach the VM" do
|
936
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
957
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
937
958
|
cmd_opts = args.last
|
938
959
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o ProxyCommand='ssh boot9docker@127.0.0.1 -p 2299 -i /path/to/docker/host/key -o Compression=yes -o ConnectTimeout=5 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no exec nc %h %p 2>/dev/null'")
|
939
|
-
}
|
960
|
+
}.and_return(default_execute_result)
|
940
961
|
end
|
941
962
|
end
|
942
963
|
|
@@ -946,45 +967,36 @@ VF
|
|
946
967
|
|
947
968
|
context "on a Windows host" do
|
948
969
|
before do
|
949
|
-
Vagrant::Util::Platform.
|
950
|
-
machine.ui.
|
970
|
+
allow(Vagrant::Util::Platform).to receive(:windows?).and_return(true)
|
971
|
+
allow(machine.ui).to receive(:warn)
|
951
972
|
end
|
952
973
|
|
953
974
|
it "warns that Windows is not officially supported for the Ansible control machine" do
|
954
|
-
expect(machine.env.ui).to receive(:warn)
|
955
|
-
|
956
|
-
}
|
975
|
+
expect(machine.env.ui).to receive(:warn)
|
976
|
+
.with(I18n.t("vagrant.provisioners.ansible.windows_not_supported_for_control_machine"))
|
957
977
|
end
|
958
978
|
end
|
959
979
|
|
960
980
|
context "on a Solaris-like host" do
|
961
981
|
before do
|
962
|
-
Vagrant::Util::Platform.
|
982
|
+
allow(Vagrant::Util::Platform).to receive(:solaris?).and_return(true)
|
963
983
|
end
|
964
984
|
|
965
985
|
it "does not set IdentitiesOnly=yes in ANSIBLE_SSH_ARGS" do
|
966
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
986
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
967
987
|
cmd_opts = args.last
|
968
988
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to_not include("-o IdentitiesOnly=yes")
|
969
|
-
|
970
|
-
# Ending this block with a negative expectation (to_not / not_to)
|
971
|
-
# would lead to a failure of the above expectation.
|
972
|
-
true
|
973
|
-
}
|
989
|
+
}.and_return(default_execute_result)
|
974
990
|
end
|
975
991
|
|
976
992
|
describe "and with host_key_checking option enabled" do
|
977
993
|
it "does not set ANSIBLE_SSH_ARGS environment variable" do
|
978
994
|
config.host_key_checking = true
|
979
995
|
|
980
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
996
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
981
997
|
cmd_opts = args.last
|
982
998
|
expect(cmd_opts[:env]).to_not include('ANSIBLE_SSH_ARGS')
|
983
|
-
|
984
|
-
# Ending this block with a negative expectation (to_not / not_to)
|
985
|
-
# would lead to a failure of the above expectation.
|
986
|
-
true
|
987
|
-
}
|
999
|
+
}.and_return(Vagrant::Util::Subprocess::Result.new(0, "", ""))
|
988
1000
|
end
|
989
1001
|
end
|
990
1002
|
|
@@ -994,14 +1006,10 @@ VF
|
|
994
1006
|
it 'does not set IdentitiesOnly=yes in ANSIBLE_SSH_ARGS' do
|
995
1007
|
ssh_info[:keys_only] = false
|
996
1008
|
|
997
|
-
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
1009
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
998
1010
|
cmd_opts = args.last
|
999
1011
|
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to_not include("-o IdentitiesOnly=yes")
|
1000
|
-
|
1001
|
-
# Ending this block with a negative expectation (to_not / not_to)
|
1002
|
-
# would lead to a failure of the above expectation.
|
1003
|
-
true
|
1004
|
-
}
|
1012
|
+
}.and_return(default_execute_result)
|
1005
1013
|
end
|
1006
1014
|
end
|
1007
1015
|
end
|