provisioners/ansible: Add example of `host_vars` values that include quotes
Motivated by the support effort on GH-8158 ;-)
This commit is contained in:
parent
a3b9d231ad
commit
9493901e0c
|
@ -292,11 +292,11 @@ VF
|
||||||
|
|
||||||
it "adds host variables (given in Hash format) to the generated inventory" do
|
it "adds host variables (given in Hash format) to the generated inventory" do
|
||||||
config.host_vars = {
|
config.host_vars = {
|
||||||
machine1: {"http_port" => 80, "maxRequestsPerChild" => 808}
|
machine1: {"http_port" => 80, "comments" => "'some text with spaces'"}
|
||||||
}
|
}
|
||||||
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
|
||||||
inventory_content = File.read(generated_inventory_file)
|
inventory_content = File.read(generated_inventory_file)
|
||||||
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 maxRequestsPerChild=808")
|
expect(inventory_content).to match("^" + Regexp.quote(machine.name) + ".+http_port=80 comments='some text with spaces'$")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@ Some of these options are for advanced usage only and should not be used unless
|
||||||
ansible.host_vars = {
|
ansible.host_vars = {
|
||||||
"host1" => {"http_port" => 80,
|
"host1" => {"http_port" => 80,
|
||||||
"maxRequestsPerChild" => 808},
|
"maxRequestsPerChild" => 808},
|
||||||
|
"comments" => "'text with spaces'",
|
||||||
"host2" => {"http_port" => 303,
|
"host2" => {"http_port" => 303,
|
||||||
"maxRequestsPerChild" => 909}
|
"maxRequestsPerChild" => 909}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue