knife-topo 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,42 @@
1
+ /*jslint node: true */
2
+ "use strict";
3
+
4
+ /**
5
+ * Module dependencies.
6
+ */
7
+
8
+ var express = require('express')
9
+ , ejs = require('ejs')
10
+ , http = require('http')
11
+ ;
12
+
13
+ // APPLICATION INITIALIZATION
14
+
15
+
16
+ /*
17
+ * Setup the express middleware pipeline.
18
+ */
19
+ var app = express();
20
+
21
+ app.set('port', 3001 );
22
+ app.set('views', __dirname);
23
+ app.set('view engine', 'html'); // default extension to use if omitted
24
+ app.engine('html', ejs.renderFile); // Use ejs engine for routed html
25
+ app.use(app.router); // Enables routing
26
+
27
+
28
+ //render the index page
29
+ app.get('/', function(req, res) {
30
+ var username = (req.user && req.user.userName) ? req.user.userName : "";
31
+ res.render('index.html');
32
+ });
33
+
34
+
35
+ /*
36
+ * Startup the http server
37
+ */
38
+ http.createServer(app).listen(app.get('port'), function(){
39
+ console.log("YPO example application server started and listening on port " + app.get('port'));
40
+ });
41
+
42
+
@@ -0,0 +1,9 @@
1
+ name 'testapp'
2
+ maintainer 'ThirdWave Insights LLC'
3
+ maintainer_email 'christine_draper@thirdwaveinsights.com'
4
+ license 'Apache v2.0'
5
+ description 'Installs/Configures test application'
6
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
+ version '0.1'
8
+ depends 'mongodb'
9
+ depends 'nodejs'
@@ -0,0 +1,8 @@
1
+ #
2
+ # Cookbook Name:: testapp
3
+ # Recipe:: db
4
+ #
5
+ # Copyright 2014, ThirdWave Insights
6
+ #
7
+
8
+ include_recipe "nodejs::install_from_package"
@@ -0,0 +1,9 @@
1
+ #
2
+ # Cookbook Name:: testapp
3
+ # Recipe:: db
4
+ #
5
+ # Copyright 2014, ThirdWave Insights
6
+ #
7
+
8
+ include_recipe "mongodb::10gen_repo"
9
+ include_recipe "mongodb::default"
@@ -0,0 +1,11 @@
1
+ #
2
+ # Cookbook Name:: testapp
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2014, ThirdWave Insights
6
+ #
7
+ #
8
+
9
+ include_recipe "testapp::db"
10
+ include_recipe "testapp::appserver"
11
+ include_recipe "testapp::deploy"
@@ -0,0 +1,50 @@
1
+ #
2
+ # Cookbook Name:: testapp
3
+ # Recipe:: deploy
4
+ #
5
+ # Copyright 2014, ThirdWave Insights
6
+ #
7
+ #
8
+
9
+ directory "/home/vagrant/ypo" do
10
+ owner "vagrant"
11
+ group "vagrant"
12
+ mode 00750
13
+ action :create
14
+ end
15
+
16
+ cookbook_file "/home/vagrant/ypo/server.js" do
17
+ source 'server.js'
18
+ end
19
+
20
+ cookbook_file "/home/vagrant/ypo/package.json" do
21
+ source 'package.json'
22
+ end
23
+
24
+ cookbook_file "/home/vagrant/ypo/index.html" do
25
+ source 'index.html'
26
+ end
27
+
28
+ execute 'install_ypo' do
29
+ cwd "/home/vagrant/ypo"
30
+ user "vagrant"
31
+ command "npm install"
32
+ end
33
+
34
+ template "ypo.upstart.conf" do
35
+ path "/etc/init/ypo.conf"
36
+ source 'nodejs.upstart.conf.erb'
37
+ mode '0644'
38
+ variables(
39
+ :user => 'vagrant',
40
+ :node_dir => '/usr',
41
+ :app_dir => '/home/vagrant',
42
+ :entry => 'ypo'
43
+ )
44
+ end
45
+
46
+ service 'ypo' do
47
+ provider Chef::Provider::Service::Upstart
48
+ supports :restart => true, :start => true, :stop => true
49
+ action [:restart]
50
+ end
@@ -0,0 +1,9 @@
1
+ #!upstart
2
+ description "Node.js Application Server"
3
+
4
+ start on (local-filesystems and net-device-up IFACE!=lo)
5
+ stop on [!12345]
6
+
7
+ console log
8
+ chdir <%= @app_dir %>
9
+ exec <%= @node_dir %>/bin/node <%= @entry %>
@@ -0,0 +1,117 @@
1
+ [{
2
+ "name": "test1",
3
+ "chef_environment": "test",
4
+ "tags":
5
+ [
6
+ "testsys"
7
+ ],
8
+ "normal":
9
+ {
10
+ "owner": {
11
+ "name": "Christine Draper",
12
+ "phone": "512-xxx-xxxx",
13
+ "email": "christine_draper@thirdwaveinsights.com"
14
+ }
15
+ },
16
+ "nodes":
17
+ {
18
+ "appserver":
19
+ {
20
+ "name": "appserver01",
21
+ "ssh_host": "10.0.1.3",
22
+ "run_list":
23
+ [
24
+ "recipe[apt]",
25
+ "recipe[testapp::appserver]",
26
+ "testapp::deploy"
27
+ ],
28
+
29
+ "normal":
30
+ {
31
+ "topo":
32
+ {
33
+ "node_type": "appserver"
34
+ }
35
+ }
36
+ },
37
+
38
+ "dbserver":
39
+ {
40
+ "name": "dbserver01",
41
+ "ssh_host": "10.0.1.2",
42
+ "run_list":
43
+ [
44
+ "recipe[apt]",
45
+ "recipe[testapp::db]"
46
+ ],
47
+
48
+ "tags":
49
+ [
50
+ "testapp_database"
51
+ ],
52
+
53
+ "normal":
54
+ {
55
+ "topo":
56
+ {
57
+ "node_type": "dbserver"
58
+ }
59
+ }
60
+ }
61
+ },
62
+
63
+ "cookbook_attributes":
64
+ [
65
+ {
66
+ "normal":
67
+ {
68
+ "nodejs":
69
+ {
70
+ "version": "0.28"
71
+ },
72
+
73
+ "testapp":
74
+ {
75
+ "version": "1.0"
76
+ },
77
+
78
+ "mongodb":
79
+ {
80
+ "package_version": "2.6.1"
81
+ }
82
+ },
83
+
84
+ "node_type":
85
+ {
86
+ "buildserver":
87
+ {
88
+ "normal":
89
+ {
90
+ "mongodb":
91
+ {
92
+ "package_version": "2.5.1"
93
+ }
94
+ }
95
+ }
96
+ },
97
+
98
+ "cookbook": "testsys_test1",
99
+ "filename": "softwareversion"
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "name": "test2",
105
+ "chef_environment": "test",
106
+ "tags":
107
+ [
108
+ "testsys"
109
+ ],
110
+ "normal":
111
+ {
112
+ "owner": "John Sweitzer"
113
+ },
114
+ "nodes":
115
+ {
116
+ }
117
+ }]
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "test1",
3
+ "chef_environment": "test",
4
+ "tags":
5
+ [
6
+ "testsys"
7
+ ],
8
+ "normal":
9
+ {
10
+ "owner": {
11
+ "name": "Christine Draper",
12
+ "phone": "512-xxx-xxxx",
13
+ "email": "christine_draper@thirdwaveinsights.com"
14
+ }
15
+ },
16
+ "nodes":
17
+ [
18
+ {
19
+ "name": "appserver01",
20
+ "ssh_host": "10.0.1.3",
21
+ "run_list":
22
+ [
23
+ "recipe[apt]",
24
+ "recipe[testapp::appserver]",
25
+ "testapp::deploy"
26
+ ],
27
+
28
+ "normal":
29
+ {
30
+ "topo":
31
+ {
32
+ "node_type": "appserver"
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "name": "dbserver01",
38
+ "ssh_host": "10.0.1.2",
39
+ "run_list":
40
+ [
41
+ "recipe[apt]",
42
+ "recipe[testapp::db]"
43
+ ],
44
+
45
+ "tags":
46
+ [
47
+ "testapp_database"
48
+ ],
49
+
50
+ "normal":
51
+ {
52
+ "topo":
53
+ {
54
+ "node_type": "dbserver"
55
+ }
56
+ }
57
+ }
58
+ ],
59
+
60
+ "cookbook_attributes":
61
+ [
62
+ {
63
+ "normal":
64
+ {
65
+ "nodejs":
66
+ {
67
+ "version": "0.28"
68
+ },
69
+
70
+ "testapp":
71
+ {
72
+ "version": "1.0"
73
+ },
74
+
75
+ "mongodb":
76
+ {
77
+ "package_version": "2.6.1"
78
+ }
79
+ },
80
+
81
+ "node_type":
82
+ {
83
+ "buildserver":
84
+ {
85
+ "normal":
86
+ {
87
+ "mongodb":
88
+ {
89
+ "package_version": "2.5.1"
90
+ }
91
+ }
92
+ }
93
+ },
94
+
95
+ "cookbook": "testsys_test1",
96
+ "filename": "softwareversion"
97
+ }
98
+ ]
99
+ }
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: knife-topo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Christine Draper
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-07-19 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Knife plugin that to manage topologies of nodes
15
+ email:
16
+ - christine_draper@thirdwaveinsights.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/chef/knife/topo_export.rb
22
+ - lib/chef/knife/topo_bootstrap.rb
23
+ - lib/chef/knife/topo/version.rb
24
+ - lib/chef/knife/topo_cookbook_create.rb
25
+ - lib/chef/knife/topo_create.rb
26
+ - lib/chef/knife/topo_update.rb
27
+ - lib/chef/knife/topo_import.rb
28
+ - lib/chef/knife/topology_helper.rb
29
+ - lib/chef/knife/topo_cookbook_upload.rb
30
+ - test-repo/topology.json
31
+ - test-repo/Berksfile
32
+ - test-repo/Vagrantfile
33
+ - test-repo/multipletopology.json
34
+ - test-repo/Instructions.txt
35
+ - test-repo/cookbooks/testapp/recipes/appserver.rb
36
+ - test-repo/cookbooks/testapp/recipes/deploy.rb
37
+ - test-repo/cookbooks/testapp/recipes/default.rb
38
+ - test-repo/cookbooks/testapp/recipes/db.rb
39
+ - test-repo/cookbooks/testapp/templates/default/nodejs.upstart.conf.erb
40
+ - test-repo/cookbooks/testapp/CHANGELOG.md
41
+ - test-repo/cookbooks/testapp/metadata.rb
42
+ - test-repo/cookbooks/testapp/README.md
43
+ - test-repo/cookbooks/testapp/files/default/index.html
44
+ - test-repo/cookbooks/testapp/files/default/package.json
45
+ - test-repo/cookbooks/testapp/files/default/server.js
46
+ - test-repo/cookbooks/README.md
47
+ - test-repo/.chef/knife.rb
48
+ - test-repo/.chef/dummy.pem
49
+ - LICENSE
50
+ - README.md
51
+ - knife-topo.gemspec
52
+ homepage: https://github.com/christinedraper/knife-topo
53
+ licenses:
54
+ - Apache License (2.0)
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubyforge_project:
73
+ rubygems_version: 1.8.23
74
+ signing_key:
75
+ specification_version: 3
76
+ summary: Knife plugin that to manage topologies of nodes
77
+ test_files: []
78
+ has_rdoc: