Class: Vagrant::Provisioners::Ansible::Config

Inherits:
Config::Base
  • Object
show all
Defined in:
lib/vagrant-ansible/provisioner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



16
17
18
# File 'lib/vagrant-ansible/provisioner.rb', line 16

def initialize

end

Instance Attribute Details

#ask_sudo_passObject

Returns the value of attribute ask_sudo_pass.



13
14
15
# File 'lib/vagrant-ansible/provisioner.rb', line 13

def ask_sudo_pass
  @ask_sudo_pass
end

#hostsObject

Returns the value of attribute hosts.



11
12
13
# File 'lib/vagrant-ansible/provisioner.rb', line 11

def hosts
  @hosts
end

#inventory_fileObject

Returns the value of attribute inventory_file.



12
13
14
# File 'lib/vagrant-ansible/provisioner.rb', line 12

def inventory_file
  @inventory_file
end

#playbookObject

Returns the value of attribute playbook.



10
11
12
# File 'lib/vagrant-ansible/provisioner.rb', line 10

def playbook
  @playbook
end

#sudoObject

Returns the value of attribute sudo.



14
15
16
# File 'lib/vagrant-ansible/provisioner.rb', line 14

def sudo
  @sudo
end

Instance Method Details

#validate(env, errors) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/vagrant-ansible/provisioner.rb', line 20

def validate(env, errors)
  # Validate that the parameters are properly set
  if playbook.nil?
    errors.add(I18n.t("vagrant.provisioners.ansible.no_playbook"))
  end
  if hosts.nil? and inventory_file.nil?
    errors.add(I18n.t("vagrant.provisioners.ansible.no_hosts"))
  end
end