ソースを参照

Remove Puppet (and Vagrant)

The puppet provisioning of the Vagrant box has been broken for ages due
to floating dependencies. I don't want to support it anymore since
Docker images are almost ready - hence why it goes.
master
David Winterbottom 11年前
コミット
af3c381d49
6個のファイルの変更1行の追加228行の削除
  1. 1
    13
      Makefile
  2. 0
    31
      Vagrantfile
  3. 0
    2
      requirements_vagrant.txt
  4. 0
    19
      sites/puppet/files/apache.conf
  5. 0
    140
      sites/puppet/manifests/site.pp
  6. 0
    23
      sites/sandbox/deploy/wsgi/vagrant.wsgi

+ 1
- 13
Makefile ファイルの表示

@@ -1,5 +1,5 @@
1 1
 # These targets are not files
2
-.PHONY: install sandbox geoip demo docs coverage lint travis messages compiledmessages puppet css clean preflight
2
+.PHONY: install sandbox geoip demo docs coverage lint travis messages compiledmessages css clean preflight
3 3
 
4 4
 install:
5 5
 	pip install -r requirements.txt
@@ -92,18 +92,6 @@ compiledmessages:
92 92
 	# Compile the gettext files
93 93
 	cd oscar; django-admin.py compilemessages
94 94
 
95
-puppet:
96
-	# Install puppet modules required to set-up a Vagrant box
97
-	mkdir -p sites/puppet/modules
98
-	rm -rf sites/puppet/modules/*
99
-	puppet module install --target-dir sites/puppet/modules/ saz-memcached -v 2.0.2
100
-	puppet module install --target-dir sites/puppet/modules/ puppetlabs/mysql
101
-	puppet module install --target-dir sites/puppet/modules/ puppetlabs/apache
102
-	puppet module install --target-dir sites/puppet/modules/ dhutty/nginx
103
-	git clone git://github.com/akumria/puppet-postgresql.git sites/puppet/modules/postgresql
104
-	git clone git://github.com/puppetmodules/puppet-module-python.git sites/puppet/modules/python
105
-	git clone git://github.com/codeinthehole/puppet-userconfig.git sites/puppet/modules/userconfig
106
-
107 95
 css:
108 96
 	# Compile CSS files from LESS
109 97
 	lessc oscar/static/oscar/less/styles.less > oscar/static/oscar/css/styles.css

+ 0
- 31
Vagrantfile ファイルの表示

@@ -1,31 +0,0 @@
1
-# -*- mode: ruby -*-
2
-# vi: set ft=ruby :
3
-#
4
-# Before bringing up your Vagrant machine, run:
5
-#
6
-#     make puppet
7
-#
8
-# to fetch the puppet modules required to build the VM.
9
-
10
-Vagrant::Config.run do |config|
11
-    config.vm.box = "precise64"
12
-    config.vm.box_url = "http://files.vagrantup.com/precise64.box"
13
-	config.vm.forward_port 8080, 8080
14
-	config.vm.forward_port 80, 8081
15
-	config.vm.forward_port 8082, 8082
16
-	config.vm.forward_port 8083, 8083
17
-	#config.vm.boot_mode = :gui
18
-
19
-	# hack to update repos because maikhoepfel can't be asked to learn Puppet to
20
-	# debug the order-of-execution bug in site.pp that causes apt-get to fail
21
-	# to find MySQL packages
22
-	# http://stackoverflow.com/questions/16011294/vagrant-puppet-provisioning-failing
23
-	config.vm.provision :shell, :inline => "apt-get update --fix-missing"
24
-
25
-    config.vm.provision :puppet do |puppet|
26
-        puppet.manifests_path = "sites/puppet/manifests"
27
-        puppet.manifest_file = "site.pp"
28
-        puppet.module_path = "sites/puppet/modules"
29
-		#puppet.options = "--debug"
30
-    end
31
-end

+ 0
- 2
requirements_vagrant.txt ファイルの表示

@@ -1,2 +0,0 @@
1
-PyMySQL==0.6.2
2
-psycopg2==2.4.5

+ 0
- 19
sites/puppet/files/apache.conf ファイルの表示

@@ -1,19 +0,0 @@
1
-<VirtualHost *>
2
-    ServerName vagrant.oscarcommerce.com
3
-    DocumentRoot /vagrant/sites/sandbox/public
4
-    CustomLog /var/log/apache2/access.vagrant.oscar.log combined
5
-    ErrorLog /var/log/apache2/error.vagrant.oscar.log
6
-	AllowEncodedSlashes On
7
-
8
-    WSGIDaemonProcess oscar processes=2 threads=5 display-name=oscar maximum-requests=10000
9
-    WSGIProcessGroup oscar
10
-    WSGIApplicationGroup %{GLOBAL}
11
-    WSGIScriptAlias / /vagrant/sites/sandbox/deploy/wsgi/vagrant.wsgi
12
-    WSGIPassAuthorization On
13
-
14
-    <Directory /vagrant/sites/sandbox/deploy/wsgi/vagrant.wsgi >
15
-        Order deny,allow
16
-        Allow from all
17
-    </Directory>
18
-
19
-</Virtualhost>

+ 0
- 140
sites/puppet/manifests/site.pp ファイルの表示

@@ -1,140 +0,0 @@
1
-# Set default path for all Exec tasks
2
-Exec {
3
-	path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
4
-}
5
-
6
-class python_dependencies {
7
-	exec {"update-packages":
8
-		command => "apt-get update",
9
-	}
10
-    $packages = [
11
-		"build-essential",
12
-		"python-setuptools",
13
-		"python-imaging",
14
-		"python-memcache",
15
-		"postgresql-server-dev-9.1",
16
-		"libmysqlclient-dev",
17
-		"git-core",
18
-    ]
19
-    package {
20
-        $packages: ensure => installed,
21
-		require => Exec["update-packages"]
22
-    }
23
-}
24
-
25
-node precise64 {
26
-
27
-	include python_dependencies
28
-	include userconfig
29
-
30
-	# Dev server on port 8080
31
-	exec { "dev-server":
32
-	  command => "bash -c \"source /var/www/virtualenv/bin/activate && /vagrant/sites/sandbox/manage.py runserver 0.0.0.0:8080 &\"",
33
-    }
34
-
35
-	# Apache serving WSGI on port 80 (would prefer 8081)
36
-	class {"apache": }
37
-	class {"apache::mod::wsgi": }
38
-	file {"/etc/apache2/sites-enabled/vagrant.conf":
39
-	    source => "/vagrant/sites/puppet/files/apache.conf"
40
-	}
41
-
42
-	# gunicorn serving WSGI on unix socket
43
-	class { "python::gunicorn": owner => "root", group => "root" }
44
-	python::gunicorn::instance { "oscar":
45
-	  venv => "/var/www/virtualenv",
46
-	  django => true,
47
-	  src => "/vagrant/sites/sandbox",
48
-    }
49
-
50
-	# Nginx in front of Apache (port 8082)
51
-	class { "nginx": }
52
-	nginx::resource::vhost { 'apache_rp':
53
-	  ensure => present,
54
-	  listen_port => 8082,
55
-	}
56
-	nginx::resource::location { 'apache-root':
57
-	  ensure => present,
58
-	  vhost => 'apache_rp',
59
-	  location => '/',
60
-	  proxy => 'http://localhost',
61
-	  proxy_set_headers => {
62
-	  'REMOTE_ADDR' => '$remote_addr',
63
-	  'HTTP_HOST' => '$http_host',
64
-	  },
65
-	}
66
-
67
-	# Nginx in front of gunicorn (port 8083)
68
-	nginx::resource::vhost { 'gunicorn_rp':
69
-	  ensure => present,
70
-	  listen_port => 8083,
71
-	}
72
-	nginx::resource::location { 'gunicorn-root':
73
-	  ensure => present,
74
-	  vhost => 'gunicorn_rp',
75
-	  location => '/',
76
-	  proxy => 'http://app1',
77
-	  proxy_set_headers => {
78
-	  'REMOTE_ADDR' => '$remote_addr',
79
-	  'HTTP_HOST' => '$http_host',
80
-	  },
81
-	}
82
-	nginx::resource::upstream { 'app1':
83
-       ensure => present,
84
-       members => [
85
-       'unix:/run/gunicorn/oscar.sock weight=10',
86
-       ],
87
-    }
88
-
89
-	# Memcached
90
-	class {"memcached": max_memory => 64 }
91
-
92
-	# Postgres
93
-	$user = "oscar_user"
94
-	$password = "oscar_password"
95
-	$database_name = "oscar_vagrant"
96
-	class {"postgresql::server": }
97
-	pg_user {$user:
98
-		ensure => present,
99
-		password => $password,
100
-		createdb => true,
101
-		require => Class["postgresql::server"],
102
-	}
103
-	pg_database {$database_name:
104
-		ensure => present,
105
-		owner => $user,
106
-		require => [Pg_user[$user]],
107
-		encoding => "UTF8",
108
-	}
109
-
110
-	# MySQL
111
-	class {"mysql::bindings": }
112
-	class {"mysql::server":
113
-	    override_options => {"root_password" => "root_password"},
114
-	}
115
-	mysql::db {$database_name:
116
-		user => $user,
117
-		password => $password,
118
-		host => "localhost",
119
-		grant => ["all"],
120
-	}
121
-
122
-	# Python
123
-	# - set-up a virtualenv
124
-	# - install testing requirements
125
-	# - install oscar in 'develop' mode
126
-	$virtualenv = "/var/www/virtualenv"
127
-	include python::dev
128
-	include python::venv
129
-	python::venv::isolate { $virtualenv:
130
-	    requirements => "/vagrant/requirements.txt"
131
-	}
132
-	python::pip::requirements {"/vagrant/requirements_vagrant.txt":
133
-	    venv => $virtualenv,
134
-		require => Python::Venv::Isolate[$virtualenv]
135
-	}
136
-    exec {"install-oscar":
137
-	    command => "$virtualenv/bin/python /vagrant/setup.py develop",
138
-		require => Python::Venv::Isolate[$virtualenv]
139
-	}
140
-}

+ 0
- 23
sites/sandbox/deploy/wsgi/vagrant.wsgi ファイルの表示

@@ -1,23 +0,0 @@
1
-import os
2
-import sys
3
-import site
4
-import urllib
5
-
6
-sys.stdout = sys.stderr
7
-
8
-# Project root
9
-root = '/vagrant/sites/sandbox'
10
-sys.path.insert(0, root)
11
-
12
-# Packages from virtualenv
13
-activate_this = '/var/www/virtualenv/bin/activate_this.py'
14
-execfile(activate_this, dict(__file__=activate_this))
15
-
16
-# Set environmental variable for Django and fire WSGI handler
17
-os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
18
-import django.core.handlers.wsgi
19
-_application = django.core.handlers.wsgi.WSGIHandler()
20
-
21
-def application(environ, start_response):
22
-    environ['PATH_INFO'] = urllib.unquote(environ['REQUEST_URI'].split('?')[0])
23
-    return _application(environ, start_response)

読み込み中…
キャンセル
保存