Class: Vagrant::Provisioners::Ansible::Config
- Inherits:
-
Config::Base
- Object
- Config::Base
- Vagrant::Provisioners::Ansible::Config
- Defined in:
- lib/vagrant-ansible/provisioner.rb
Instance Attribute Summary collapse
-
#ask_sudo_pass ⇒ Object
Returns the value of attribute ask_sudo_pass.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#inventory_file ⇒ Object
Returns the value of attribute inventory_file.
-
#playbook ⇒ Object
Returns the value of attribute playbook.
-
#sudo ⇒ Object
Returns the value of attribute sudo.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #options ⇒ Object
-
#options=(*opts) ⇒ Object
Allows for assigning one to many options to pass to ansible-playbook.
- #validate(env, errors) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
16 17 18 |
# File 'lib/vagrant-ansible/provisioner.rb', line 16 def initialize @options = [] end |
Instance Attribute Details
#ask_sudo_pass ⇒ Object
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 |
#hosts ⇒ Object
Returns the value of attribute hosts.
11 12 13 |
# File 'lib/vagrant-ansible/provisioner.rb', line 11 def hosts @hosts end |
#inventory_file ⇒ Object
Returns the value of attribute inventory_file.
12 13 14 |
# File 'lib/vagrant-ansible/provisioner.rb', line 12 def inventory_file @inventory_file end |
#playbook ⇒ Object
Returns the value of attribute playbook.
10 11 12 |
# File 'lib/vagrant-ansible/provisioner.rb', line 10 def playbook @playbook end |
#sudo ⇒ Object
Returns the value of attribute sudo.
14 15 16 |
# File 'lib/vagrant-ansible/provisioner.rb', line 14 def sudo @sudo end |
Instance Method Details
#options ⇒ Object
39 40 41 |
# File 'lib/vagrant-ansible/provisioner.rb', line 39 def @options end |
#options=(*opts) ⇒ Object
Allows for assigning one to many options to pass to ansible-playbook.
31 32 33 34 35 36 37 |
# File 'lib/vagrant-ansible/provisioner.rb', line 31 def (*opts) @options = if opts.is_a? String [opts] else opts end end |
#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 |