vagrant-templated 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +14 -1
- data/config/templates/attributes/base.yml +17 -0
- data/config/templates/attributes/django1.11.yml +32 -0
- data/config/templates/attributes/rails5.yml +5 -0
- data/config/templates/files/Vagrantfile.erb +9 -0
- data/lib/vagrant-templated/version.rb +1 -1
- data/spec/tmp/basic/Berksfile +6 -0
- data/spec/tmp/basic/Berksfile.lock +7 -0
- data/spec/tmp/basic/Vagrantfile +22 -0
- data/spec/tmp/django1.11/Berksfile +7 -0
- data/spec/tmp/django1.11/Berksfile.lock +9 -0
- data/spec/tmp/django1.11/Vagrantfile +38 -0
- data/spec/vagrant_templated_spec.rb +25 -1
- metadata +9 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4307eaa387b3de9e14771895cb18f1e7d77010e5
|
4
|
+
data.tar.gz: ee3af7cf57704b6e792c315e2247ff00f8acc49b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7829b77b92087c4354d041f3988a852c65741ae747bb6418e09bc826f260c9ac4d3795e43f18ffd39e556785800ca798833490f3d06a831dff0ba4908084c387
|
7
|
+
data.tar.gz: 68913f04ebb573382d6d9d61cb6730c8af1bc72b781fae05df8af4814624c24e1fdda7c7826ab7fc4fd20cfeeae6bad74abc4eed38f9633fbb9bba8ac99dea82
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.1.4] - 2017-08-05
|
10
|
+
### Added
|
11
|
+
- Test all templates
|
12
|
+
- Add comment attribute to private network
|
13
|
+
- Add django1.11 template, with pyenv, including python 2 and 3
|
14
|
+
- Add basic template, only apt and tz update
|
15
|
+
- Add private network configuration and use it at rails5 template
|
16
|
+
|
9
17
|
## [0.1.3] - 2017-08-05
|
10
18
|
### Added
|
11
19
|
- Refactor defaults to attributes, it's more self documented now
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,12 @@ The new init action runs like this:
|
|
23
23
|
vagrant templated init <template>
|
24
24
|
```
|
25
25
|
|
26
|
-
The templates available at this moment are
|
26
|
+
The templates available at this moment are:
|
27
|
+
|
28
|
+
- `base`: apt and timezone update
|
29
|
+
- `vagrant-plugin`: base and ruby 2.3
|
30
|
+
- `django1.11`: base, python 2/3 (pyenv)
|
31
|
+
- `rails5`: base, ruby 2.4 (rbenv), node and postgresql.
|
27
32
|
|
28
33
|
In both cases a Vagrantfile and a Berksfile will be generated where you executing the command.
|
29
34
|
|
@@ -37,6 +42,14 @@ After checking out the repo, run `bundle install` to install dependencies. Then,
|
|
37
42
|
|
38
43
|
Bug reports and pull requests are welcome on GitHub at https://github.com/afaundes/vagrant-templated. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
39
44
|
|
45
|
+
## TODO list
|
46
|
+
|
47
|
+
- Refactor template management in a isolated component, making plugin more skinnier
|
48
|
+
- Add multiple choices for some components. For example, rails5 add postgresql by default, but it could be mysql or sqlite3 (that what I have used). Maybe it would better to add everything and leave everything commented but one default.
|
49
|
+
- Display ad hoc tips when new files are created
|
50
|
+
- Add tips as a command
|
51
|
+
- Refactor versions, maybe add version to the options
|
52
|
+
|
40
53
|
## License
|
41
54
|
|
42
55
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -0,0 +1,17 @@
|
|
1
|
+
base:
|
2
|
+
omnibus:
|
3
|
+
chef_version: latest
|
4
|
+
berkself:
|
5
|
+
cookbooks:
|
6
|
+
apt: ~> 6.1.3
|
7
|
+
timezone_iii: ~> 1.0.4
|
8
|
+
chef:
|
9
|
+
recipes:
|
10
|
+
- apt
|
11
|
+
- timezone_iii
|
12
|
+
json:
|
13
|
+
timezone_iii: UTC
|
14
|
+
require:
|
15
|
+
vagrant-plugins:
|
16
|
+
- vagrant-omnibus
|
17
|
+
- vagrant-berkshelf
|
@@ -0,0 +1,32 @@
|
|
1
|
+
django1.11:
|
2
|
+
omnibus:
|
3
|
+
chef_version: 12.21.1
|
4
|
+
network:
|
5
|
+
private_network:
|
6
|
+
ip: 192.168.33.101
|
7
|
+
comments:
|
8
|
+
- "TIP: Change the IP if it causes problem"
|
9
|
+
- "TIP: Make sure to have something like this on your settings.py:"
|
10
|
+
- "ALLOWED_HOSTS = ['192.168.33.101', 'localhost', '127.0.0.1']"
|
11
|
+
berkself:
|
12
|
+
cookbooks:
|
13
|
+
apt: ~> 6.1.3
|
14
|
+
timezone_iii: ~> 1.0.4
|
15
|
+
pyenv: ~> 0.1.4
|
16
|
+
chef:
|
17
|
+
recipes:
|
18
|
+
- apt
|
19
|
+
- timezone_iii
|
20
|
+
- pyenv::user
|
21
|
+
json:
|
22
|
+
timezone: UTC
|
23
|
+
pyenv:
|
24
|
+
user_installs:
|
25
|
+
- user: vagrant
|
26
|
+
pythons:
|
27
|
+
- 3.4.0
|
28
|
+
- 2.7.6
|
29
|
+
require:
|
30
|
+
vagrant-plugins:
|
31
|
+
- vagrant-omnibus
|
32
|
+
- vagrant-berkshelf
|
@@ -12,6 +12,15 @@ end
|
|
12
12
|
|
13
13
|
Vagrant.configure('2') do |config|
|
14
14
|
config.vm.box = 'bento/ubuntu-16.04'
|
15
|
+
|
16
|
+
<%- if template_attributes['network'] && template_attributes['network']['private_network'] -%>
|
17
|
+
|
18
|
+
<%- Array(template_attributes['network']['private_network']['comments']).each do |comment| -%>
|
19
|
+
<%= "# #{comment.strip}" %>
|
20
|
+
<%- end -%>
|
21
|
+
config.vm.network 'private_network', ip: '<%= template_attributes['network']['private_network']['ip'] %>'
|
22
|
+
|
23
|
+
<%- end -%>
|
15
24
|
config.omnibus.chef_version = '<%= template_attributes['omnibus']['chef_version'] %>'
|
16
25
|
config.vm.provision :chef_solo do |chef|
|
17
26
|
<%- template_attributes['chef']['recipes'].each do |recipe| -%>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
# Vagrantfile generated with https://github.com/afaundez/vagrant-templated
|
4
|
+
|
5
|
+
["vagrant-omnibus", "vagrant-berkshelf"].each do |plugin_name|
|
6
|
+
unless Vagrant.has_plugin? plugin_name
|
7
|
+
raise "#{plugin_name} plugin is required. Please run `vagrant plugin install #{plugin_name}`"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Vagrant.configure('2') do |config|
|
12
|
+
config.vm.box = 'bento/ubuntu-16.04'
|
13
|
+
config.omnibus.chef_version = 'latest'
|
14
|
+
config.vm.provision :chef_solo do |chef|
|
15
|
+
chef.add_recipe 'apt'
|
16
|
+
chef.add_recipe 'timezone_iii'
|
17
|
+
|
18
|
+
chef.json = {
|
19
|
+
"timezone_iii": "UTC"
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
# Vagrantfile generated with https://github.com/afaundez/vagrant-templated
|
4
|
+
|
5
|
+
["vagrant-omnibus", "vagrant-berkshelf"].each do |plugin_name|
|
6
|
+
unless Vagrant.has_plugin? plugin_name
|
7
|
+
raise "#{plugin_name} plugin is required. Please run `vagrant plugin install #{plugin_name}`"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Vagrant.configure('2') do |config|
|
12
|
+
config.vm.box = 'bento/ubuntu-16.04'
|
13
|
+
|
14
|
+
# TIP: choose an IP available in your network
|
15
|
+
config.vm.network 'private_network', ip: '192.168.33.101'
|
16
|
+
|
17
|
+
config.omnibus.chef_version = '12.21.1'
|
18
|
+
config.vm.provision :chef_solo do |chef|
|
19
|
+
chef.add_recipe 'apt'
|
20
|
+
chef.add_recipe 'timezone_iii'
|
21
|
+
chef.add_recipe 'pyenv::user'
|
22
|
+
|
23
|
+
chef.json = {
|
24
|
+
"timezone": "UTC",
|
25
|
+
"pyenv": {
|
26
|
+
"user_installs": [
|
27
|
+
{
|
28
|
+
"user": "vagrant",
|
29
|
+
"pythons": [
|
30
|
+
"3.4.0",
|
31
|
+
"2.7.6"
|
32
|
+
]
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
@@ -63,7 +63,31 @@ describe Vagrant::Templated::Command::Init do
|
|
63
63
|
}.to raise_error Vagrant::Errors::BerksfileTemplatedExistsError
|
64
64
|
end
|
65
65
|
|
66
|
-
it 'should create Vagrantfile and Berksfile if both do not exist' do
|
66
|
+
it 'should create Vagrantfile and Berksfile if both do not exist using template base' do
|
67
|
+
expect{
|
68
|
+
described_class.new(['base'], @env).execute
|
69
|
+
}.to_not raise_error
|
70
|
+
expect(File.open(@vagrantfile).read).to include(vagrantfile_tag)
|
71
|
+
expect(File.open(@berksfile).read).to include(berksfile_tag)
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should create Vagrantfile and Berksfile if both do not exist using template vagrant-plugin' do
|
75
|
+
expect{
|
76
|
+
described_class.new(['vagrant-plugin'], @env).execute
|
77
|
+
}.to_not raise_error
|
78
|
+
expect(File.open(@vagrantfile).read).to include(vagrantfile_tag)
|
79
|
+
expect(File.open(@berksfile).read).to include(berksfile_tag)
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'should create Vagrantfile and Berksfile if both do not exist using template django1.11' do
|
83
|
+
expect{
|
84
|
+
described_class.new(['django1.11'], @env).execute
|
85
|
+
}.to_not raise_error
|
86
|
+
expect(File.open(@vagrantfile).read).to include(vagrantfile_tag)
|
87
|
+
expect(File.open(@berksfile).read).to include(berksfile_tag)
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should create Vagrantfile and Berksfile if both do not exist using template rails5' do
|
67
91
|
expect{
|
68
92
|
described_class.new(['rails5'], @env).execute
|
69
93
|
}.to_not raise_error
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-templated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Álvaro Faúndez
|
@@ -77,6 +77,8 @@ files:
|
|
77
77
|
- bin/console
|
78
78
|
- bin/setup
|
79
79
|
- config/locales/en.yml
|
80
|
+
- config/templates/attributes/base.yml
|
81
|
+
- config/templates/attributes/django1.11.yml
|
80
82
|
- config/templates/attributes/rails5.yml
|
81
83
|
- config/templates/attributes/vagrant-plugin.yml
|
82
84
|
- config/templates/files/Berksfile.erb
|
@@ -91,6 +93,12 @@ files:
|
|
91
93
|
- spec/tmp/.keep
|
92
94
|
- spec/tmp/Berksfile
|
93
95
|
- spec/tmp/Vagrantfile
|
96
|
+
- spec/tmp/basic/Berksfile
|
97
|
+
- spec/tmp/basic/Berksfile.lock
|
98
|
+
- spec/tmp/basic/Vagrantfile
|
99
|
+
- spec/tmp/django1.11/Berksfile
|
100
|
+
- spec/tmp/django1.11/Berksfile.lock
|
101
|
+
- spec/tmp/django1.11/Vagrantfile
|
94
102
|
- spec/vagrant_templated_spec.rb
|
95
103
|
- vagrant-templated.gemspec
|
96
104
|
homepage: https://github.com/afaundez/vagrant-templated
|