Skip to content

Commit

Permalink
Update all Vagrantfiles: add disable proxyconf sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ygxxii committed Dec 26, 2023
1 parent 8c09688 commit 91fbf9e
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 10 deletions.
34 changes: 31 additions & 3 deletions playground-ansible/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ HOST_NAME = VM_NAME
#
# To override host locale environment variables:
ENV["LC_ALL"] = "en_US.UTF-8"
ENV["LC_CTYPE"] = "en_US.UTF-8"


# Vagrant Environment Variables:
Expand Down Expand Up @@ -104,16 +105,28 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end
#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Settings for 'vagrant-hostmanager' plugin:
#
# - Ref: [devopsgroup-io/vagrant-hostmanager](https://github.com/devopsgroup-io/vagrant-hostmanager)
#
if Vagrant.has_plugin?("vagrant-hostmanager")
config.hostmanager.enabled = true
# config.hostmanager.manage_host = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
Expand Down Expand Up @@ -184,6 +197,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
config.vm.communicator = "ssh"

# Replace Vagrant's default insecure SSH key:
#
# - Ref: [config.ssh - Vagrantfile | Vagrant | HashiCorp Developer](https://developer.hashicorp.com/vagrant/docs/vagrantfile/ssh_settings)
# - Vaule:
# - "true": Generate a new SSH keypair, and insert into the VM. This will replace Vagrant's default insecure key inside the VM.
# New key: ".vagrant/machines/#{HOST_NAME}/parallels/private_key"
# - "false": Do not replace. Still use Vagrant's default insecure key.
# Old key: "~/.vagrant.d/insecure_private_key"
# - Default" "true"
#
config.ssh.insert_key = false

# Disable the default Vagrant synced folder "/vagrant". Comment to enable:
#
# - Ref: [Basic Usage - Synced Folders | Vagrant | HashiCorp Developer](https://developer.hashicorp.com/vagrant/docs/synced-folders/basic_usage)
Expand Down Expand Up @@ -384,11 +409,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/parallels/private_key'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i ~/.vagrant.d/insecure_private_key'
To check VM's status by Vagrant: 'vagrant status'
To check VM's status by prlctl: 'prlctl list #{VM_NAME}'
To re-trigger vagrant-proxyconf: 'vagrant provision --provision-with proxyconf'
To run / re-run Ansible Playbooks: 'vagrant provision --provision-with ansible'
or 'ansible-playbook playbook.yml'
To run Ansible ad-hoc commands: 'ansible all -m ping'
To get all Vagrant sub-commands: 'vagrant list-commands'
------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions playground-ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[defaults]
inventory=hosts.yml
remote_user=vagrant
6 changes: 6 additions & 0 deletions playground-ansible/hosts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ungrouped:
hosts:
playground-ansible-rocky8:
ansible_user: vagrant
ansible_ssh_private_key_file: "~/.vagrant.d/insecure_private_key"
# ansible_ssh_private_key_file: ".vagrant/machines/{{ inventory_hostname }}/parallels/private_key"
15 changes: 14 additions & 1 deletion playground-centos7/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end
#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Settings for 'vagrant-hostmanager' plugin:
#
Expand Down Expand Up @@ -420,6 +432,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/parallels/private_key'
To check VM's status by Vagrant: 'vagrant status'
To check VM's status by prlctl: 'prlctl list #{VM_NAME}'
Expand Down
15 changes: 14 additions & 1 deletion playground-docker/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end
#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Settings for 'vagrant-hostmanager' plugin:
#
Expand Down Expand Up @@ -426,6 +438,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/parallels/private_key'
To check VM's status by Vagrant: 'vagrant status'
To check VM's status by prlctl: 'prlctl list #{VM_NAME}'
Expand Down
15 changes: 14 additions & 1 deletion playground-hashivault/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end
#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Settings for 'vagrant-hostmanager' plugin:
#
Expand Down Expand Up @@ -395,6 +407,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/parallels/private_key'
To check VM's status by Vagrant: 'vagrant status'
To check VM's status by prlctl: 'prlctl list #{VM_NAME}'
Expand Down
17 changes: 15 additions & 2 deletions playground-rocky8/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,21 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end

#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Settings for 'vagrant-hostmanager' plugin:
#
# - Ref: [devopsgroup-io/vagrant-hostmanager](https://github.com/devopsgroup-io/vagrant-hostmanager)
Expand Down Expand Up @@ -431,6 +443,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/parallels/private_key'
To check VM's status by Vagrant: 'vagrant status'
To check VM's status by prlctl: 'prlctl list #{VM_NAME}'
Expand Down
15 changes: 14 additions & 1 deletion templates/Vagrantfile.parallels.erb
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end
#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Settings for 'vagrant-hostmanager' plugin:
#
Expand Down Expand Up @@ -393,6 +405,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/parallels/private_key'
To check VM's status by Vagrant: 'vagrant status'
To check VM's status by prlctl: 'prlctl list #{VM_NAME}'
Expand Down
15 changes: 14 additions & 1 deletion templates/Vagrantfile.vmware.erb
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
### config.proxy.http = "http://<proxy-server>:<proxy-port>"
### config.proxy.https = "http://<proxy-server>:<proxy-port>"
### config.proxy.no_proxy = "localhost,127.0.0.1"
### # config.proxy.enabled = { yum: false }
### config.proxy.enabled = { pear: false, yum: false, docker: false }
### end
#
#
# Or :
### Disable plugin 'vagrant-proxyconf' completely:
###
### if Vagrant.has_plugin?("vagrant-proxyconf")
### config.proxy.enabled = false
### end
#
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = { pear: false, npm: false }
end

# Vagrant Box:
#
Expand Down Expand Up @@ -383,6 +395,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
You can run following commands on the host:
To SSH login to VM by Vagrant: 'vagrant ssh #{VM_NAME}'
or 'vagrant ssh'
To SSH login to VM by ssh: 'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/vmware_fusion/private_key'
'ssh vagrant@#{HOST_NAME} -i .vagrant/machines/#{HOST_NAME}/vmware_desktop/private_key'
To check VM's status by Vagrant: 'vagrant status'
Expand Down

0 comments on commit 91fbf9e

Please sign in to comment.