Commit 853792ae by Will Daly

Vagrant stacks use ansible pull to update

parent b308386d
- name: Configure instance(s)
hosts: vagrant
hosts: all
sudo: True
gather_facts: True
vars:
......@@ -12,6 +12,7 @@
vars_files:
- "group_vars/all"
roles:
- edx_ansible
- edxlocal
- mongo
- edxapp
......
- name: Configure instance(s)
hosts: vagrant
hosts: all
sudo: True
gather_facts: True
vars:
......@@ -10,6 +10,7 @@
vars_files:
- "group_vars/all"
roles:
- edx_ansible
- gh_users
- role: nginx
nginx_sites:
......
Vagrant
=======
Vagrant instances for local development and testing.
- Vagrant stacks in ``base`` create new base boxes from scratch.
- Vagrant stacks in ``release`` download a base box with most requirements already installed. The instances then update themselves with the latest versions of the application code.
If you are a developer or designer, you should use the ``release`` stacks.
There are two versions of the stack:
- ``fullstack`` is a production-like configuration running all the services on a single server. https://github.com/edx/configuration/wiki/edX-Production-Stack
- ``devstack`` is designed for local development. Although it uses the same system requirements as in production, it simplifies certain settings to make development more convenient. https://github.com/edx/configuration/wiki/edX-Developer-Stack
......@@ -41,8 +41,8 @@ Vagrant.configure("2") do |config|
end
config.vm.provision :ansible do |ansible|
ansible.playbook = "../../playbooks/vagrant-devstack.yml"
ansible.inventory_path = "../../playbooks/vagrant/inventory.ini"
ansible.playbook = "../../../playbooks/vagrant-devstack.yml"
ansible.inventory_path = "../../../playbooks/vagrant/inventory.ini"
ansible.verbose = "extra"
end
end
../../../playbooks/ansible.cfg
\ No newline at end of file
......@@ -20,8 +20,8 @@ Vagrant.configure("2") do |config|
config.vm.provision :ansible do |ansible|
# point Vagrant at the location of your playbook you want to run
ansible.playbook = "../../playbooks/vagrant-fullstack.yml"
ansible.inventory_path = "../../playbooks/vagrant/inventory.ini"
ansible.playbook = "../../../playbooks/vagrant-fullstack.yml"
ansible.inventory_path = "../../../playbooks/vagrant/inventory.ini"
ansible.verbose = "extra"
end
end
../../../playbooks/ansible.cfg
\ No newline at end of file
devstack
========
Vagrant instance for local development.
Overview
--------
``devstack`` is a Vagrant instance designed for local development. The instance:
- Uses the same system requirements as production. This allows developers to discover and fix system configuration issues early in development.
- Simplifies certain production settings to make development more convenient. For example, it disables ``nginx`` and ``gunicorn`` in favor of ``runserver`` for Django development.
The ``devstack`` instance is designed to run code and tests, but you can do most development in the host environment:
- Git repositories are shared with the host system, so you can use your preferred text editor/IDE.
- You can load pages served by the running Vagrant instance.
Wiki documation - https://github.com/edx/configuration/wiki/edX-Developer-Stack
../../playbooks/ansible.cfg
\ No newline at end of file
devstack
========
Vagrant instance for a production like configuration running all services on a single server
Installation instructions - https://github.com/edx/configuration/wiki#installing-edx-using-a-pre-built-vagrant-fullstack-image
../../playbooks/ansible.cfg
\ No newline at end of file
MEMORY = 2048
CPU_COUNT = 2
$script = <<SCRIPT
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
cd /edx/app/edx_ansible/edx_ansible/playbooks
ansible-playbook -i localhost, -c local vagrant-devstack.yml
SCRIPT
edx_platform_mount_dir = "edx-platform"
forum_mount_dir = "cs_comments_service"
ora_mount_dir = "ora"
if ENV['VAGRANT_MOUNT_BASE']
edx_platform_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + edx_platform_mount_dir
forum_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + forum_mount_dir
ora_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + ora_mount_dir
end
Vagrant.configure("2") do |config|
config.vm.box = "edx-devstack"
config.vm.box_url = "http://edx-static.s3.amazonaws.com/vagrant-images/20131113-dosa-devstack.box"
# Creates a devstack from a base Ubuntu 12.04 image
# TODO -- replace this with the base box that has edx_ansible and devstack installed
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.network :forwarded_port, guest: 8000, host: 8000
......@@ -22,21 +33,21 @@ Vagrant.configure("2") do |config|
config.vm.synced_folder "#{edx_platform_mount_dir}", "/edx/app/edxapp/edx-platform", :create => true, nfs: true
config.vm.synced_folder "#{forum_mount_dir}", "/edx/app/forum/cs_comments_service", :create => true, nfs: true
config.vm.synced_folder "#{ora_mount_dir}", "/edx/app/ora/ora", :create => true, nfs: true
config.hostsupdater.aliases = ["preview.localhost"]
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
edxapp_version = "master"
forum_version = "master"
config.vm.provision :ansible do |ansible|
ansible.playbook = "../../../../playbooks/vagrant-devstack.yml"
ansible.inventory_path = "../../../../playbooks/vagrant/inventory.ini"
ansible.tags = "deploy"
ansible.verbose = "extra"
end
# Assume that the base box has the edx_ansible role installed
# We can then tell the Vagrant instance to update itself.
config.vm.provision "shell", inline: $script
end
../../../../playbooks/ansible.cfg
\ No newline at end of file
MEMORY = 2048
CPU_COUNT = 2
Vagrant.configure("2") do |config|
config.vm.box = "edx-fullstack"
config.vm.box_url = "http://edx-static.s3.amazonaws.com/vagrant-images/20131113-dosa-fullstack.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
# You can adjust this to the amount of CPUs your system has available
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
end
config.vm.provision :ansible do |ansible|
# point Vagrant at the location of your playbook you want to run
ansible.playbook = "../../../../playbooks/vagrant-fullstack.yml"
ansible.inventory_path = "../../../../playbooks/vagrant/inventory.ini"
ansible.verbose = "extra"
end
end
../../../../playbooks/ansible.cfg
\ No newline at end of file
MEMORY = 2048
CPU_COUNT = 2
Vagrant.configure("2") do |config|
# Creates a devstack from a base Ubuntu 12.04 image
# TODO -- replace this with the base box that has edx_ansible and fullstack installed
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.hostsupdater.aliases = ["preview.localhost"]
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment