vagrant-ansible 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/vagrant-ansible/provisioner.rb +14 -11
  2. metadata +8 -8
@@ -3,13 +3,15 @@ require 'tempfile'
3
3
  module Vagrant
4
4
  module Provisioners
5
5
  class Ansible < Base
6
- VERSION = '0.0.2'
6
+ VERSION = '0.0.3'
7
7
  include Util::SafeExec
8
8
 
9
9
  class Config < Vagrant::Config::Base
10
10
  attr_accessor :playbook
11
11
  attr_accessor :hosts
12
12
  attr_accessor :inventory_file
13
+ attr_accessor :ask_sudo_pass
14
+ attr_accessor :sudo
13
15
 
14
16
  def initialize
15
17
 
@@ -56,16 +58,17 @@ module Vagrant
56
58
  ssh = env[:vm].config.ssh
57
59
 
58
60
  with_inventory_file(ssh) do |inventory_file|
59
- puts ["ansible-playbook",
60
- "--user=#{ssh.username}",
61
- "--inventory-file=#{inventory_file}",
62
- "--private-key=#{env[:vm].env.default_private_key_path}",
63
- config.playbook].join(' ')
64
- safe_exec("ansible-playbook",
65
- "--user=#{ssh.username}",
66
- "--inventory-file=#{inventory_file}",
67
- "--private-key=#{env[:vm].env.default_private_key_path}",
68
- config.playbook)
61
+ options = %W[--user=#{ssh.username}
62
+ --inventory-file=#{inventory_file}
63
+ --private-key=#{env[:vm].env.default_private_key_path}]
64
+
65
+ options << "--ask-sudo-pass" if config.ask_sudo_pass
66
+ options << "--sudo" if config.sudo
67
+
68
+ cmd = (%w(ansible-playbook) << options << config.playbook).flatten
69
+
70
+ puts cmd
71
+ safe_exec *cmd
69
72
  end
70
73
  end
71
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-06 00:00:00.000000000 Z
12
+ date: 2012-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant
16
- requirement: &19992640 !ruby/object:Gem::Requirement
16
+ requirement: &10075680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19992640
24
+ version_requirements: *10075680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &20005240 !ruby/object:Gem::Requirement
27
+ requirement: &10074980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.10'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *20005240
35
+ version_requirements: *10074980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &20002620 !ruby/object:Gem::Requirement
38
+ requirement: &10074520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '3.0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *20002620
46
+ version_requirements: *10074520
47
47
  description: Develop & test your ansible playbooks with Vagrant
48
48
  email:
49
49
  - git@dsander.de