Add unit test and documentation for playbook_command option

This commit is contained in:
Daniel Gonzalez 2016-10-10 16:56:36 +02:00
parent 58f2b0c8c7
commit 79a3cb8a14
3 changed files with 17 additions and 0 deletions

View File

@ -12,6 +12,7 @@ shared_examples_for 'options shared by both Ansible provisioners' do
expect(subject.inventory_path).to be_nil expect(subject.inventory_path).to be_nil
expect(subject.limit).to be_nil expect(subject.limit).to be_nil
expect(subject.playbook).to be_nil expect(subject.playbook).to be_nil
expect(subject.playbook_command).to eql("ansible-playbook")
expect(subject.raw_arguments).to be_nil expect(subject.raw_arguments).to be_nil
expect(subject.skip_tags).to be_nil expect(subject.skip_tags).to be_nil
expect(subject.start_at_task).to be_nil expect(subject.start_at_task).to be_nil

View File

@ -273,6 +273,18 @@ VF
end end
end end
describe "with playbook_command option" do
before do
config.playbook_command = "custom-ansible-playbook"
end
it "uses custom playbook_command to run playbooks" do
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
expect(args[0]).to eq("custom-ansible-playbook")
}
end
end
describe "with host_vars option" do describe "with host_vars option" do
it_should_create_and_use_generated_inventory it_should_create_and_use_generated_inventory

View File

@ -78,6 +78,10 @@ Some of these options are for advanced usage only and should not be used unless
By default, this option is disabled and Vagrant generates an inventory based on the `Vagrantfile` information. By default, this option is disabled and Vagrant generates an inventory based on the `Vagrantfile` information.
- `playbook_command` (string) - The command used to run playbooks.
The default value is `ansible-playbook`
- `galaxy_command` (template string) - The command pattern used to install Galaxy roles when `galaxy_role_file` is set. - `galaxy_command` (template string) - The command pattern used to install Galaxy roles when `galaxy_role_file` is set.
The following (optional) placeholders can be used in this command pattern: The following (optional) placeholders can be used in this command pattern: