oscar 0.3.0 → 0.3.1

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.
data/CHANGELOG CHANGED
@@ -1,6 +1,17 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 0.3.1
5
+ -----
6
+
7
+ 2013-09-11
8
+
9
+ This is a backwards compatible bugfix release.
10
+
11
+ * Improvements to command line interface, messages, and help options
12
+ * Updated README to be vaguely helpful
13
+ * Update 'roles' template to behave with auto_network and vagrant 1.2.7+
14
+
4
15
  0.3.0
5
16
  -----
6
17
 
data/README.markdown CHANGED
@@ -1,10 +1,119 @@
1
1
  Oscar
2
2
  =====
3
3
 
4
- Oscar helps you build a full Puppet Enterprise environment from vagrant base boxes.
4
+ Oscar is a set of Vagrant plugins and templates that build up a full Puppet
5
+ Enterprise environment based on top of Vagrant.
6
+
7
+ Synopsis
8
+ --------
9
+
10
+ Initialize the base Oscar environment:
11
+
12
+ └> vagrant oscar init
13
+ A stub Vagrantfile has been placed in this directory and default configurations
14
+ have been placed into the `config` directory. You can now run `vagrant up` to start
15
+ your Oscar built environment, courtesy of Vagrant.
16
+
17
+ Define a set of VMs:
18
+
19
+ └> vagrant oscar init-vms \
20
+ --master master=centos-64-x64-vbox4210-nocm \
21
+ --agent first=centos-59-x64-vbox4210-nocm \
22
+ --agent second=ubuntu-server-10044-x64-vbox4210-nocm
23
+ Your environment has been initialized with the following configuration:
24
+ masters:
25
+ - ["master", "centos-64-x64-vbox4210-nocm"]
26
+ agents:
27
+ - ["first", "centos-59-x64-vbox4210-nocm"]
28
+ - ["second", "ubuntu-server-10044-x64-vbox4210-nocm"]
29
+ pe_version: 3.0.1
30
+
31
+ And build everything:
32
+
33
+ └> vagrant up
34
+ Bringing machine 'master' up with 'virtualbox' provider...
35
+ Bringing machine 'first' up with 'virtualbox' provider...
36
+ Bringing machine 'second' up with 'virtualbox' provider...
37
+ [... normal `vagrant up` goes here ...]
38
+
39
+ Commands
40
+ --------
41
+
42
+ Oscar provides a set commands to generate a working environment from templates.
43
+
44
+ ### `vagrant oscar init`
45
+
46
+ This command initializes the current working directory with a stub Vagrantfile
47
+ that loads Oscar, and generates generic configuration information for use with
48
+ PE.
49
+
50
+ ### `vagrant oscar init-vms`
51
+
52
+ This command generates a set of guest machines inside of the vagrant
53
+ environment.
54
+
55
+ Configuring
56
+ -----------
57
+
58
+ Oscar handles guest machine configuration with YAML.
59
+
60
+ The default configuration looks something like this:
61
+
62
+ ### `config/boxes.yaml`
63
+
64
+ ---
65
+ # Boxes from http://puppet-vagrant-boxes.puppetlabs.com/
66
+ # Updated: 2013-08-08
67
+ boxes:
68
+ 'fedora-18-x64-vbox4210-nocm': 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box'
69
+ 'centos-64-x64-vbox4210-nocm': 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box'
70
+ 'centos-59-x64-vbox4210-nocm': 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box'
71
+ [...]
72
+
73
+ ### `config/roles.yaml`
74
+
75
+ ---
76
+ roles:
77
+ pe-puppet-master:
78
+ private_networks:
79
+ - {auto_network: true}
80
+ provider:
81
+ type: virtualbox
82
+ customize:
83
+ - [modifyvm, !ruby/sym id, '--memory', 1024]
84
+ provisioners:
85
+ - {type: hosts}
86
+ - {type: pe_bootstrap, role: !ruby/sym master}
87
+ [...]
88
+
89
+ ### `config/pe_build.yaml`
90
+
91
+ ---
92
+ pe_build:
93
+ version: 3.0.0
94
+
95
+ ### `config/vms.yaml`
96
+
97
+ ---
98
+ vms:
99
+ - name: master
100
+ box: centos-6-i386
101
+ roles:
102
+ - pe-puppet-master
103
+ - name: agent
104
+ box: debian-6-i386
105
+ roles:
106
+ - pe-puppet-agent
107
+
108
+ Oscar uses `vagrant-config_builder` to handle guest machine configuration.
5
109
 
6
110
  Installation
7
111
  ------------
8
112
 
9
- gem install --pre oscar
10
- # magic!
113
+ $ vagrant plugin install oscar
114
+
115
+ Requirements
116
+ ------------
117
+
118
+ The plugins used in Oscar require the Vagrant 1.1 plugin API, so Vagrant 1.1+ is
119
+ required.
@@ -33,6 +33,11 @@ class Oscar::Command::Init < Vagrant.plugin('2', :command)
33
33
  o.on('-p', '--provider=val', String, 'The Vagrant provider type to template') do |val|
34
34
  @provider = val
35
35
  end
36
+
37
+ o.on('-h', '--help', 'Display this help message') do
38
+ puts o
39
+ exit 0
40
+ end
36
41
  end
37
42
  end
38
43
  end
@@ -12,7 +12,9 @@ class Oscar::Command::InitVMs < Vagrant.plugin('2', :command)
12
12
 
13
13
  @masters = []
14
14
  @agents = []
15
- @pe_version = '3.0.0' # @todo remove thingy
15
+
16
+ require 'pe_build/release'
17
+ @pe_version = PEBuild::Release::LATEST_VERSION
16
18
 
17
19
  split_argv
18
20
  end
@@ -20,22 +22,16 @@ class Oscar::Command::InitVMs < Vagrant.plugin('2', :command)
20
22
  def execute
21
23
  argv = parse_options(parser)
22
24
 
23
- config_dir = Pathname.new(File.join(Dir.getwd, 'config'))
24
-
25
- vm_config_file = config_dir + 'vms.yaml'
26
- pe_config_file = config_dir + 'pe_build.yaml'
27
-
28
- config_dir.mkpath unless config_dir.exist?
25
+ write_configs
29
26
 
30
- vm_config_file.open('w') do |fh|
31
- yaml = YAML.dump vms
32
- fh.write(yaml)
33
- end
34
-
35
- pe_config_file.open('w') do |fh|
36
- yaml = YAML.dump pe_build
37
- fh.write(yaml)
38
- end
27
+ @env.ui.info(
28
+ I18n.t(
29
+ 'oscar.command.init_vms.settings',
30
+ :masters => @masters.map { |m| " - #{m}" }.join("\n"),
31
+ :agents => @agents.map { |m| " - #{m}" }.join("\n"),
32
+ :pe_version => @pe_version,
33
+ )
34
+ )
39
35
  end
40
36
 
41
37
  private
@@ -58,24 +54,46 @@ class Oscar::Command::InitVMs < Vagrant.plugin('2', :command)
58
54
  o.on('-p', '--pe-version=val', String, 'The PE version to install on the VMs') do |val|
59
55
  @pe_version = val
60
56
  end
57
+
58
+ o.on('-h', '--help', 'Display this help message') do
59
+ puts o
60
+ exit 0
61
+ end
61
62
  end
62
63
  end
63
64
 
64
- def vms
65
- vm_list = []
65
+ def write_configs
66
+ config_dir = Pathname.new(File.join(Dir.getwd, 'config'))
67
+
68
+ vm_config_file = config_dir + 'vms.yaml'
69
+ pe_config_file = config_dir + 'pe_build.yaml'
66
70
 
71
+ config_dir.mkpath unless config_dir.exist?
67
72
 
73
+ vm_config_file.open('w') do |fh|
74
+ yaml = YAML.dump vms
75
+ fh.write(yaml)
76
+ end
77
+
78
+ pe_config_file.open('w') do |fh|
79
+ yaml = YAML.dump pe_build
80
+ fh.write(yaml)
81
+ end
82
+ end
83
+
84
+ def vms
85
+ vm_list = []
68
86
 
69
- vm_list += @masters.map do |(name, box)|
70
- {
87
+ @masters.each do |(name, box)|
88
+ vm_list << {
71
89
  'name' => name,
72
90
  'box' => box,
73
91
  'roles' => ['pe-puppet-master']
74
92
  }
75
93
  end
76
94
 
77
- vm_list += @agents.map do |(name, box)|
78
- {
95
+ @agents.each do |(name, box)|
96
+ vm_list << {
79
97
  'name' => name,
80
98
  'box' => box,
81
99
  'roles' => ['pe-puppet-agent']
data/lib/oscar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oscar
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
data/oscar.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.homepage = 'https://github.com/adrienthebo/oscar'
19
19
 
20
20
  gem.add_dependency 'vagrant-hosts', '>= 1.1.2'
21
- gem.add_dependency 'vagrant-pe_build', '>= 0.3.0'
21
+ gem.add_dependency 'vagrant-pe_build', '>= 0.4.2'
22
22
  gem.add_dependency 'vagrant-auto_network', '>= 0.2.0'
23
23
  gem.add_dependency 'vagrant-config_builder', '>= 0.1.0'
24
24
 
@@ -7,3 +7,11 @@ en:
7
7
  A stub Vagrantfile has been placed in this directory and default configurations
8
8
  have been placed into the `config` directory. You can now run `vagrant up` to start
9
9
  your Oscar built environment, courtesy of Vagrant.
10
+ init_vms:
11
+ settings: |-
12
+ Your environment has been initialized with the following configuration:
13
+ masters:
14
+ %{masters}
15
+ agents:
16
+ %{agents}
17
+ pe_version: %{pe_version}
@@ -1,4 +1,5 @@
1
1
  # -*- mode: ruby -*-
2
2
  # vi: set ft=ruby :
3
3
 
4
+ Vagrant.require_plugin('oscar')
4
5
  Vagrant.configure('2', &Oscar.run(File.expand_path('../config', __FILE__)))
@@ -2,7 +2,7 @@
2
2
  roles:
3
3
  pe-puppet-master:
4
4
  private_networks:
5
- - {auto_network: true}
5
+ - {ip: '0.0.0.0', auto_network: true}
6
6
  provider:
7
7
  type: virtualbox
8
8
  customize:
@@ -13,7 +13,7 @@ roles:
13
13
 
14
14
  pe-puppet-agent:
15
15
  private_networks:
16
- - {auto_network: true}
16
+ - {ip: '0.0.0.0', auto_network: true}
17
17
  provisioners:
18
18
  - {type: hosts}
19
19
  - {type: pe_bootstrap}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oscar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-18 00:00:00.000000000 Z
12
+ date: 2013-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant-hosts
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: 0.3.0
37
+ version: 0.4.2
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: 0.3.0
45
+ version: 0.4.2
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: vagrant-auto_network
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +88,6 @@ files:
88
88
  - Gemfile
89
89
  - LICENSE
90
90
  - README.markdown
91
- - config/.gitignore
92
91
  - lib/oscar.rb
93
92
  - lib/oscar/command.rb
94
93
  - lib/oscar/command/helpers.rb