plugins/provisioners: put generated inventory file in vagrantfile dir
This commit is contained in:
parent
8445308830
commit
adb72b07d5
|
@ -20,8 +20,10 @@ IMPROVEMENTS:
|
||||||
- guests/suse: Supports private/public networks. [GH-1689]
|
- guests/suse: Supports private/public networks. [GH-1689]
|
||||||
- hosts/fedora: Support RHEL as a host. [GH-2088]
|
- hosts/fedora: Support RHEL as a host. [GH-2088]
|
||||||
- provisioners/ansible: Ansible `inventory_path` can be a directory now. [GH-2035]
|
- provisioners/ansible: Ansible `inventory_path` can be a directory now. [GH-2035]
|
||||||
- provisoiners/ansible: Extra verbose option by setting `config.verbose`
|
- provisioners/ansible: Extra verbose option by setting `config.verbose`
|
||||||
to `extra`. [GH-1979]
|
to `extra`. [GH-1979]
|
||||||
|
- provisioners/ansible: `inventory_path` will be auto-generated if not
|
||||||
|
specified. [GH-1907]
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
|
|
|
@ -62,13 +62,16 @@ module VagrantPlugins
|
||||||
return config.inventory_file if config.inventory_file
|
return config.inventory_file if config.inventory_file
|
||||||
|
|
||||||
ssh = @machine.ssh_info
|
ssh = @machine.ssh_info
|
||||||
generated_inventory_file = "vagrant_ansible_inventory_#{machine.name}"
|
|
||||||
File.open(generated_inventory_file, 'w') do |file|
|
generated_inventory_file =
|
||||||
|
@machine.env.root_path.join("vagrant_ansible_inventory_#{machine.name}")
|
||||||
|
|
||||||
|
generated_inventory_file.open('w') do |file|
|
||||||
file.write("# Generated by Vagrant\n\n")
|
file.write("# Generated by Vagrant\n\n")
|
||||||
file.write("#{machine.name} ansible_ssh_host=#{ssh[:host]} ansible_ssh_port=#{ssh[:port]}\n")
|
file.write("#{machine.name} ansible_ssh_host=#{ssh[:host]} ansible_ssh_port=#{ssh[:port]}\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
return generated_inventory_file
|
return generated_inventory_file.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue