Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit c5335d4

Browse files
authored
Merge pull request #11 from EuroPython/test_environment
Test environment
2 parents fe82487 + f0bac74 commit c5335d4

File tree

23 files changed

+183
-721
lines changed

23 files changed

+183
-721
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ tag: clean
4242
@echo "Creating git tag v$(tag)"
4343
git tag v$(tag)
4444
git push --tags
45+
46+
runvm:
47+
vagrant up vepcon

README.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,22 @@ TODO: add introduction, and a brief description
88
How to run this Ansible playbook
99
--------------------------------
1010

11-
Vagrant Manager
12-
---------------
11+
1. Create a `vault-pass.txt` file with the provision password.
12+
2. Install Ansible and other dependencies with:
1313

14-
This project includes a Vagrantfile to create a virtual machine which you
15-
can use to develop, test, and mainly run the Ansible playbook.
16-
To start it, `cd` to the root of this project and run:
17-
18-
```
19-
vagrant up manager
20-
vagrant ssh manager
14+
```bash
15+
pip install -r requirements.txt
2116
```
2217

23-
If everything went okay, you can now use Ansible to deploy:
24-
```
25-
cd /vagrant
26-
ansible-playbook site.yml -i inventory/prod -l europython
27-
```
2818

2919
Testing
3020
-------
3121

32-
There is a Vagrant machine called `test`. This is used to deploy in a safe test environment.
22+
There is a Vagrant machine called `vepcon`. This is used to deploy in a safe test environment.
3323
Launch it with:
3424

25+
```bash
26+
vagrant up
3527
```
36-
vagrant up test
37-
```
38-
39-
Once it is provisioned by Vagrant, do:
4028

41-
```
42-
vagrant ssh manager
43-
cd /vagrant
44-
ansible-playbook site.yml -i inventory -l test
45-
```
29+
It will run the Ansible playbook for the `vepcon` host.

Vagrantfile

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,16 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4-
VAGRANTFILE_API_VERSION = "2"
4+
Vagrant.configure("2") do |config|
55

6-
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7-
8-
config.vm.define :manager, :autostart => true do |node|
9-
node.vm.box = 'ubuntu/trusty64'
10-
node.vm.hostname = "manager"
11-
node.vm.network :private_network, ip: "10.0.11.10", hostsupdater: "skip"
12-
node.vm.provider "virtualbox" do |vb|
13-
vb.memory = "512"
14-
vb.gui = false
15-
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
16-
end
17-
18-
node.vm.provision :shell, path: "vagrant/upgrade_ansible.sh", privileged: false
19-
node.vm.provision "ansible_local" do |ansible|
20-
ansible.playbook = "site.yml"
21-
ansible.verbose = true
22-
ansible.install = true
23-
ansible.limit = "manager"
24-
ansible.inventory_path = "inventory"
6+
config.vm.define :vepcon, :autostart => true do |node|
7+
node.vm.box = "ubuntu/bionic64"
8+
node.vm.hostname = 'vepcon'
9+
node.vm.network :private_network, ip: "10.0.11.10"
10+
node.vm.synced_folder ".", "/vagrant", type: "virtualbox"
11+
node.vm.provision "ansible" do |ansible|
12+
ansible.limit = "vepcon"
13+
ansible.playbook = "playbook.yml"
2514
end
2615
end
27-
28-
config.vm.define :test, :autostart => true do |node|
29-
node.vm.box = 'ubuntu/trusty64'
30-
node.vm.hostname = 'test'
31-
node.vm.network :private_network, ip: "10.0.11.11", hostsupdater: "skip"
32-
node.vm.provider "virtualbox" do |vb|
33-
vb.memory = "1024"
34-
vb.gui = false
35-
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
36-
end
37-
node.vm.provision :shell, path: "vagrant/test.sh", privileged: false
38-
end
39-
4016
end

0 commit comments

Comments
 (0)