vagrant

how to connect to a database inside vagrant

99封情书 提交于 2020-01-05 06:03:32
问题 I'm running djanog, and I need to have my database inside vagrant that I want to connect to. The Apache is running on my local pc. How should I set up the port forwarting in the vagrant config file and the settings file in django so I can connect to the db inside vagrant. My current django db configuration: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'db_name', # Or path to database file if

Why is my Vagrant bootstrap file not modifying bash_login?

我的未来我决定 提交于 2020-01-05 05:44:25
问题 When I SSH into my Vagrant box, I would like it to run the following two commands; cd /vagrant git status So naturally I would modify my ~/.bash_login to do this cat << EOF | sudo tee -a ~/.bash_login cd /vagrant git status EOF If I then exit, and ssh back into my box - it works! So then I added those exact commands to my bootstap.sh provisioning file, so that each time my box is provisioned, it would add it automatically to my bash_login script. Except it doesnt work. The output during

How to run ansible plays for some tasks on host when playbook is run via Vagrant provisioner?

谁都会走 提交于 2020-01-05 03:36:39
问题 I am using a Ubuntu 16.04 host with Vagrant installed on it. I would like to log the start time and end time of a set of tasks. These tasks are defined as roles. I created a role host_test role to ensure that I am able to touch a file on my host using local_action . But I believe as this playbook is being provisioned via Vagrant, by the time host_test role is played by ansible, Its control is inside the vagrant box rather than outside of it (my intention is to log in the host). So the file is

How to template Vagrantfile using Ruby?

孤人 提交于 2020-01-05 02:22:24
问题 I have several Vagrantfile , each one for a different provider , since Vagrant has a limitation that doesn't allow to make two or more provisions at the same time using the same Vagrantfile . So, I split into two or more Vagrantfiles , but my "body", my provisions scripts are the same for both, the only thing that changes is the provider block. For example: local_nagios/Vagrantfile # -*- mode: ruby -*- # vi: set ft=ruby : require 'yaml' set = YAML.load_file '../../../settings.yaml' Vagrant

Zombie.js running slowly in VirtualBox shared folder

喜你入骨 提交于 2020-01-04 21:29:48
问题 I am trying to use Zombie in my Node.js project. The project runs in a shared folder on a VirtualBox VM. I am noticing a big drop in performance when Zombie is installed to the shared folder rather than globally. Suppose I have the following in zombie_test.js: require("zombie"); If I install zombie globally, the require statement runs in less than a second: $ sudo npm install zombie -g ... $ time node zombie_test.js real 0m0.651s user 0m0.464s sys 0m0.116s If I install the package locally,

Docker - Windows中使用vagrant+virtual box创建Docker

孤人 提交于 2020-01-04 15:47:39
一、安装Vagrant 访问vagrant官网 Vagrant 下载对应系统的Vagrant 安装 命令行输入vagrant,测试是否安装成功 二、安装Virtual Box 访问virtualbox官网 Virtual Box 选择左侧的downloads 选择下载对应的操作系统版本 安装 [win10中若出现]安装virtualbox快完成时立即回滚,并提示安装出现严重错误 (1)打开服务 (2)找到Device Install Service和Device Setup Manager,然后启动 (3)再次尝试安装 三、安装Centos7 创建first-docker-centos7文件夹,并进入其中[目录路径中不要有中文字符] 在此目录下打开cmd,运行vagrant init centos/7 此时会在当前目录下生成Vagrantfile 运行vagrant up [ 注意不要运行,拉取远端的centos7太慢 ] 此时会找centos7的镜像,本地有就用本地的,本地没有就会拉取远端的 准备centos7的box a. 下载centos box Centos7 b. 将下载好的文件放到指定目录 c. 运行vagrant box add centos/7 D:\迅雷下载\virtualbox.box d. vagrant box list 查看本地的box

How to enable hot reloading via shared folders with Vagrant VM?

眉间皱痕 提交于 2020-01-04 03:55:52
问题 I have a very basic react/redux app utilizing hot reloading (i.e. when I save a change to my source code, it updates the contents of my app accordingly in browser, preserving the state of my app) via webpack. This works on myhost machine. However, if I use a vagrant-based workflow with synced folders (so that I can use my preferred non-terminal text editor) and I make and save a change to my source code on my host machine, the hot reloading is not triggered. However, if I make/save the change

Vagrant / Virtualbox, shared folder out of sync when there are many file-related operation

我与影子孤独终老i 提交于 2020-01-04 02:40:09
问题 This is not about vagrant or virtualbox guest running slowly due to slow shared folder access, we know that can be resolved more or less by enabling nfs. It's rather about mounted shared folder go out of sync when there are many file operations within the vm (enable nfs does not prevent it from happening) . For example, when we are installing packages, like with php composer or node.js npm inside the vm, there is a certain probability that normal composer update or npm install will fail, and

Vagrant Berkshelf - Shelf Path?

微笑、不失礼 提交于 2020-01-04 02:20:29
问题 Is it possible to set the path where the berkshelf plugin puts the cookbooks it installs? (As in the .berkshelf folder) I am running Windows 7. I am currently trying to install a mysql server using an opscode cookbook to a vm and here at work they have the %HOMEDRIVE% system variable set to a network drive. So when .berkshelf starts at the beginning of the Vagrantfile, it pushes the cookbooks to the network drive and it causes it to be slow and well, its not where it should be. Is there a fix

“vagrant up” it stops at SSH auth method: private key

微笑、不失礼 提交于 2020-01-04 01:49:30
问题 I'm trying to install laravel on my computer with homestead environment. I followed all steps on the official documentation. And when I execute my "vagrant up" my console displays the following error. . Stops at SSH auth method. Previously I configured the ssh-keygen with " ssh-keygen -t rsa -b 4096 -C "me@email.com " I added the host piece at .rb file: Even .yaml file. I think I edited properly At hosts file I added: "192.168.10.10 administracio.dev" at the bottom of the file. And then when