Add extra_vars support to vagrant setup (#10932)

pull/10943/head
Max Gautier 2024-02-19 10:58:20 +00:00 committed by GitHub
parent 5d822ad8cb
commit d40b073f97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

2
Vagrantfile vendored
View File

@ -80,6 +80,7 @@ $ansible_tags ||= ENV['VAGRANT_ANSIBLE_TAGS'] || ""
$vagrant_dir ||= File.join(File.dirname(__FILE__), ".vagrant") $vagrant_dir ||= File.join(File.dirname(__FILE__), ".vagrant")
$playbook ||= "cluster.yml" $playbook ||= "cluster.yml"
$extra_vars ||= {}
host_vars = {} host_vars = {}
@ -276,6 +277,7 @@ Vagrant.configure("2") do |config|
ansible.host_key_checking = false ansible.host_key_checking = false
ansible.raw_arguments = ["--forks=#{$num_instances}", "--flush-cache", "-e ansible_become_pass=vagrant"] ansible.raw_arguments = ["--forks=#{$num_instances}", "--flush-cache", "-e ansible_become_pass=vagrant"]
ansible.host_vars = host_vars ansible.host_vars = host_vars
ansible.extra_vars = $extra_vars
if $ansible_tags != "" if $ansible_tags != ""
ansible.tags = [$ansible_tags] ansible.tags = [$ansible_tags]
end end

View File

@ -85,6 +85,11 @@ cat << EOF > vagrant/config.rb
\$network_plugin = "flannel" \$network_plugin = "flannel"
\$inventory = "$INV" \$inventory = "$INV"
\$shared_folders = { 'temp/docker_rpms' => "/var/cache/yum/x86_64/7/docker-ce/packages" } \$shared_folders = { 'temp/docker_rpms' => "/var/cache/yum/x86_64/7/docker-ce/packages" }
\$extra_vars = {
dns_domain: my.custom.domain
}
# or
\$extra_vars = "path/to/extra/vars/file.yml"
EOF EOF
# make the rpm cache # make the rpm cache