Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit d8c297e

Browse files
author
Jamie Snape
committed
Add Vagrant and Ansible configuration
1 parent ea42a6d commit d8c297e

File tree

22 files changed

+2604
-0
lines changed

22 files changed

+2604
-0
lines changed

Vagrantfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- mode: ruby -*-
2+
#=============================================================================
3+
# MIDAS Server
4+
# Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
# All rights reserved.
6+
# More information http://www.kitware.com
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0.txt
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
#=============================================================================
20+
21+
Vagrant.configure("2") do |config|
22+
config.vm.box = "ubuntu/trusty64"
23+
config.vm.network "forwarded_port", guest: 80, host: 8080
24+
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/"
25+
config.vm.provision "ansible" do |ansible|
26+
ansible.playbook = "provisioning/ansible/site.yml"
27+
end
28+
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#=============================================================================
2+
# MIDAS Server
3+
# Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
4+
# All rights reserved.
5+
# More information http://www.kitware.com
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0.txt
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#=============================================================================
19+
20+
---
21+
- name: restart apache2
22+
service: name=apache2 state=restarted
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#=============================================================================
2+
# MIDAS Server
3+
# Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
4+
# All rights reserved.
5+
# More information http://www.kitware.com
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0.txt
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#=============================================================================
19+
20+
---
21+
dependencies:
22+
- { role: common }
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#=============================================================================
2+
# MIDAS Server
3+
# Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
4+
# All rights reserved.
5+
# More information http://www.kitware.com
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0.txt
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#=============================================================================
19+
20+
---
21+
- name: apt install
22+
apt: name={{ item }} state=present
23+
with_items:
24+
- apache2
25+
- php5
26+
- php5-gd
27+
- sendmail
28+
29+
- name: php.ini
30+
template: src=etc-php5-apache2-php.ini.j2 dest=/etc/php5/apache2/php.ini
31+
notify:
32+
- restart apache2
33+
34+
- name: enable modules
35+
apache2_module: name={{ item }} state=present
36+
with_items:
37+
- rewrite
38+
- vhost_alias
39+
notify:
40+
- restart apache2
41+
42+
- name: ln
43+
command: ln -s /vagrant /var/www/vagrant creates=/var/www/vagrant
44+
45+
- name: sites-available
46+
template: src=etc-apache2-sites-available-vagrant.conf.j2 dest=/etc/apache2/sites-available/vagrant.conf
47+
notify:
48+
- restart apache2
49+
50+
- name: disable site
51+
command: a2dissite 000-default.conf removes=/etc/apache2/sites-enabled/000-default.conf
52+
notify:
53+
- restart apache2
54+
55+
- name: enable site
56+
command: a2ensite vagrant.conf creates=/etc/apache2/sites-enabled/vagrant.conf
57+
notify:
58+
- restart apache2
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<VirtualHost *:80>
2+
ServerName vagrant.dev
3+
DocumentRoot /var/www/vagrant
4+
<Directory /var/www/vagrant>
5+
Options FollowSymLinks
6+
AllowOverride All
7+
Order allow,deny
8+
allow from all
9+
</Directory>
10+
</VirtualHost>

0 commit comments

Comments
 (0)