Skip to content
Snippets Groups Projects
Commit 0942b86a authored by Vasco Grossmann's avatar Vasco Grossmann
Browse files

Babsi Server VM: Vagrant and Salt filed added

parent 2d61fd4d
No related branches found
No related tags found
No related merge requests found
Showing with 92 additions and 0 deletions
1.5:1ff1f4e9-fa86-41a4-9dc4-a3c87cd2fe27
\ No newline at end of file
1406812443
\ No newline at end of file
1ff1f4e9-fa86-41a4-9dc4-a3c87cd2fe27
\ No newline at end of file
0e2846a8356a418f94bf58fcff324405
\ No newline at end of file
{"virtualbox":{"/srv/salt":{"guestpath":"/srv/salt","hostpath":"/home/vasco/Workspace/abs/babsi/BabsiServerVM/salt/roots","disabled":false},"/vagrant":{"guestpath":"/vagrant","hostpath":"/home/vasco/Workspace/abs/babsi/BabsiServerVM","disabled":false}}}
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
config.vm.hostname = "sopro"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.ssh.forward_agent = true
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "4096", "--cpus", "2", "--name", "SoPro14"]
end
config.vm.synced_folder "salt/roots/", "/srv/salt/"
config.vm.provision :salt do |salt|
salt.minion_config = "salt/minion"
salt.run_highstate = true
end
end
file_client: local
monit:
pkg.installed
tomcat7:
pkg:
- installed
service:
- running
- require:
- pkg: tomcat7
base:
'*':
- tomcat
- monit
- users
{% for id in range(9) %}
group{{id+1}}:
group.present:
- addusers:
- tomcat7
user:
- present
- shell: /bin/bash
- home: /home/group{{id+1}}
- groups:
- group{{id+1}}
/home/group{{id+1}}:
file.directory:
- file_mode: 740
- dir_mode: 750
- require:
- user: group{{id+1}}
/var/lib/tomcat7/conf/Catalina/localhost/group{{id+1}}.xml:
cmd.run:
- name: echo "<Context docBase=\"/home/group{{id+1}}/BabsiWeb.war\" unpackWAR=\"true\" path=\"/group{{id+1}}\" reloadable=\"true\" />" > /var/lib/tomcat7/conf/Catalina/localhost/group{{id+1}}.xml
usermod -a -G group{{id+1}} tomcat7:
cmd.run
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment