vagrant-converge 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fef5e81535b2611270691691391a131cd86f9eb
4
- data.tar.gz: 17d0e5f01d114c973d706ae84b55c96f8422b47d
3
+ metadata.gz: 1c87aea02338ea71e07d51609cf47aad43bf7375
4
+ data.tar.gz: 17e61438fbcc0a5891c6ef316226a3c3df5185aa
5
5
  SHA512:
6
- metadata.gz: 2b7bdd97749823eae7db8120f6e94f0ef3340e5e50263645144e3580fa93b98222f9cd8bf1674ae520ba7a1d938467d184701511368c3da60eee06359d0c147d
7
- data.tar.gz: fe32f1f3719579b7b5fa8adb00c305f3d110a3dc13fc5aa800a82a02f39cc1b87d6b4119488886afa68b202036780eab28e901e76867a07581f15535f0b4c820
6
+ metadata.gz: 0638c82ad9cca56b97a7c4c5a1d738cba09e882479b170bac3210ffd5992d4b573a11cfa09093849e81481983e5055dcbc850eb80e10e1468e81d9ebf311f3f6
7
+ data.tar.gz: 784730e194f104cdcddf790449580ac209a45148912fb9e212778fc98668f9dfde0e5f1d90feb27065d9314bdd9426b8285b6e289da7cec7c7252ce678d7f522
data/README.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # vagrant-converge
2
2
 
3
- Vagrant provisioner plugin for converge
3
+ [![Gem Version](https://badge.fury.io/rb/vagrant-converge.svg)](https://badge.fury.io/rb/vagrant-converge)
4
+ [![Gem](https://img.shields.io/gem/dt/vagrant-converge.svg)](https://rubygems.org/gems/vagrant-converge)
5
+ [![Gem](https://img.shields.io/gem/dtv/vagrant-converge.svg)](https://rubygems.org/gems/vagrant-converge)
4
6
 
7
+ ## Installation
8
+
9
+ $ vagrant plugin install vagrant-converge
10
+
11
+ Uninstall with:
12
+
13
+ $ vagrant plugin uninstall vagrant-converge
14
+
15
+ Update the plugin with:
16
+
17
+ $ vagrant plugin update vagrant-converge
18
+
19
+ ## Options
20
+
21
+ * `bikeshed` (required) - A list of files to run through Converge. Can be a single path as a string
22
+ * `ca_file` (optional) - Path to a CA certificate to trust. Requires `use_ssl`
23
+ * `cert_file` (optional) - Path to a certificate file for SSL. Requires `use_ssl`
24
+ * `key_file` (optional) - Path to a key file for SSL. Requires `use_ssl`
25
+ * `install` (optoinal) - Install Converge binary. Default to `true`
26
+ * `local` (optional) - Run Converge in local mode. Defaults to `true`
27
+ * `local_addr` (optional) - Address to use for local RPC connection
28
+ * `log_level` (optional) - Logging level. One of `DEBUG`, `INFO`, `WARN`, `ERROR` or `FATAL`. Default is `INFO`
29
+ * `no_token` (optional) - Don't use or generate an RPC token
30
+ * `params` (optional) - A hash of parameter/value pairs to pass to Converge
31
+ * `rpc_addr` (optional) - Address for server RPC connection. Overrides `local`
32
+ * `rpc_token` (optional) - Token to use for RPC
33
+ * `verbose` (optional) - Run the Converge plugin in verbose mode
34
+
35
+ ## Example
36
+
37
+ config.vm.provision :converge do |cvg|
38
+ cfg.params = {
39
+ "message" = "Not the default message"
40
+ }
41
+ cfg.bikeshed = [
42
+ "https://bintray.com/chrisaubuchon/generic/download_file?file_path=test.hcl"
43
+ ]
44
+ cfg.install = true
45
+ end
5
46
 
@@ -3,10 +3,19 @@ module VagrantConverge
3
3
  class Guest < Vagrant.plugin("2", :config)
4
4
 
5
5
  attr_accessor :bikeshed
6
- attr_accessor :params
7
- attr_accessor :local
6
+ attr_accessor :ca_file
7
+ attr_accessor :cert_file
8
8
  attr_accessor :install
9
9
  attr_accessor :install_mode
10
+ attr_accessor :key_file
11
+ attr_accessor :local
12
+ attr_accessor :local_addr
13
+ attr_accessor :log_level
14
+ attr_accessor :no_token
15
+ attr_accessor :params
16
+ attr_accessor :rpc_addr
17
+ attr_accessor :rpc_token
18
+ attr_accessor :use_ssl
10
19
  attr_accessor :verbose
11
20
  attr_accessor :version
12
21
 
@@ -14,22 +23,46 @@ module VagrantConverge
14
23
  super
15
24
 
16
25
  @bikeshed = UNSET_VALUE
26
+ @ca_file = UNSET_VALUE
27
+ @cert_file = UNSET_VALUE
17
28
  @install = UNSET_VALUE
18
29
  @install_mode = UNSET_VALUE
30
+ @key_file = UNSET_VALUE
19
31
  @local = UNSET_VALUE
32
+ @local_addr = UNSET_VALUE
33
+ @log_level = UNSET_VALUE
34
+ @no_token = UNSET_VALUE
20
35
  @params = UNSET_VALUE
36
+ @rpc_addr = UNSET_VALUE
37
+ @rpc_token = UNSET_VALUE
38
+ @use_ssl = UNSET_VALUE
21
39
  @verbose = UNSET_VALUE
22
40
  @version = UNSET_VALUE
23
41
  end
24
42
 
25
43
  def finalize!
26
44
  @bikeshed = nil if @bikeshed == UNSET_VALUE
45
+ @ca_file = nil if @ca_file == UNSET_VALUE
46
+ @cert_file = nil if @cert_file == UNSET_VALUE
27
47
  @install = true if @install == UNSET_VALUE
28
48
  @install_mode = :default if @install_mode == UNSET_VALUE
49
+ @key_file = nil if @key_file == UNSET_VALUE
29
50
  @local = true if @local == UNSET_VALUE
51
+ @local_addr = nil if @local_addr == UNSET_VALUE
52
+ @log_level = "INFO" if @log_level == UNSET_VALUE
53
+ @no_token = nil if @no_token == UNSET_VALUE
30
54
  @params = nil if @params == UNSET_VALUE
55
+ @rpc_addr = nil if @rpc_addr == UNSET_VALUE
56
+ @rpc_token = nil if @rpc_token == UNSET_VALUE
57
+ @use_ssl = false if @use_ssl == UNSET_VALUE
31
58
  @verbose = false if @verbose == UNSET_VALUE
32
59
  @version = "" if @version == UNSET_VALUE
60
+
61
+ # RPC connection takes precedence over local
62
+ if @rpc_addr
63
+ @local = false
64
+ @local_addr = nil
65
+ end
33
66
  end
34
67
 
35
68
  def validate(machine)
@@ -67,8 +67,21 @@ module VagrantConverge
67
67
  shell_command << "apply"
68
68
 
69
69
  shell_command << "--local" if config.local
70
+ shell_command << "--local-addr=" + config.local_addr if config.local_addr
71
+ shell_command << "--log-level=" + config.log_level
72
+ shell_command << "--no-token" if config.no_token
70
73
  shell_command << "--paramsJSON='" + config.params.to_json + "'" if config.params
71
74
 
75
+ shell_command << "--rpc-addr='" + config.rpc_addr + "'" if config.rpc_addr
76
+ shell_command << "--rpc-token='" + config.rpc_token + "'" if config.rpc_token
77
+
78
+ if config.use_ssl
79
+ shell_command << "--use-ssl"
80
+ shell_command << "--ca-file='" + config.ca_file + "'" if config.ca_file
81
+ shell_command << "--cert-file='" + config.cert_file + "'" if config.cert_file
82
+ shell_command << "--key-file='" + config.key_file + "'" if config.key_file
83
+ end
84
+
72
85
  config.bikeshed.each do |arg|
73
86
  shell_command << arg
74
87
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantConverge
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-converge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Aubuchon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-16 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler